comparison rasusa.xml @ 3:add156116c63 draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/rasusa commit 3a1b13f3f0845f60b4a023fd547a9d2ad0170072
author iuc
date Wed, 10 Jul 2024 17:01:16 +0000
parents c8f1cd6c1fbf
children
comparison
equal deleted inserted replaced
2:c8f1cd6c1fbf 3:add156116c63
1 <tool id="rasusa" name="rasusa" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="22.05"> 1 <tool id="rasusa" name="rasusa" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="22.05">
2 <description>Randomly subsample reads to a specified coverage</description> 2 <description>Randomly subsample reads to a specified coverage</description>
3 <macros> 3 <macros>
4 <token name="@TOOL_VERSION@">0.8.0</token> 4 <token name="@TOOL_VERSION@">2.0.0</token>
5 <token name="@VERSION_SUFFIX@">0</token> 5 <token name="@VERSION_SUFFIX@">0</token>
6 <token name="@FORMATS@">fastqsanger,fastqsanger.gz,fasta,fasta.gz</token> 6 <token name="@FORMATS@">fastqsanger,fastqsanger.gz,fasta,fasta.gz</token>
7 <xml name="size_units"> 7 <xml name="size_units">
8 <option value="b">bases</option> 8 <option value="b">bases</option>
9 <option value="k">Kilo bases</option> 9 <option value="k">Kilo bases</option>
10 <option value="m">Mega bases</option> 10 <option value="m">Mega bases</option>
11 <option value="g">Giga bases</option> 11 <option value="g">Giga bases</option>
12 <option value="t">Tera bases</option> 12 <option value="t">Tera bases</option>
13 </xml> 13 </xml>
14 </macros> 14 <xml name="params_fastq">
15 <xrefs> 15 <conditional name="subsample">
16 <xref type='bio.tools'>rasusa</xref> 16 <param name="type" type="select" label="Subsample reads based on">
17 </xrefs> 17 <option value="coverage">Coverage</option>
18 <requirements> 18 <option value="num_bases">Number of bases</option>
19 <requirement type="package" version="@TOOL_VERSION@">rasusa</requirement> 19 <option value="num_reads">Number of reads</option>
20 </requirements> 20 <option value="frac_reads" selected="true">Fraction of reads</option>
21 21 </param>
22 <command detect_errors="exit_code"><![CDATA[ 22 <when value="coverage">
23 rasusa 23 <param name="genome_size_unit" type="select" label="Specify genome size in">
24 #if str( $input.input_selector ) == "paired": 24 <expand macro="size_units" />
25 #set r1_ext = $input.reads1.extension 25 </param>
26 #set r2_ext = $input.reads2.extension 26 <param name="genome_size" type="float" min="0" value="" label="Genome size to calculate coverage with respect to"/>
27 -i '${input.reads1}' 27 <param argument="--coverage" type="float" min="0" value="" label="The desired coverage to subsample the reads to"/>
28 -i '${input.reads2}' 28 </when>
29 -o 'paired_out1.$r1_ext' 29 <when value="num_bases">
30 -o 'paired_out2.$r2_ext' 30 <param name="num_bases_unit" type="select" label="Specify number of bases in">
31 #elif str( $input.input_selector ) == "paired_collection": 31 <expand macro="size_units" />
32 #set r1_ext = $input.collection.forward.extension 32 </param>
33 #set r2_ext = $input.collection.reverse.extension 33 <param name="bases" type="float" min="0" value="" label="Explicitly set the number of bases required"/>
34 -i '${input.collection.forward}' 34 </when>
35 -i '${input.collection.reverse}' 35 <when value="num_reads">
36 -o 'paired_out1.$r1_ext' 36 <param argument="--num" type="integer" value="" min="1"/>
37 -o 'paired_out2.$r2_ext' 37 </when>
38 #else: 38 <when value="frac_reads">
39 #set r1_ext = $input.reads.extension 39 <param argument="--frac" type="float" value="0.1" min="0" max="1"/>
40 -i '${input.reads}' 40 </when>
41 -o 'single_out.$r1_ext' 41 </conditional>
42 #end if 42 </xml>
43 <token name="@FASTQ_SUBSAMPLE_OPTIONS@"><![CDATA[
43 #if str( $subsample.type ) == "coverage": 44 #if str( $subsample.type ) == "coverage":
44 --genome-size '$subsample.genome_size$subsample.genome_size_unit' 45 --genome-size '$subsample.genome_size$subsample.genome_size_unit'
45 --coverage $subsample.coverage 46 --coverage $subsample.coverage
46 #elif str( $subsample.type ) == "num_bases": 47 #elif str( $subsample.type ) == "num_bases":
47 --bases '$subsample.bases$subsample.num_bases_unit' 48 --bases '$subsample.bases$subsample.num_bases_unit'
48 #elif str( $subsample.type ) == "num_reads": 49 #elif str( $subsample.type ) == "num_reads":
49 --num $subsample.num 50 --num $subsample.num
50 #elif str( $subsample.type ) == "frac_reads": 51 #elif str( $subsample.type ) == "frac_reads":
51 --frac $subsample.frac 52 --frac $subsample.frac
52 #end if 53 #end if
53 -s $seed
54 #if $r1_ext.endswith(".gz") or $r2_ext.endswith(".gz") 54 #if $r1_ext.endswith(".gz") or $r2_ext.endswith(".gz")
55 --output-type g 55 --output-type g
56 #end if ]]>
57 </token>
58 </macros>
59 <xrefs>
60 <xref type='bio.tools'>rasusa</xref>
61 </xrefs>
62 <requirements>
63 <requirement type="package" version="@TOOL_VERSION@">rasusa</requirement>
64 <requirement type="package" version="1.20">samtools</requirement>
65 </requirements>
66
67 <command detect_errors="exit_code"><![CDATA[
68 #if str( $input.input_selector ) == "aligned":
69 ln -s '$bam' 'input.bam' &&
70 ln -s '$bam.metadata.bam_index' 'input.bam.bai' &&
71 rasusa aln
72 --coverage $input.coverage
73 --step-size $input.step_size
74 #else:
75 rasusa reads
56 #end if 76 #end if
57 && 77
78 #if $seed
79 -s $seed
80 #end if
58 81
59 #if str( $input.input_selector ) == "paired": 82 #if str( $input.input_selector ) == "paired":
83 #set r1_ext = $input.reads1.extension
84 #set r2_ext = $input.reads2.extension
85 -o 'paired_out1.$r1_ext'
86 -o 'paired_out2.$r2_ext'
87 @FASTQ_SUBSAMPLE_OPTIONS@
88 '${input.reads1}'
89 '${input.reads2}' &&
60 mv 'paired_out1.$r1_ext' '$paired_output1' && 90 mv 'paired_out1.$r1_ext' '$paired_output1' &&
61 mv 'paired_out2.$r2_ext' '$paired_output2' 91 mv 'paired_out2.$r2_ext' '$paired_output2'
92
62 #elif str( $input.input_selector ) == "paired_collection": 93 #elif str( $input.input_selector ) == "paired_collection":
94 #set r1_ext = $input.collection.forward.extension
95 #set r2_ext = $input.collection.reverse.extension
96 -o 'paired_out1.$r1_ext'
97 -o 'paired_out2.$r2_ext'
98 @FASTQ_SUBSAMPLE_OPTIONS@
99 '${input.collection.forward}'
100 '${input.collection.reverse}' &&
63 mv 'paired_out1.$r1_ext' '${collection_output.forward}' && 101 mv 'paired_out1.$r1_ext' '${collection_output.forward}' &&
64 mv 'paired_out2.$r2_ext' '${collection_output.reverse}' 102 mv 'paired_out2.$r2_ext' '${collection_output.reverse}'
65 #else: 103
104 #elif str( $input.input_selector ) == "single":
105 #set r1_ext = $input.reads.extension
106 -o 'single_out.$r1_ext'
107 @FASTQ_SUBSAMPLE_OPTIONS@
108 '${input.reads}' &&
66 mv 'single_out.$r1_ext' '$single_output' 109 mv 'single_out.$r1_ext' '$single_output'
110
111 #elif str( $input.input_selector ) == "aligned":
112 'input.bam' | samtools sort --no-PG -@ 1 -T '\${TMPDIR:-.}' -O bam -o '$bam_output' -
67 #end if 113 #end if
68 ]]></command> 114 ]]></command>
69 <inputs> 115 <inputs>
70 <conditional name="input"> 116 <conditional name="input">
71 <param name="input_selector" type="select" label="Single or Paired-end reads" help="Select between paired and single end data"> 117 <param name="input_selector" type="select" label="Single or Paired-end reads" help="Select between paired and single end data">
72 <option value="paired">Paired</option> 118 <option value="paired">Paired-end FASTQ</option>
73 <option value="single">Single</option> 119 <option value="single">Single-end FASTQ</option>
74 <option value="paired_collection">Paired Collection</option> 120 <option value="paired_collection">Paired FASTQ Collection</option>
121 <option value="aligned">BAM file of aligned reads</option>
75 </param> 122 </param>
76 <when value="paired"> 123 <when value="paired">
77 <param name="reads1" type="data" format="@FORMATS@" label="Select first set of reads" help="Specify dataset with forward reads"/> 124 <param name="reads1" type="data" format="@FORMATS@" label="Select first set of reads" help="Specify dataset with forward reads"/>
78 <param name="reads2" type="data" format="@FORMATS@" label="Select second set of reads" help="Specify dataset with reverse reads"/> 125 <param name="reads2" type="data" format="@FORMATS@" label="Select second set of reads" help="Specify dataset with reverse reads"/>
126 <expand macro="params_fastq" />
79 </when> 127 </when>
80 <when value="single"> 128 <when value="single">
81 <param name="reads" type="data" format="@FORMATS@" label="Select fasta/fastq dataset" help="Specify dataset with single reads"/> 129 <param name="reads" type="data" format="@FORMATS@" label="Select fasta/fastq dataset" help="Specify dataset with single reads"/>
130 <expand macro="params_fastq" />
82 </when> 131 </when>
83 <when value="paired_collection"> 132 <when value="paired_collection">
84 <param name="collection" format="@FORMATS@" type="data_collection" collection_type="paired" label="Select a paired collection"/> 133 <param name="collection" format="@FORMATS@" type="data_collection" collection_type="paired" label="Select a paired collection"/>
134 <expand macro="params_fastq" />
135 </when>
136 <when value="aligned">
137 <param name="bam" format="sam,bam" type="data" label="Select BAM file(s) with alignments"/>
138 <param argument="--coverage" type="integer" min="0" optional="true" value="" label="The desired depth of coverage to subsample the alignment to"/>
139 <param type="integer" argument="--step-size" value="100" label="When a region has less than the desired coverage, the step size to move along the chromosome to find more reads."
140 help="The lowest of the step and the minimum end coordinate of the reads in the region will be used. This parameter can have a significant impact on the runtime of the subsampling process."/>
85 </when> 141 </when>
86 </conditional> 142 </conditional>
87 <conditional name="subsample"> 143 <param type="integer" argument="--seed" optional="true" label="Random seed to use"/>
88 <param name="type" type="select" label="Subsample reads based on">
89 <option value="coverage">Coverage</option>
90 <option value="num_bases">Number of bases</option>
91 <option value="num_reads">Number of reads</option>
92 <option value="frac_reads" selected="true">Fraction of reads</option>
93 </param>
94 <when value="coverage">
95 <param name="genome_size_unit" type="select" label="Specify genome size in">
96 <expand macro="size_units" />
97 </param>
98 <param name="genome_size" type="float" min="0" value="" label="Genome size to calculate coverage with respect to"/>
99 <param argument="--coverage" type="float" min="0" value="" label="The desired coverage to sub-sample the reads to"/>
100 </when>
101 <when value="num_bases">
102 <param name="num_bases_unit" type="select" label="Specify number of bases in">
103 <expand macro="size_units" />
104 </param>
105 <param name="bases" type="float" min="0" value="" label="Explicitly set the number of bases required"/>
106 </when>
107 <when value="num_reads">
108 <param argument="--num" type="integer" value="" min="1"/>
109 </when>
110 <when value="frac_reads">
111 <param argument="--frac" type="float" value="0.1" min="0" max="1"/>
112 </when>
113 </conditional>
114 <param type="integer" name="seed" optional="true" label="Random seed to use"/>
115 </inputs> 144 </inputs>
116 <outputs> 145 <outputs>
117 <data name="paired_output1" label="${tool.name} on ${on_string}: paired-end r1" format_source="reads1"> 146 <data name="paired_output1" label="${tool.name} on ${on_string}: paired-end r1" format_source="reads1">
118 <filter>input['input_selector'] == "paired"</filter> 147 <filter>input['input_selector'] == "paired"</filter>
119 </data> 148 </data>
126 <collection name="collection_output" type="paired" label="${tool.name} on ${on_string}: paired-collection"> 155 <collection name="collection_output" type="paired" label="${tool.name} on ${on_string}: paired-collection">
127 <filter>input['input_selector'] == "paired_collection"</filter> 156 <filter>input['input_selector'] == "paired_collection"</filter>
128 <data name="forward" label="${tool.name} on ${input.collection.forward.name}: paired-end r1" format_source="collection['forward']"/> 157 <data name="forward" label="${tool.name} on ${input.collection.forward.name}: paired-end r1" format_source="collection['forward']"/>
129 <data name="reverse" label="${tool.name} on ${input.collection.reverse.name}: paired-end R2" format_source="collection['reverse']"/> 158 <data name="reverse" label="${tool.name} on ${input.collection.reverse.name}: paired-end R2" format_source="collection['reverse']"/>
130 </collection> 159 </collection>
160 <data name="bam_output" label="${tool.name} on ${on_string}: BAM" format="bam">
161 <filter>input['input_selector'] == 'aligned'</filter>
162 </data>
131 </outputs> 163 </outputs>
132 <tests> 164 <tests>
133 <test expect_num_outputs="1"> 165 <test expect_num_outputs="1">
134 <!-- test 1: single-end fastq by coverage in bases --> 166 <!-- test 1: single-end fastq by coverage in bases -->
135 <conditional name="input"> 167 <conditional name="input">
161 <param name="seed" value="1"/> 193 <param name="seed" value="1"/>
162 <output name="paired_output1" value="paired1_by_coverage_k.fastq.gz" ftype="fastqsanger.gz"/> 194 <output name="paired_output1" value="paired1_by_coverage_k.fastq.gz" ftype="fastqsanger.gz"/>
163 <output name="paired_output2" value="paired2_by_coverage_k.fastq.gz" ftype="fastqsanger.gz"/> 195 <output name="paired_output2" value="paired2_by_coverage_k.fastq.gz" ftype="fastqsanger.gz"/>
164 </test> 196 </test>
165 <test expect_num_outputs="3"> 197 <test expect_num_outputs="3">
166 <!-- test 3: paired-collection fastq by coverage in mb--> 198 <!-- test 3: paired-collection fastq by coverage in mb -->
167 <conditional name="input"> 199 <conditional name="input">
168 <param name="input_selector" value="paired_collection"/> 200 <param name="input_selector" value="paired_collection"/>
169 <param name="collection"> 201 <param name="collection">
170 <collection type="paired"> 202 <collection type="paired">
171 <element name="forward" value="r1.fastq.gz"/> 203 <element name="forward" value="r1.fastq.gz"/>
230 <param name="seed" value="1"/> 262 <param name="seed" value="1"/>
231 <output name="paired_output1" value="paired1_by_num_reads.fasta.gz" ftype="fasta.gz"/> 263 <output name="paired_output1" value="paired1_by_num_reads.fasta.gz" ftype="fasta.gz"/>
232 <output name="paired_output2" value="paired2_by_num_reads.fasta.gz" ftype="fasta.gz"/> 264 <output name="paired_output2" value="paired2_by_num_reads.fasta.gz" ftype="fasta.gz"/>
233 </test> 265 </test>
234 <test expect_num_outputs="3"> 266 <test expect_num_outputs="3">
235 <!-- test 7: paired-collection fasta by fraction reads--> 267 <!-- test 7: paired-collection fasta by fraction reads -->
236 <conditional name="input"> 268 <conditional name="input">
237 <param name="input_selector" value="paired_collection"/> 269 <param name="input_selector" value="paired_collection"/>
238 <param name="collection"> 270 <param name="collection">
239 <collection type="paired"> 271 <collection type="paired">
240 <element name="forward" value="r1.fasta"/> 272 <element name="forward" value="r1.fasta"/>
250 <output_collection name="collection_output" type="paired"> 282 <output_collection name="collection_output" type="paired">
251 <element name="forward" file="paired1_by_frac_reads.fasta" ftype="fasta"/> 283 <element name="forward" file="paired1_by_frac_reads.fasta" ftype="fasta"/>
252 <element name="reverse" file="paired2_by_frac_reads.fasta" ftype="fasta"/> 284 <element name="reverse" file="paired2_by_frac_reads.fasta" ftype="fasta"/>
253 </output_collection> 285 </output_collection>
254 </test> 286 </test>
287 <test expect_num_outputs="1">
288 <!-- test 8: bam input -->
289 <conditional name="input">
290 <param name="input_selector" value="aligned"/>
291 <param name="bam" value="input.bam" />
292 </conditional>
293 <param name="coverage" value="1"/>
294 <param name="seed" value="1"/>
295 <output name="bam_output" value="output.bam" ftype="bam"/>
296 </test>
255 </tests> 297 </tests>
256 <help><![CDATA[ 298 <help><![CDATA[
257 299
258 Randomly subsample reads to a specified coverage. Rasusa provides a random subsample of a read file (FASTA or FASTQ), with two ways of 300 Randomly subsample reads to a specified coverage. Rasusa provides a random subsample of a read file (FASTA or FASTQ), with two ways of
259 specifying the size of the subset: 301 specifying the size of the subset: