Repository revision
7:33486216eec0

Repository 'stacks2_denovomap'
hg clone https://toolshed.g2.bx.psu.edu/repos/iuc/stacks2_denovomap

Stacks2: de novo map tool metadata
Miscellaneous
the Stacks pipeline without a reference genome (denovo_map.pl)
stacks2_denovomap
toolshed.g2.bx.psu.edu/repos/iuc/stacks2_denovomap/stacks2_denovomap/2.55+galaxy4
2.55+galaxy4
process_radtags -h |& grep process_radtags | head -n 1 | cut -d" " -f 2
True
Version lineage of this tool (guids ordered most recent to oldest)
toolshed.g2.bx.psu.edu/repos/iuc/stacks2_denovomap/stacks2_denovomap/2.55+galaxy4 (this tool)
toolshed.g2.bx.psu.edu/repos/iuc/stacks2_denovomap/stacks2_denovomap/2.55+galaxy3
toolshed.g2.bx.psu.edu/repos/iuc/stacks2_denovomap/stacks2_denovomap/2.55+galaxy2
toolshed.g2.bx.psu.edu/repos/iuc/stacks2_denovomap/stacks2_denovomap/2.55+galaxy1
toolshed.g2.bx.psu.edu/repos/iuc/stacks2_denovomap/stacks2_denovomap/2.55+galaxy0
toolshed.g2.bx.psu.edu/repos/iuc/stacks2_denovomap/stacks2_denovomap/2.53+galaxy0
toolshed.g2.bx.psu.edu/repos/iuc/stacks2_denovomap/stacks2_denovomap/2.4+galaxy1
toolshed.g2.bx.psu.edu/repos/iuc/stacks2_denovomap/stacks2_denovomap/2.4+galaxy0
stacks2_denovomap
Requirements (dependencies defined in the <requirements> tag set)
name version type
stacks 2.55 package
python 3.7 package
findutils 4.6.0 package
Additional information about this tool
#from os.path import splitext
    #import re

    #def clean_ext($identifier)
        #while $identifier.endswith(('.1', '.2', '.fa', '.fq', '.fasta', '.fastq', '.gz', '.gzip', '.sam', '.bam'))
            #set $identifier = splitext($identifier)[0]
        #end while
$identifier#slurp
    #end def

    #def fastq_input_foo( $sample, $read_direction="", $infix="" )
        #set $name = $clean_ext($sample.element_identifier)
        #if $sample.is_collection:
            #set $cur_sample=$sample[$read_direction]
        #else:
            #set $cur_sample=$sample
        #end if

        #if $cur_sample.is_of_type('fastqsanger')
            #set $ext =  "fastq"
            #set $inputype = "fastq"
        #else if $cur_sample.is_of_type('fastqsanger.gz')
            #set $ext = "fastq.gz"
            #set $inputype = "gzfastq"
        #else if $cur_sample.is_of_type('fasta')
            #set $ext = "fasta"
            #set $inputype = "fasta"
        #else if $cur_sample.is_of_type('fasta.gz')
            #set $ext = "fasta.gz"
            #set $inputype = "gzfasta"
        #else
            #set $inputype = "UNKNOWN"
        #end if
        #set $data_path = "stacks_inputs/"+$name+$infix+"."+$ext
        #set $link_cmd = "ln -s '%s' '%s' &&" % ($cur_sample, $data_path)
        #return ($link_cmd, $data_path, $name, $inputype)
    #end def

    ## fastq_input_batch determine link command, access path(s), and input type
    ## for batch tools
    ##
    ## inputs
    ## - sample data set / pair
    ## - type "single" / "paired"
    ## return (link_command, fwd_path, rev_path, inputype)
    ## - link_command bash command(s) to link the data sets
    ## - fwd_path file name of the link to the forward data set
    ## - rev_path file name of the link to the forward data set (if type=paired)
    ## - inputype input type as used in stacks ([gz]fast(a|q))
    #def fastq_input_batch($sample, $type)
        #if $type == "single"
            #set ($link_cmd, $path, $name, $inputype) = $fastq_input_foo($sample, "", "")
            #return ($link_cmd, $path, "", $inputype)
        #else:
            #set ($fwd_link_cmd, $fwd_path, $name, $inputype) = $fastq_input_foo($sample, "forward", ".1")
            #set ($rev_link_cmd, $rev_path, $name, $inputype) = $fastq_input_foo($sample, "reverse", ".2")
            #return ( $fwd_link_cmd+$rev_link_cmd, $fwd_path, $rev_path, $inputype)
        #end if
    #end def

    ## fastq_input_nonbatch determine link command, access path(s), and input type
    ## for non-batch tools (procrad, shortreads, denovomap the former need R[12]_
    ## and the latter needs .[12])
    ##
    ## inputs
    ## - samples list of data set / pair
    ## - type "single" / "paired"
    ## - infix_pattern pattern for the infix of the files (needs to contain %d which is replaced by 1/2)
    ## return (link_command, inputype)
    ## - link_command bash command(s) to link the data sets
    ## - inputype input type as used in stacks ([gz]fast(a|q))
    #def fastq_input_nonbatch( $samples, $type, $infix_pattern )
        #set $link_command = ""
        #for $sample in $samples
            #if $type == "single"
                #set ($lc, $path, $name, $inputype) = $fastq_input_foo($sample, "", "")
                #set link_command += lc
            #else:
                #set ($lc, $path, $name, $inputype) = $fastq_input_foo($sample, "forward", $infix_pattern % (1))
                #set link_command += lc
                #set ($lc, $path, $name, $inputype) = $fastq_input_foo($sample, "reverse", $infix_pattern % (2))
                #set link_command += lc
            #end if
        #end for
        #return ($link_command, $inputype)
    #end def
    
mkdir stacks_inputs stacks_outputs &&

#if $output_log
    ln -s '$output_log' stacks_outputs/denovo_map.log &&
#end if

#set ($link_command, $inputype) = $fastq_input_nonbatch( $input_type.fqinputs, $input_type.input_type_select, ".%d" )
$link_command

denovo_map.pl
--samples stacks_inputs
#if str($popmap) != 'None':
    --popmap '$popmap'
#end if
-o stacks_outputs
-T \${GALAXY_SLOTS:-1}

-M $assembly_options.M
-n $assembly_options.n
--var-alpha $model_options.var_alpha
--gt-alpha $model_options.gt_alpha
#if $input_type.input_type_select == "paired"
    --paired
#end if
$pe_options.rm_pcr_duplicates
--min-samples-per-pop $popfilter_options.min_samples_per_pop
--min-populations $popfilter_options.min_populations

## the catalog.calls output is a gzip-ed vcf extract it
## to make it usable in Galaxy (with the downside that we
## need to gzip it again for downstream calls like populations)
&& gunzip -c stacks_outputs/catalog.calls > stacks_outputs/catalog.calls.vcf
    
None
False
Functional tests
name inputs outputs required files
Test-1 input_type|fqinputs: list:paired collection
input_type|input_type_select: paired
popmap: denovo_map/popmap_cstacks.tsv
name: value
name: value
name: value
name: value
name: value
name: value
demultiplexed/PopA_01.1.fq
demultiplexed/PopA_01.2.fq
demultiplexed/PopA_02.1.fq
demultiplexed/PopA_02.2.fq
denovo_map/popmap_cstacks.tsv
value
Test-2 input_type|fqinputs: ['demultiplexed/PopA_01.1.fq', 'demultiplexed/PopA_02.1.fq']
input_type|input_type_select: single
popmap: denovo_map/popmap_cstacks.tsv
name: value
name: value
name: value
name: value
name: value
name: value
demultiplexed/PopA_01.1.fq
demultiplexed/PopA_02.1.fq
denovo_map/popmap_cstacks.tsv
value
Test-3 input_type|fqinputs: list collection
input_type|input_type_select: paired
popmap: denovo_map/popmap_cstacks.tsv
assembly_options|M: 3
assembly_options|n: 3
model_options|var_alpha: 0.1
model_options|gt_alpha: 0.1
pe_options|rm_pcr_duplicates: True
popfilter_options|min_samples_per_pop: 1
popfilter_options|min_populations: 0
name: value
name: value
name: value
name: value
name: value
name: value
demultiplexed/PopA_01.1.fq
demultiplexed/PopA_02.1.fq
denovo_map/popmap_cstacks.tsv
value