annotate downsample.xml @ 0:20823bce09e7 draft

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
author dave
date Tue, 24 Sep 2019 16:20:27 -0400
parents
children 03aeb837e398
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
1 <?xml version="1.0"?>
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
2 <tool id="dynamic_downsample" name="Dynamically downsample" version="1.0.0">
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
3 <description>reads to desired coverage</description>
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
4 <requirements>
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
5 <requirement type="package" version="1.9">samtools</requirement>
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
6 <requirement type="package" version="5.0.1">gawk</requirement>
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
7 </requirements>
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
8 <command><![CDATA[
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
9 if FACTOR=\$(samtools depth '$reads' | awk '{ a[i++]=\$3; } END { x=int((i+1)/2); if (x < (i+1)/2) y=(a[x-1]+a[x])/2; else y=a[x-1]; f = 1/(y/$coverage) ; if (f >= 1) exit 1 ; else print f }') ;
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
10 then samtools view '$reads' -s \$FACTOR -O $reads.datatype -o '$output' ;
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
11 else ;
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
12 cp '$reads' '$output'
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
13 fi
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
14 ]]>
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
15 </command>
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
16 <inputs>
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
17 <param name="reads" type="data" format="sam,bam" label="Reads to downsample" />
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
18 <param name="coverage" type="integer" value="1000" label="Target coverage" />
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
19 </inputs>
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
20 <outputs>
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
21 <data format="bam" name="output" label="${tool.name} on ${on_string} (Downsampled to ${coverage}x coverage)">
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
22 <change_format>
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
23 <when input="reads" value="sam" format="sam" />
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
24 </change_format>
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
25 </data>
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
26 </outputs>
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
27 <tests>
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
28 </tests>
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
29 <help>
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
30 </help>
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
31 <citations>
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
32 </citations>
20823bce09e7 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/downsample commit dd00e60bdbb1fb45d395bb59dd60795e39867624
dave
parents:
diff changeset
33 </tool>