view vsnp_statistics.xml @ 15:e5d08707e81f draft

"planemo upload for repository https://github.com/gregvonkuster/galaxy_tools/tree/master/tools/sequence_analysis/vsnp/vsnp_statistics commit 920fec3ef21170f77d5bd16f1b77bbe9d187f6d3"
author greg
date Mon, 02 Aug 2021 21:26:57 +0000
parents ce1f889b3340
children 44b07199be73
line wrap: on
line source

<tool id="vsnp_statistics" name="vSNP: statistics" version="@WRAPPER_VERSION@.1+galaxy0" profile="@PROFILE@">
    <description></description>
    <macros>
        <import>macros.xml</import>
    </macros>
    <requirements>
        <expand macro="biopython_requirement"/>
        <expand macro="numpy_requirement"/>
        <expand macro="openpyxl_requirement"/>
        <expand macro="pandas_requirement"/>
        <expand macro="xlrd_requirement"/>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[
#import re

#if $input_type_cond.input_type in ["single", "pair"]:
    #set read1 = $input_type_cond.read1
    #set read1_identifier = re.sub('[^\s\w\-]', '_', str($read1.element_identifier))
    ln -s '${read1}' '${read1_identifier}' &&
    #if $input_type_cond.input_type == "pair":
        #set read2 = $input_type_cond.read2
        #set read2_identifier = re.sub('[^\s\w\-]', '_', str($read2.element_identifier))
        ln -s '${read2}' '${read2_identifier}' &&
    #else:
        #set read2 = None 
    #end if
#else:
    #set read1 = $input_type_cond.reads_collection['forward']
    #set read1_identifier = re.sub('[^\s\w\-]', '_', str($read1.element_identifier))
    ln -s '${read1}' '${read1_identifier}' &&
    #set read2 = $input_type_cond.reads_collection['reverse']
    #set read2_identifier = re.sub('[^\s\w\-]', '_', str($read2.element_identifier))
    ln -s '${read2}' '${read2_identifier}' &&
#end if

python '$__tool_directory__/vsnp_statistics.py'
--read1 '${read1_identifier}'
#if $read2 is not None
  --read2 '${read2_identifier}'
#end if
#if $read1.is_of_type('fastqsanger.gz'):
    --gzipped
#end if
--dbkey '$samtools_idxstats.metadata.dbkey'
--samtools_idxstats '$samtools_idxstats'
--vsnp_azc_metrics '$vsnp_azc_metrics'
--output '$output'
]]></command>
    <inputs>
        <conditional name="input_type_cond">
            <param name="input_type" type="select" label="Choose the category of the files to be analyzed">
                <option value="single" selected="true">Single files</option>
                <option value="paired">Paired reads</option>
                <option value="pair">Paired reads in separate data sets</option>
            </param>
            <when value="single">
                <param name="read1" type="data" format="fastqsanger.gz,fastqsanger" label="Read1 fastq file"/>
            </when>
            <when value="paired">
                <param name="reads_collection" type="data_collection" format="fastqsanger,fastqsanger.gz" collection_type="paired" label="Collection of fastqsanger paired read files"/>
            </when>
            <when value="pair">
                <param name="read1" type="data" format="fastqsanger.gz,fastqsanger" label="Read1 fastq file"/>
                <param name="read2" type="data" format="fastqsanger.gz,fastqsanger" label="Read2 fastq file"/>
            </when>
        </conditional>
        <param name="samtools_idxstats" type="data" format="tabular" label="Samtools idxstats file"/>
        <param name="vsnp_azc_metrics" type="data" format="tabular" label="vSNP: add zero coverage metrics file"/>
    </inputs>
    <outputs>
        <data name="output" format="tabular"/>
    </outputs>
    <tests>
        <!-- A single fastq file -->
        <test expect_num_outputs="1">
            <param name="input_type" value="single"/>
            <param name="read1" value="Mcap_Deer_DE_SRR650221.fastq.gz" ftype="fastqsanger.gz" dbkey="89"/>
            <param name="samtools_idxstats" value="samtools_idxstats1.tabular" ftype="tabular" dbkey="89"/>
            <param name="vsnp_azc_metrics" value="add_zc_metrics1.tabular" ftype="tabular" dbkey="89"/>
            <output name="output" file="vsnp_statistics1.tabular" ftype="tabular"/>
        </test>
        <!-- A set of paired fastq files -->
        <test expect_num_outputs="1">
            <param name="input_type" value="pair"/>
            <param name="read1" value="13-1941-6_S4_L001_R1_600000.fastq.gz" ftype="fastqsanger.gz" dbkey="89"/>
            <param name="read2" value="13-1941-6_S4_L001_R2_600000.fastq.gz" ftype="fastqsanger.gz" dbkey="89"/>
            <param name="samtools_idxstats" value="samtools_idxstats2.tabular" ftype="tabular" dbkey="89"/>
            <param name="vsnp_azc_metrics" value="add_zc_metrics2.tabular" ftype="tabular" dbkey="89"/>
            <output name="output" file="vsnp_statistics2.tabular" ftype="tabular"/>
        </test>
        <!-- A collection of paired fastq files -->
        <test expect_num_outputs="1">
            <param name="input_type" value="paired"/>
            <param name="reads_collection">
                <collection type="paired">
                    <element name="forward" value="13-1941-6_S4_L001_R1_600000.fastq.gz" ftype="fastqsanger.gz"/>
                    <element name="reverse" value="13-1941-6_S4_L001_R2_600000.fastq.gz" ftype="fastqsanger.gz"/>
                </collection>
            </param>
            <param name="samtools_idxstats" value="samtools_idxstats5.tabular" ftype="tabular" dbkey="89"/>
            <param name="vsnp_azc_metrics" value="add_zc_metrics5.tabular" ftype="tabular" dbkey="89"/>
            <output name="output" file="vsnp_statistics4.tabular" ftype="tabular"/>
        </test>
    </tests>
    <help>
**What it does**

Accepts associated fastq files, SAMtools idxstats files and **vSNP: add zero coverage** metrics files and extracts information from them
to produce an Excel spreadsheet containing statistics for each sample.  The samples can be a single read, a single set of paired reads in
separate datasets or  collection of paired reads.  The output statistics include reference, file size, mean read length, mean read quality,
reads passing Q30, total reads, all mapped reads, unmapped reads, unmapped reads percentage of total, reference with coverage, average depth
of coverage and good SNP count.
    </help>
    <expand macro="citations"/>
</tool>