Repository revision
7:c89806670ab9

Repository 'samtools_calmd'
hg clone https://toolshed.g2.bx.psu.edu/repos/devteam/samtools_calmd

Samtools calmd tool metadata
Miscellaneous
recalculate MD/NM tags
samtools_calmd
toolshed.g2.bx.psu.edu/repos/devteam/samtools_calmd/samtools_calmd/2.0.4
2.0.4
samtools 2>&1 | grep Version
True
Version lineage of this tool (guids ordered most recent to oldest)
toolshed.g2.bx.psu.edu/repos/devteam/samtools_calmd/samtools_calmd/2.0.4 (this tool)
toolshed.g2.bx.psu.edu/repos/devteam/samtools_calmd/samtools_calmd/2.0.3
toolshed.g2.bx.psu.edu/repos/devteam/samtools_calmd/samtools_calmd/2.0.2
toolshed.g2.bx.psu.edu/repos/devteam/samtools_calmd/samtools_calmd/2.0.1
toolshed.g2.bx.psu.edu/repos/devteam/samtools_calmd/samtools_calmd/2.0
samtools_calmd
Requirements (dependencies defined in the <requirements> tag set)
name version type
samtools 1.15.1 package
Additional information about this tool
##compute the number of ADDITIONAL threads to be used by samtools (-@)
        addthreads=\${GALAXY_SLOTS:-1} && (( addthreads-- )) &&
    

        ## 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":
            #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":
            ## 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 use_ref=False
        #end if
    

samtools calmd
    $baq_settings.use_baq $baq_settings.modify_quality $baq_settings.extended_baq
    #if str($option_set.option_sets) == 'advanced':
        $option_set.change_identical -C $option_set.adjust_mq
    #end if
    -b
    -@ \$addthreads
    '$input'
    "\$reffa"
    > '$calmd_output'
    
None
False
Functional tests
name inputs outputs required files
Test-1 input: phiX.bam
addref_cond|ref: phiX.fasta
addref_cond|addref_select: history
baq_settings|use_baq:
option_set|option_sets: default
name: value
phiX.bam
phiX.fasta
value
Test-2 input: phiX.bam
addref_cond|ref: phiX.fasta
addref_cond|addref_select: history
baq_settings|extended_baq: True
baq_settings|use_baq: -r
option_set|change_identical: True
option_set|adjust_mq: 50
option_set|option_sets: advanced
name: value
phiX.bam
phiX.fasta
value