Repository revision
0:572587cbb1dd

Repository 'mash'
hg clone https://toolshed.g2.bx.psu.edu/repos/brinkmanlab/mash

MASH tool metadata
Miscellaneous
MASH
Fast genome and metagenome distance estimation using MinHash
mash
toolshed.g2.bx.psu.edu/repos/brinkmanlab/mash/mash/2.1
2.1
mash --version
True
Version lineage of this tool (guids ordered most recent to oldest)
toolshed.g2.bx.psu.edu/repos/brinkmanlab/mash/mash/2.1 (this tool)
mash
Requirements (dependencies defined in the <requirements> tag set)
name version type
mash 2.1 package
Additional information about this tool
#import os
        ## =====  Declare reusable parameter output for different modes ===
        #def sketching
            -k $commands.kmer_size -s $commands.sketch_size
            #if $commands.input_option.individual_seq
                -i ##Hack around current conditional truevalue/falsevalue behavior
            #end if
            -S $commands.hash_seed -w $commands.kmer_size_thresh
            #unless $commands.input_option.individual_seq
                $commands.input_option.input_read_set
                #if $commands.input_option.bloom_size
                    -b $commands.input_option.bloom_size
                #end if
                -m $commands.input_option.kmer_count
                -c $commands.input_option.target_coverage
                #if $commands.input_option.genome_size
                    -g $commands.input_option.genome_size
                #end if
            #end unless
            $commands.preserve_strand $commands.use_aaa
            #if $commands.alphabet
                -z "$commands.alphabet"
            #end if
            $commands.preserve_case
        #end def

        ## ===== Change to extension MASH expects =====
        #if $commands.command in ["dist", "screen"] and $commands.reference.is_of_type("msh")
            ln -sf $commands.reference ${os.path.basename(str($commands.reference))}.msh &&
        #end if
        #if $commands.command in ["dist", "sketch", "triangle"]
            #for $input in $commands.inputs
                #if $input.is_of_type("msh")
                    ln -sf $input ${os.path.basename(str($input))}.msh &&
                #end if
            #end for
        #end if
        #if $commands.command in ["sketch"]
            ln -sf $output output.msh &&
        #end if

        ## ===== Execute MASH =====
        mash $commands.command

        ## ===== Enable threading =====
        #if False and $commands.command in ["dist", "screen", "sketch", "triangle"]
            -p \${GALAXY_SLOTS:-1} ## -p seems broken at the time of writing
        #end if

        ## ===== Select correct output parameters for selected mode =====
        #if $commands.command == "bounds"
            >> $output
        #else if $commands.command == "dist"
            $commands.table_output -v $commands.max_p -d $commands.max_dist
            #set $sketch=True
            #for $input in $commands.inputs
                #if $input.is_of_type("msh")
                    #set $sketch=False
                    #break
                #end if
            #end for
            #if $sketch
                $sketching()
            #end if
            #if $commands.reference.is_of_type("msh")
                ${os.path.basename(str($commands.reference))}.msh
            #else
                $commands.reference
            #end if
            #for $input in $commands.inputs
                #if $input.is_of_type("msh")
                    ${os.path.basename(str($input))}.msh
                #else
                    $input
                #end if
            #end for
            >> $output
        #else if $commands.command == "info"
            $commands.info_mode $commands.sketch >> $output
        #else if $commands.command == "paste"
            "$commands.out_prefix"
            #for $sketch in $commands.sketches
                $sketch
            #end for
            >> $output
        #else if $commands.command == "screen"
            $commands.winner_takes_all -i $commands.min_ident -v $commands.max_p
            #if $commands.reference.is_of_type("msh")
                ${os.path.basename(str($commands.reference))}.msh
            #else
                $commands.reference
            #end if
            #for $pool in $commands.pools
                $pool
            #end for
            >> $output
        #else if $commands.command == "sketch"
            -o output
            $sketching()
            #for $input in $commands.inputs
                $input
            #end for
        #else if $commands.command == "triangle"
            $commands.comment_fields
            $sketching()
            #for $input in $commands.inputs
                #if $input.is_of_type("msh")
                    ${os.path.basename(str($input))}.msh
                #else
                    $input
                #end if
            #end for
            >> $output
        #end if
    
None
False
Functional tests
name inputs outputs required files
Test-1 commands|command: bounds
attributes: name
name
Test-2 commands|reference: test-data/15600_genome.fasta
commands|input_option|individual_seq: True
commands|command: dist
attributes: name
test-data/15600_genome.fasta
name