comparison umi-tools_counts.xml @ 3:b557acca0b56 draft

planemo upload commit a7a086ce7d7d84f53d4a022fa1da25ef7b9a5b9a
author iuc
date Fri, 20 Jul 2018 03:50:03 -0400
parents 3c932ad4a174
children 70cb5527defb
comparison
equal deleted inserted replaced
2:2cf36d9ea571 3:b557acca0b56
1 <tool id="umi_tools_count" name="UMI-tools count" version="@VERSION@.1"> 1 <tool id="umi_tools_count" name="UMI-tools count" version="@VERSION@.2">
2 <description>performs quantification of UMIs from BAM files</description> 2 <description>performs quantification of UMIs from BAM files</description>
3 <macros> 3 <macros>
4 <import>macros.xml</import> 4 <import>macros.xml</import>
5 <xml name="sanitize_tag" > 5 <xml name="sanitize_tag" >
6 <sanitizer invalid_char=""> 6 <sanitizer invalid_char="">
8 </sanitizer> 8 </sanitizer>
9 </xml> 9 </xml>
10 </macros> 10 </macros>
11 <expand macro="requirements" /> 11 <expand macro="requirements" />
12 <command detect_errors="exit_code"><![CDATA[ 12 <command detect_errors="exit_code"><![CDATA[
13 ln -s '${input_bam}' 'input.bam' && 13 #import re
14 ln -s '${input_bam.metadata.bam_index}' 'input.bam.bai' && 14
15 15 ln -s '${input_bam}' 'input.bam' &&
16 umi_tools count 16 ln -s '${input_bam.metadata.bam_index}' 'input.bam.bai' &&
17 -I input.bam 17
18 '$paired' 18 umi_tools count
19 --extract-umi-method='$barcodes.extract_umi_method.value' 19 -I input.bam
20 #if str($barcodes.extract_umi_method) == 'read_id': 20 '$paired'
21 --umi-separator='$barcodes.umi_separator.value' 21 --extract-umi-method='$barcodes.extract_umi_method.value'
22 #else if str($barcodes.extract_umi_method) == 'tag': 22 #if str($barcodes.extract_umi_method) == 'read_id':
23 --umi-tag='$barcodes.umi_tag.value' 23 --umi-separator='$barcodes.umi_separator.value'
24 --cell-tag='$barcodes.cell_tag.value' 24 #else if str($barcodes.extract_umi_method) == 'tag':
25 #end if 25 --umi-tag='$barcodes.umi_tag.value'
26 --method='$method.value' 26 --cell-tag='$barcodes.cell_tag.value'
27 --edit-distance-threshold='$edit_distance_threshold' 27 #end if
28 --mapping-quality='$advanced.mapping_quality' 28 --method='$method.value'
29 --per-gene 29 --edit-distance-threshold='$edit_distance_threshold'
30 '$wide_format_cell_counts' 30 --mapping-quality='$advanced.mapping_quality'
31 '$advanced.per_contig' 31 --per-gene
32 '$advanced.per_cell' 32 '$wide_format_cell_counts'
33 #if str($advanced.gene_tag) != "": 33 '$advanced.per_contig'
34 --gene-tag='$advanced.gene_tag.value' 34 '$advanced.per_cell'
35 #end if 35
36 #if str($advanced.skip_tags_regex) != "": 36 #if str($advanced.gene_tag) != "":
37 --skip-tags-regex='$advanced.skip_tags_regex.value' 37 --gene-tag='$advanced.gene_tag.value'
38 #end if 38 #end if
39 #if '$advanced.random_seed' != 0: 39 #if str($advanced.skip_tags_regex) != "":
40 --random-seed='$advanced.random_seed' 40 --skip-tags-regex='$advanced.skip_tags_regex.value'
41 #end if 41 #end if
42 -S '$out_counts' 42 #if '$advanced.random_seed' != 0:
43 --random-seed='$advanced.random_seed'
44 #end if
45 -S '$out_counts'
46
47
48 #if str($cond_extra.prepender) != "none":
49 #set $replacer = re.sub('[^\w\_]+', '_', str($input_bam.element_identifier.rsplit('.',1)[0]))
50 #if str($cond_extra.prepender) == "string":
51 #set $replacer = str($cond_extra.custom_label)
52 #end if
53
54 && sed -i -r '1s|\b([ACGT]+)\b|'"$replacer"'_\1|g' '$out_counts'
55 #end if
56
43 ]]></command> 57 ]]></command>
44 <inputs> 58 <inputs>
45 <param name="input_bam" type="data" format="bam" label="Sorted BAM file" help="Please use the samtools sort tool to ensure a correct BAM input" /> 59 <param name="input_bam" type="data" format="bam" label="Sorted BAM file" help="Please use the samtools sort tool to ensure a correct BAM input" />
46 <param argument="--paired" type="boolean" truevalue="--paired" falsevalue="" checked="false" label="Bam is paired-end" help="both read pairs will be output. This will also force the use of the template length to determine reads with the same mapping coordinates." /> 60 <param argument="--paired" type="boolean" truevalue="--paired" falsevalue="" checked="false" label="Bam is paired-end" help="both read pairs will be output. This will also force the use of the template length to determine reads with the same mapping coordinates." />
47 <conditional name="barcodes" > 61 <conditional name="barcodes" >
82 <param argument="--mapping-quality" name="mapping_quality" type="integer" min="0" value="0" label="Minimum mapping quality" /> 96 <param argument="--mapping-quality" name="mapping_quality" type="integer" min="0" value="0" label="Minimum mapping quality" />
83 <!-- Currently hard-coded parameter. Leave here if useful to future wrapper --> 97 <!-- Currently hard-coded parameter. Leave here if useful to future wrapper -->
84 <!-- <param argument="-\-per-gene" name="per_gene" type="text" label="Group reads together if they have the same gene" help="Reads will be grouped together if they have the same gene. This is useful if your library 98 <!-- <param argument="-\-per-gene" name="per_gene" type="text" label="Group reads together if they have the same gene" help="Reads will be grouped together if they have the same gene. This is useful if your library
85 prep generates PCR duplicates with non-identical alignment positions such as CEL-Seq. Note this option is hardcoded to be on with the count command. I.e counting is always performed per-gene. Must be combined with either 99 prep generates PCR duplicates with non-identical alignment positions such as CEL-Seq. Note this option is hardcoded to be on with the count command. I.e counting is always performed per-gene. Must be combined with either
86 -\-gene-tag or -\-per-contig option" /> --> 100 -\-gene-tag or -\-per-contig option" /> -->
87 <param argument="--gene-tag" name="gene_tag" type="text" label="Deduplicate per gene." help="The gene information is encoded in the bam read tag." value="XT" > 101 <param argument="--gene-tag" name="gene_tag" type="text" label="Deduplicate per gene." value="XT" help="The gene information is encoded in the bam read tag." >
88 <expand macro="sanitize_tag" /> 102 <expand macro="sanitize_tag" />
89 </param> 103 </param>
90 <param argument="--skip-tags-regex" name="skip_tags_regex" type="text" label="Skip any reads where the gene matches this tag" value="" > 104 <param argument="--skip-tags-regex" name="skip_tags_regex" type="text" label="Skip any reads where the gene matches this tag" value="" >
91 <sanitizer invalid_char=""> 105 <sanitizer invalid_char="">
92 <valid initial="string.letters,string.digits"> 106 <valid initial="string.letters,string.digits">
109 </param> 123 </param>
110 <param argument="--per-contig" name="per_contig" type="boolean" truevalue="--per-contig" falsevalue="" checked="false" label="Deduplicate per contig (field 3 in BAM; RNAME)" help="All reads with the same contig will be considered to have the same alignment position. This is useful if you have aligned to a reference transcriptome with one transcript per gene." /> 124 <param argument="--per-contig" name="per_contig" type="boolean" truevalue="--per-contig" falsevalue="" checked="false" label="Deduplicate per contig (field 3 in BAM; RNAME)" help="All reads with the same contig will be considered to have the same alignment position. This is useful if you have aligned to a reference transcriptome with one transcript per gene." />
111 <param argument="--per-cell" name="per_cell" type="boolean" truevalue="--per-cell" falsevalue="" checked="true" label="Group reads only if they have the same cell barcode." /> 125 <param argument="--per-cell" name="per_cell" type="boolean" truevalue="--per-cell" falsevalue="" checked="true" label="Group reads only if they have the same cell barcode." />
112 <param argument="--random-seed" name="random_seed" type="integer" min="0" value="0" label="Random Seed" /> 126 <param argument="--random-seed" name="random_seed" type="integer" min="0" value="0" label="Random Seed" />
113 </section> 127 </section>
128 <conditional name="cond_extra" >
129 <param name="prepender" type="select" label="Prepend a label to all column headers" help="This preserves uniqueness when merging with other files with the same headers. Note: filename must not contain a '.' character" >
130 <option value="none" selected="true" >No modifications</option>
131 <option value="string">Custom Label</option>
132 <option value="dataset name">Dataset Name</option>
133 </param>
134 <when value="none"></when>
135 <when value="dataset name"></when>
136 <when value="string">
137 <param name="custom_label" type="text" label="Label to Prepend" >
138 <sanitizer invalid_char="">
139 <valid initial="string.letters,string.digits">
140 <add value="-"/>
141 <add value="_"/>
142 <add value="."/>
143 </valid>
144 </sanitizer>
145 </param>
146 </when>
147 </conditional>
114 </inputs> 148 </inputs>
115 <outputs> 149 <outputs>
116 <data name="out_counts" format="tabular" /> 150 <data name="out_counts" format="tabular" />
117 </outputs> 151 </outputs>
118 <tests> 152 <tests>
152 <test><!-- count ENSDARG00000019692, with defaults --> 186 <test><!-- count ENSDARG00000019692, with defaults -->
153 <param name="input_bam" value="fc.ENSDARG00000019692.bam" /> 187 <param name="input_bam" value="fc.ENSDARG00000019692.bam" />
154 <param name="method" value="unique" /> 188 <param name="method" value="unique" />
155 <output name="out_counts" value="fc.ENSDARG00000019692.counts" /> 189 <output name="out_counts" value="fc.ENSDARG00000019692.counts" />
156 </test> 190 </test>
191 <test><!-- count ENSDARG00000019692, relabel string -->
192 <param name="input_bam" value="fc.ENSDARG00000019692.bam" />
193 <param name="method" value="unique" />
194 <conditional name="cond_extra" >
195 <param name="prepender" value="string" />
196 <param name="custom_label" value="test" />
197 </conditional>
198 <output name="out_counts" value="fc.ENSDARG00000019692.counts.test" />
199 </test>
200 <test><!-- count ENSDARG00000019692, relabel filename -->
201 <param name="input_bam" value="fc.ENSDARG00000019692.bam" />
202 <param name="method" value="unique" />
203 <conditional name="cond_extra" >
204 <param name="prepender" value="dataset name" />
205 </conditional>
206 <output name="out_counts" value="fc.ENSDARG00000019692.counts.name" />
207 </test>
157 </tests> 208 </tests>
158 <help><![CDATA[ 209 <help><![CDATA[
159 210
160 UMI Tools count - Count reads per gene from BAM using UMIs 211 UMI Tools count - Count reads per gene from BAM using UMIs
161 ---------------------------------------------------------- 212 ----------------------------------------------------------