view ParSNP.xml @ 2:22bf5b566ce2 draft

"planemo upload for repository https://github.com/brinkmanlab/galaxy-tools/tree/master/parsnp commit a1f5a7f37fe4e85f7aca1a1476ab30468e1d1578"
author brinkmanlab
date Fri, 13 Mar 2020 14:39:56 -0400
parents 2e855db9b19b
children 2aeddc0a7b0e
line wrap: on
line source

<tool id="parsnp" name="ParSNP" version="1.2" profile="16.04">
    <description>Efficient microbial core genome alignment and SNP detection</description>
    <edam_topics>
        <edam_topic>topic_3293</edam_topic>
        <edam_topic>topic_0194</edam_topic>
        <edam_topic>topic_0091</edam_topic>
    </edam_topics>
    <edam_operations>
        <edam_operation>operation_2451</edam_operation>
        <edam_operation>operation_0323</edam_operation>
    </edam_operations>
    <requirements>
        <requirement type="package" version="1.2">parsnp</requirement>
    </requirements>
    <version_command><![CDATA[parsnp -V |& tail -n1]]></version_command>
    <command detect_errors="aggressive"><![CDATA[
    export MEMORY_LIMIT=`expr \${GALAXY_MEMORY_MB:-0} \\* 1000`;
    [[ \$MEMORY_LIMIT -eq 0 ]] && export MEMORY_LIMIT=;
    export GENOME_DIR=\$(mktemp -d -p `pwd`)
    #for $genome in $genomes
        && ln -sf '$genome'
        #if $adv.use_ids
            \$GENOME_DIR/'$genome.element_identifier'
        #else
            \$GENOME_DIR/\$(basename '$genome')
        #end if
    #end for
    && parsnp -v -o `pwd` -p \${GALAXY_SLOTS:-1} -P \${MEMORY_LIMIT:-15000000} -d "\$GENOME_DIR"
    #if $ref_or_gbk.ref_type == "fasta"
        #if $ref_or_gbk.ref_genome.random_ref
            -r '!'
        #else
            -r '$ref_or_gbk.ref_genome.reference'
        #end if
    #else
        -g '
        #for $gbk_file in $ref_or_gbk.genbank_files
            #if $gbk_file
                $gbk_file,
            #end if
        #end for
        '
    #end if
    $adv.MUMi_or_curated.curated $adv.extend_lcb $adv.output_unaligned
    #if $adv.query_genome
        -q '$adv.query_genome'
    #end if
    #unless $adv.MUMi_or_curated.curated
        $adv.MUMi_or_curated.MUMi.MUMi_only
        #unless $adv.MUMi_or_curated.MUMi.max_mumi_distribution.max_distribution_default
            -U '$adv.MUMi_or_curated.MUMi.max_mumi_distribution.max_distribution'
        #end unless
        #unless $adv.MUMi_or_curated.MUMi.max_mumi_distance.max_distance_default
            -i '$adv.MUMi_or_curated.MUMi.max_mumi_distance.max_distance'
        #end unless
    #end unless
    #unless $adv.min_anchor_len.anchor_default
        -a '$adv.min_anchor_len.anchor'
    #end unless
    -C '$adv.d_value'
    -z '$adv.lcb_size'
    #if $adv.max_diag_diff.diag_diff_unit
        -D '$adv.max_diag_diff.diag_diff_bp$adv.max_diag_diff.diag_diff_unit'
    #else
        -D '$adv.max_diag_diff.diag_diff'
    #end if
    #unless $adv.aligner == "muscle"
        -n '$adv.aligner'
    #end unless

    ]]></command>
    <inputs>
        <!-- Inputs -->
        <param name="genomes" type="data" multiple="true" argument="-d" format="fasta" label="Genomes/Contigs/Scaffolds" />
        <conditional name="ref_or_gbk">
            <param name="ref_type" type="select" label="Reference type">
                <option value="fasta">Single fasta</option>
                <option value="gbk">Multiple genbank files</option>
            </param>
            <when value="fasta">
                <conditional name="ref_genome" label="Reference genome">
                    <param name="random_ref" type="boolean" checked="false" label="Use random genome from above" />
                    <when value="false">
                        <param name="reference" type="data" format="fasta" label="Reference"/>
                    </when>
                </conditional>
            </when>
            <when value="gbk">
                <param name="genbank_files" type="data" format="genbank" argument="-g" multiple="true" label="Reference genbank files" />
            </when>
        </conditional>
        
        <section name="adv" title="Advanced options" expanded="false">
            <param name="query_genome" type="data" format="fasta" optional="true" label="Specify additional (assembled) query genome to use" />
            <param name="use_ids" type="boolean" checked="true" label="Use dataset name or collection id's instead of file name in output" help="IDs must be valid POSIX file names" />
            
            <!-- Recombination filtration -->
            <param name="filter_snp" type="boolean" checked="false"  truevalue="-x" falsevalue="" label="Enable filtering of SNPs located in PhiPack identified regions of recombination" />

            <!-- MUM -->
            <conditional name="min_anchor_len">
                <param name="anchor_default" type="boolean" checked="true" label="Minimum ANCHOR length default" />
                <when value="false">
                    <param name="anchor" type="float" min="0" value="1.1" label="Minimum ANCHOR length"/>
                </when>
            </conditional>
            <param name="d_value" type="integer" min="0" value="100" argument="-C" label="Maximal cluster D value"/>
            <param name="lcb_size" type="integer" min="0" value="25" argument="-z" label="Min LCB size" />

            <!-- MUMi -->
            <conditional name="MUMi_or_curated">
                <param name="curated" type="boolean" checked="false" truevalue="-c" falsevalue="" label="Curated genome directory, use all genomes and ignore MUMi" />
                <when value="">
                    <conditional name="MUMi">
                        <param name="MUMi_only" type="boolean" checked="false" truevalue="-M" falsevalue="" argument="-M" label="Only calculate MUMi and exit" />
                        <when value="">
                            <conditional name="max_mumi_distribution" label="Max MUMi distance value for MUMi distribution">
                                <param name="max_distribution_default" type="boolean" checked="true" label="Default" />
                                <when value="false">
                                    <param name="max_distribution" type="float" value="1" />
                                </when>
                            </conditional>
                            <conditional name="max_mumi_distance" label="Max MUMi distance">
                                <param name="max_distance_default" type="boolean" checked="true" label="Autocutoff based on distribution of MUMi values" />
                                <when value="false">
                                    <param name="max_distance" type="float" value="1" />
                                </when>
                            </conditional>
                        </when>
                    </conditional>
                </when>
            </conditional>
            
            <!--LCB -->
            <conditional name="max_diag_diff" label="Maximal diagonal difference">
                <param name="diag_diff_unit" type="select" label="Unit">
                    <option value="" selected="true">%</option>
                    <option value="bp">Base pairs</option>
                </param>
                <when value="">
                    <param name="diag_diff" type="float" min="0" max="1" value="0.12" />
                </when>
                <when value="bp">
                    <param name="diag_diff_bp" type="integer" min="0" value="100" />
                </when>
            </conditional>
            <param name="extend_lcb" type="boolean" checked="false" truevalue="-e" falsevalue="" argument="-e" label="Greedily extend LCBs" />              
            <param name="aligner" type="select" argument="-n" label="Alignment program">
                <option value="muscle" selected="true">muscle</option>
                <option value="mafft">mafft</option>
                <option value="fsa">fsa</option>
                <option value="prank">prank</option>
            </param>
            <param name="output_unaligned" type="boolean" checked="false" truevalue="-u" falsevalue="" argument="-u" label="Output unaligned regions" />
        </section>
    </inputs>
    <outputs>
        <data name="tree" format="newick" from_work_dir="parsnp.tree" label="${tool.name} on ${on_string}: Newick formatted core genome SNP tree" />
        <data name="vcf" format="vcf" from_work_dir="parsnp.vcf" label="${tool.name} on ${on_string}: SNPs used to infer phylogeny" />
        <data name="ggr" format="ggr" from_work_dir="parsnp.ggr" label="${tool.name} on ${on_string}: Gingr formatted binary archive" />
        <data name="xfma" format="xfma" from_work_dir="parsnp.xmfa" label="${tool.name} on ${on_string}: XMFA formatted multiple alignment" />
        <data name="unaligned" format="txt" from_work_dir="parsnp.unaligned" label="${tool.name} on ${on_string}: Unaligned regions" >
            <filter>adv['output_unaligned']</filter>
        </data>
    </outputs>
    <tests>
        <test expect_num_outputs="4">
            <param name="genomes" >
                <collection type="list">
                    <element name="test1" value="test-data/15596_genome.fasta" ftype="fasta" />
                    <element name="test2" value="test-data/15602_genome.fasta" ftype="fasta" />
                    <element name="test3" value="test-data/15599_genome.fasta" ftype="fasta" />
                </collection>
            </param>
            <conditional name="ref_or_gbk">
                <param name="ref_type" value="fasta" />
                <conditional name="ref_genome">
                    <param name="random_ref" value="false" />
                    <param name="reference" value="test-data/15600_genome.fasta" ftype="fasta" />
                </conditional>
            </conditional>
            <section name="adv">
                <conditional name="MUMi_or_curated">
                    <param name="curated" value="-c" />
                </conditional>
            </section>
            <output name="tree" checksum="sha256:66a2cc47666452fae008b546ab2bd5f9a06c7c7daca88e34e2be7a5cdd371137" ftype="newick" />
            <output name="vcf" checksum="sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" ftype="vcf" />
            <output name="ggr" checksum="sha256:9e91807a25a9549070cfde5cc60844991db5cbee55d9181c61e75220b67f35c5" ftype="txt" />
            <output name="xfma" checksum="sha256:1774759cc4c34b53e117406a9055f933620960be852ab77501eab1d34badbbfa" ftype="txt" />
        </test>
    </tests>
    <help><![CDATA[
        https://harvest.readthedocs.io/en/latest/content/parsnp.html
    ]]></help>
    <citations>
        <citation type="doi">10.5281/zenodo.3364789</citation>
        <citation type="doi">10.1101/007351</citation>
    </citations>
</tool>