Mercurial > repos > devteam > samtools_flagstat
comparison macros.xml @ 8:fefd89ab563c draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/samtools/samtools_flagstat commit cd62639660bef041ba14ecff337fb98e84e75d8a
author | iuc |
---|---|
date | Mon, 20 Nov 2023 22:15:35 +0000 |
parents | fe34990e5ce7 |
children |
comparison
equal
deleted
inserted
replaced
7:fe34990e5ce7 | 8:fefd89ab563c |
---|---|
3 <requirements> | 3 <requirements> |
4 <requirement type="package" version="@TOOL_VERSION@">samtools</requirement> | 4 <requirement type="package" version="@TOOL_VERSION@">samtools</requirement> |
5 <yield/> | 5 <yield/> |
6 </requirements> | 6 </requirements> |
7 </xml> | 7 </xml> |
8 <token name="@TOOL_VERSION@">1.13</token> | 8 <!-- NOTE: for some tools only the version of the requirement but not the |
9 tool's version is controlled by the TOOL_VERSION token | |
10 (because their version is ahead of the requirement version .. | |
11 please only bump the minor version in order to let the requirement | |
12 version catch up eventually). To find the tools check: | |
13 `grep "<tool" . -r | grep -v VERSION_SUFFIX | cut -d":" -f 1` --> | |
14 <token name="@TOOL_VERSION@">1.15.1</token> | |
15 <token name="@VERSION_SUFFIX@">2</token> | |
9 <token name="@PROFILE@">20.05</token> | 16 <token name="@PROFILE@">20.05</token> |
10 <token name="@FLAGS@"><![CDATA[ | 17 <token name="@FLAGS@"><![CDATA[ |
11 #set $flags = 0 | 18 #set $flags = 0 |
12 #if $filter | 19 #if $filter |
13 #set $flags = sum(map(int, str($filter).split(','))) | 20 #set $flags = sum(map(int, str($filter).split(','))) |
48 #end if | 55 #end if |
49 #end if | 56 #end if |
50 #end for | 57 #end for |
51 ]]></token> | 58 ]]></token> |
52 <token name="@PREPARE_FASTA_IDX@"><![CDATA[ | 59 <token name="@PREPARE_FASTA_IDX@"><![CDATA[ |
53 ##checks for reference data ($addref_cond.addref_select=="history" or =="cached") | 60 ## Make the user-selected reference genome, if any, accessible through |
54 ##and sets the -t/-T parameters accordingly: | 61 ## a shell variable $reffa, index the reference if necessary, and make |
55 ##- in case of history a symbolic link is used because samtools (view) will generate | 62 ## the fai-index file available through a shell variable $reffai. |
56 ## the index which might not be possible in the directory containing the fasta file | 63 |
57 ##- in case of cached the absolute path is used which allows to read the cram file | 64 ## For a cached genome simply sets the shell variables to point to the |
58 ## without specifying the reference | 65 ## genome file and its precalculated index. |
66 ## For a genome from the user's history, if that genome is a plain | |
67 ## fasta file, the code creates a symlink in the pwd, creates the fai | |
68 ## index file next to it, then sets the shell variables to point to the | |
69 ## symlink and its index. | |
70 ## For a fasta.gz dataset from the user's history, it tries the same, | |
71 ## but this will only succeed if the file got compressed with bgzip. | |
72 ## For a regular gzipped file samtools faidx will fail, in which case | |
73 ## the code falls back to decompressing to plain fasta before | |
74 ## reattempting the indexing. | |
75 ## Indexing of a bgzipped file produces a regular fai index file *and* | |
76 ## a compressed gzi file. The former is identical to the fai index of | |
77 ## the uncompressed fasta. | |
78 | |
79 ## If the user has not selected a reference (it's an optional parameter | |
80 ## in some samtools wrappers), a cheetah boolean use_ref is set to | |
81 ## False to encode that fact. | |
82 | |
83 #set use_ref=True | |
59 #if $addref_cond.addref_select == "history": | 84 #if $addref_cond.addref_select == "history": |
60 ln -s '${addref_cond.ref}' reference.fa && | 85 #if $addref_cond.ref.is_of_type('fasta'): |
61 samtools faidx reference.fa && | 86 reffa="reference.fa" && |
62 #set reffa="reference.fa" | 87 ln -s '${addref_cond.ref}' \$reffa && |
63 #set reffai="reference.fa.fai" | 88 samtools faidx \$reffa && |
89 #else: | |
90 reffa="reference.fa.gz" && | |
91 ln -s '${addref_cond.ref}' \$reffa && | |
92 { | |
93 samtools faidx \$reffa || | |
94 { | |
95 echo "Failed to index compressed reference. Trying decompressed ..." 1>&2 && | |
96 gzip -dc \$reffa > reference.fa && | |
97 reffa="reference.fa" && | |
98 samtools faidx \$reffa; | |
99 } | |
100 } && | |
101 #end if | |
102 reffai=\$reffa.fai && | |
64 #elif $addref_cond.addref_select == "cached": | 103 #elif $addref_cond.addref_select == "cached": |
65 #set reffa=str($addref_cond.ref.fields.path) | 104 ## in case of cached the absolute path is used which allows to read |
66 #set reffai=str($addref_cond.ref.fields.path)+".fai" | 105 ## a cram file without specifying the reference |
106 reffa='${addref_cond.ref.fields.path}' && | |
107 reffai=\$reffa.fai && | |
67 #else | 108 #else |
68 #set reffa=None | 109 #set use_ref=False |
69 #set reffai=None | 110 #end if |
70 #end if | 111 ]]></token> |
71 ]]></token> | 112 |
72 | 113 <xml name="optional_reference" token_help="" token_argument=""> |
73 <xml name="optional_reference"> | |
74 <conditional name="addref_cond"> | 114 <conditional name="addref_cond"> |
75 <param name="addref_select" type="select" label="Use a reference sequence"> | 115 <param name="addref_select" type="select" label="Use a reference sequence"> |
76 <help>@HELP@</help> | 116 <help>@HELP@</help> |
77 <option value="no">No</option> | 117 <option value="no">No</option> |
78 <option value="history">Use a genome/index from the history</option> | 118 <option value="history">Use a genome/index from the history</option> |
177 </conditional> | 217 </conditional> |
178 </xml> | 218 </xml> |
179 | 219 |
180 <xml name="citations"> | 220 <xml name="citations"> |
181 <citations> | 221 <citations> |
182 <citation type="bibtex"> | 222 <citation type="doi">10.1093/gigascience/giab008</citation> |
183 @misc{SAM_def, | |
184 title={Definition of SAM/BAM format}, | |
185 url = {https://samtools.github.io/hts-specs/},} | |
186 </citation> | |
187 <citation type="doi">10.1093/bioinformatics/btp352</citation> | |
188 <citation type="doi">10.1093/bioinformatics/btr076</citation> | |
189 <citation type="doi">10.1093/bioinformatics/btr509</citation> | |
190 <citation type="bibtex"> | |
191 @misc{Danecek_et_al, | |
192 Author={Danecek, P., Schiffels, S., Durbin, R.}, | |
193 title={Multiallelic calling model in bcftools (-m)}, | |
194 url = {http://samtools.github.io/bcftools/call-m.pdf},} | |
195 </citation> | |
196 <citation type="bibtex"> | |
197 @misc{Durbin_VCQC, | |
198 Author={Durbin, R.}, | |
199 title={Segregation based metric for variant call QC}, | |
200 url = {http://samtools.github.io/bcftools/rd-SegBias.pdf},} | |
201 </citation> | |
202 <citation type="bibtex"> | |
203 @misc{Li_SamMath, | |
204 Author={Li, H.}, | |
205 title={Mathematical Notes on SAMtools Algorithms}, | |
206 url = {http://www.broadinstitute.org/gatk/media/docs/Samtools.pdf},} | |
207 </citation> | |
208 <citation type="bibtex"> | |
209 @misc{SamTools_github, | |
210 title={SAMTools GitHub page}, | |
211 url = {https://github.com/samtools/samtools},} | |
212 </citation> | |
213 </citations> | 223 </citations> |
214 </xml> | 224 </xml> |
215 <xml name="version_command"> | 225 <xml name="version_command"> |
216 <version_command><![CDATA[samtools 2>&1 | grep Version]]></version_command> | 226 <version_command><![CDATA[samtools 2>&1 | grep Version]]></version_command> |
217 </xml> | 227 </xml> |