Mercurial > repos > iuc > samtools_coverage
comparison macros.xml @ 1:ae36fab06bc2 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tool_collections/samtools/sam_to_bam commit 5cb103832529f17e5c72e7f122758c13519fbe5e
author | iuc |
---|---|
date | Mon, 15 Aug 2022 09:15:40 +0000 |
parents | 90f2dd176d80 |
children |
comparison
equal
deleted
inserted
replaced
0:90f2dd176d80 | 1:ae36fab06bc2 |
---|---|
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 <token name="@TOOL_VERSION@">1.15.1</token> |
9 <token name="@PROFILE@">20.05</token> | 9 <token name="@PROFILE@">20.05</token> |
10 <token name="@FLAGS@"><![CDATA[ | 10 <token name="@FLAGS@"><![CDATA[ |
11 #set $flags = 0 | 11 #set $flags = 0 |
12 #if $filter | 12 #if $filter |
13 #set $flags = sum(map(int, str($filter).split(','))) | 13 #set $flags = sum(map(int, str($filter).split(','))) |
48 #end if | 48 #end if |
49 #end if | 49 #end if |
50 #end for | 50 #end for |
51 ]]></token> | 51 ]]></token> |
52 <token name="@PREPARE_FASTA_IDX@"><![CDATA[ | 52 <token name="@PREPARE_FASTA_IDX@"><![CDATA[ |
53 ##checks for reference data ($addref_cond.addref_select=="history" or =="cached") | 53 ## Make the user-selected reference genome, if any, accessible through |
54 ##and sets the -t/-T parameters accordingly: | 54 ## 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 | 55 ## 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 | 56 |
57 ##- in case of cached the absolute path is used which allows to read the cram file | 57 ## For a cached genome simply sets the shell variables to point to the |
58 ## without specifying the reference | 58 ## genome file and its precalculated index. |
59 ## For a genome from the user's history, if that genome is a plain | |
60 ## fasta file, the code creates a symlink in the pwd, creates the fai | |
61 ## index file next to it, then sets the shell variables to point to the | |
62 ## symlink and its index. | |
63 ## For a fasta.gz dataset from the user's history, it tries the same, | |
64 ## but this will only succeed if the file got compressed with bgzip. | |
65 ## For a regular gzipped file samtools faidx will fail, in which case | |
66 ## the code falls back to decompressing to plain fasta before | |
67 ## reattempting the indexing. | |
68 ## Indexing of a bgzipped file produces a regular fai index file *and* | |
69 ## a compressed gzi file. The former is identical to the fai index of | |
70 ## the uncompressed fasta. | |
71 | |
72 ## If the user has not selected a reference (it's an optional parameter | |
73 ## in some samtools wrappers), a cheetah boolean use_ref is set to | |
74 ## False to encode that fact. | |
75 | |
76 #set use_ref=True | |
59 #if $addref_cond.addref_select == "history": | 77 #if $addref_cond.addref_select == "history": |
60 ln -s '${addref_cond.ref}' reference.fa && | 78 #if $addref_cond.ref.is_of_type('fasta'): |
61 samtools faidx reference.fa && | 79 reffa="reference.fa" && |
62 #set reffa="reference.fa" | 80 ln -s '${addref_cond.ref}' \$reffa && |
63 #set reffai="reference.fa.fai" | 81 samtools faidx \$reffa && |
82 #else: | |
83 reffa="reference.fa.gz" && | |
84 ln -s '${addref_cond.ref}' \$reffa && | |
85 { | |
86 samtools faidx \$reffa || | |
87 { | |
88 echo "Failed to index compressed reference. Trying decompressed ..." 1>&2 && | |
89 gzip -dc \$reffa > reference.fa && | |
90 reffa="reference.fa" && | |
91 samtools faidx \$reffa; | |
92 } | |
93 } && | |
94 #end if | |
95 reffai=\$reffa.fai && | |
64 #elif $addref_cond.addref_select == "cached": | 96 #elif $addref_cond.addref_select == "cached": |
65 #set reffa=str($addref_cond.ref.fields.path) | 97 ## in case of cached the absolute path is used which allows to read |
66 #set reffai=str($addref_cond.ref.fields.path)+".fai" | 98 ## a cram file without specifying the reference |
99 reffa='${addref_cond.ref.fields.path}' && | |
100 reffai=\$reffa.fai && | |
67 #else | 101 #else |
68 #set reffa=None | 102 #set use_ref=False |
69 #set reffai=None | 103 #end if |
70 #end if | 104 ]]></token> |
71 ]]></token> | 105 |
72 | 106 <xml name="optional_reference" token_help="" token_argument=""> |
73 <xml name="optional_reference"> | |
74 <conditional name="addref_cond"> | 107 <conditional name="addref_cond"> |
75 <param name="addref_select" type="select" label="Use a reference sequence"> | 108 <param name="addref_select" type="select" label="Use a reference sequence"> |
76 <help>@HELP@</help> | 109 <help>@HELP@</help> |
77 <option value="no">No</option> | 110 <option value="no">No</option> |
78 <option value="history">Use a genome/index from the history</option> | 111 <option value="history">Use a genome/index from the history</option> |