Mercurial > repos > devteam > samtools_phase
changeset 5:b85b9712cb18 draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/main/tool_collections/samtools/samtools_phase commit 19dd8b645a77899ff98d139d79de824a23f416bb
| author | iuc |
|---|---|
| date | Wed, 12 Nov 2025 13:04:22 +0000 |
| parents | 1e5880498f52 |
| children | |
| files | macros.xml samtools_phase.xml test-data/empty_file_1.bam test-data/empty_file_3.bam test-data/samtools_phase_out_1_phase0.bam test-data/samtools_phase_out_1_phase1.bam test-data/samtools_phase_out_2_chimera.bam test-data/samtools_phase_out_2_phase0.bam test-data/samtools_phase_out_2_phase1.bam test-data/samtools_phase_out_3_phase0.bam test-data/samtools_phase_out_3_phase1.bam |
| diffstat | 11 files changed, 71 insertions(+), 48 deletions(-) [+] |
line wrap: on
line diff
--- a/macros.xml Tue Sep 28 16:15:54 2021 +0000 +++ b/macros.xml Wed Nov 12 13:04:22 2025 +0000 @@ -5,8 +5,15 @@ <yield/> </requirements> </xml> - <token name="@TOOL_VERSION@">1.13</token> - <token name="@PROFILE@">20.05</token> + <!-- NOTE: for some tools only the version of the requirement but not the + tool's version is controlled by the TOOL_VERSION token + (because their version is ahead of the requirement version .. + please only bump the minor version in order to let the requirement + version catch up eventually). To find the tools check: + `grep "<tool" . -r | grep -v VERSION_SUFFIX | cut -d":" -f 1` --> + <token name="@TOOL_VERSION@">1.22</token> + <token name="@VERSION_SUFFIX@">1</token> + <token name="@PROFILE@">24.0</token> <token name="@FLAGS@"><![CDATA[ #set $flags = 0 #if $filter @@ -50,27 +57,60 @@ #end for ]]></token> <token name="@PREPARE_FASTA_IDX@"><![CDATA[ - ##checks for reference data ($addref_cond.addref_select=="history" or =="cached") - ##and sets the -t/-T parameters accordingly: - ##- in case of history a symbolic link is used because samtools (view) will generate - ## the index which might not be possible in the directory containing the fasta file - ##- in case of cached the absolute path is used which allows to read the cram file - ## without specifying the reference + ## Make the user-selected reference genome, if any, accessible through + ## a shell variable $reffa, index the reference if necessary, and make + ## the fai-index file available through a shell variable $reffai. + + ## For a cached genome simply sets the shell variables to point to the + ## genome file and its precalculated index. + ## For a genome from the user's history, if that genome is a plain + ## fasta file, the code creates a symlink in the pwd, creates the fai + ## index file next to it, then sets the shell variables to point to the + ## symlink and its index. + ## For a fasta.gz dataset from the user's history, it tries the same, + ## but this will only succeed if the file got compressed with bgzip. + ## For a regular gzipped file samtools faidx will fail, in which case + ## the code falls back to decompressing to plain fasta before + ## reattempting the indexing. + ## Indexing of a bgzipped file produces a regular fai index file *and* + ## a compressed gzi file. The former is identical to the fai index of + ## the uncompressed fasta. + + ## If the user has not selected a reference (it's an optional parameter + ## in some samtools wrappers), a cheetah boolean use_ref is set to + ## False to encode that fact. + + #set use_ref=True #if $addref_cond.addref_select == "history": - ln -s '${addref_cond.ref}' reference.fa && - samtools faidx reference.fa && - #set reffa="reference.fa" - #set reffai="reference.fa.fai" + #if $addref_cond.ref.is_of_type('fasta'): + reffa="reference.fa" && + ln -s '${addref_cond.ref}' \$reffa && + samtools faidx \$reffa && + #else: + reffa="reference.fa.gz" && + ln -s '${addref_cond.ref}' \$reffa && + { + samtools faidx \$reffa || + { + echo "Failed to index compressed reference. Trying decompressed ..." 1>&2 && + gzip -dc \$reffa > reference.fa && + reffa="reference.fa" && + samtools faidx \$reffa; + } + } && + #end if + reffai=\$reffa.fai && #elif $addref_cond.addref_select == "cached": - #set reffa=str($addref_cond.ref.fields.path) - #set reffai=str($addref_cond.ref.fields.path)+".fai" + ## in case of cached the absolute path is used which allows to read + ## a cram file without specifying the reference + reffa='${addref_cond.ref.fields.path}' && + reffai=\$reffa.fai && #else - #set reffa=None - #set reffai=None + #set use_ref=False #end if ]]></token> - <xml name="optional_reference"> + <xml name="optional_reference" token_help="" token_argument=""> <conditional name="addref_cond"> <param name="addref_select" type="select" label="Use a reference sequence"> <help>@HELP@</help> @@ -127,6 +167,18 @@ <xml name="seed_input"> <param name="seed" type="integer" optional="True" label="Seed for random number generator" help="If empty a random seed is used." /> </xml> + + <!-- Include/exclude by flags + flag options --> + <xml name="inclusive_filter_macro" token_argument=""> + <param name="inclusive_filter" argument="@ARGUMENT@" type="select" multiple="True" label="Require that these flags are set"> + <expand macro="flag_options" /> + </param> + </xml> + <xml name="exclusive_filter_macro" token_argument=""> + <param name="exclusive_filter" argument="@ARGUMENT@" type="select" multiple="True" label="Exclude reads with any of the following flags set"> + <expand macro="flag_options" /> + </param> + </xml> <xml name="flag_options" token_s1="false" token_s2="false" token_s4="false" token_s8="false" token_s16="false" token_s32="false" token_s64="false" token_s128="false" token_s256="false" token_s512="false" token_s1024="false" token_s2048="false"> <option value="1" selected="@S1@">Read is paired</option> <option value="2" selected="@S2@">Read is mapped in a proper pair</option> @@ -179,37 +231,8 @@ <xml name="citations"> <citations> - <citation type="bibtex"> - @misc{SAM_def, - title={Definition of SAM/BAM format}, - url = {https://samtools.github.io/hts-specs/},} - </citation> - <citation type="doi">10.1093/bioinformatics/btp352</citation> + <citation type="doi">10.1093/gigascience/giab008</citation> <citation type="doi">10.1093/bioinformatics/btr076</citation> - <citation type="doi">10.1093/bioinformatics/btr509</citation> - <citation type="bibtex"> - @misc{Danecek_et_al, - Author={Danecek, P., Schiffels, S., Durbin, R.}, - title={Multiallelic calling model in bcftools (-m)}, - url = {http://samtools.github.io/bcftools/call-m.pdf},} - </citation> - <citation type="bibtex"> - @misc{Durbin_VCQC, - Author={Durbin, R.}, - title={Segregation based metric for variant call QC}, - url = {http://samtools.github.io/bcftools/rd-SegBias.pdf},} - </citation> - <citation type="bibtex"> - @misc{Li_SamMath, - Author={Li, H.}, - title={Mathematical Notes on SAMtools Algorithms}, - url = {http://www.broadinstitute.org/gatk/media/docs/Samtools.pdf},} - </citation> - <citation type="bibtex"> - @misc{SamTools_github, - title={SAMTools GitHub page}, - url = {https://github.com/samtools/samtools},} - </citation> </citations> </xml> <xml name="version_command">
--- a/samtools_phase.xml Tue Sep 28 16:15:54 2021 +0000 +++ b/samtools_phase.xml Wed Nov 12 13:04:22 2025 +0000 @@ -1,4 +1,4 @@ -<tool id="samtools_phase" name="Samtools phase" version="2.0.2" profile="@PROFILE@"> +<tool id="samtools_phase" name="Samtools phase" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="@PROFILE@"> <description>call and phase heterozygous SNPs</description> <macros> <import>macros.xml</import>
