view 2_call_sites.xml @ 33:b6bc9158666c

planemo upload commit 7f6183b769772449fbcee903686b8d5ec5b7439f-dirty
author jpayne
date Thu, 01 Feb 2018 17:46:04 -0500
parents 25b858c2f21d
children 87f53c4a13df
line wrap: on
line source
<tool id="call_sites" name="2. Call Sites" version="1.0.1" profile="16.10">
    <description>of high-confidence SNPs, or lookup cached sitecall</description>
    <requirements>
        <requirement type="package" version="2.3.4">bowtie2</requirement>
        <requirement type="package" version="1.6">samtools</requirement>
        <requirement type="package" version="1.0.6">bzip2</requirement>
        <requirement type="package">picard</requirement>
        <requirement type="package">varscan</requirement>
        <requirement type="package" version="1.5.11">boto3</requirement>
        <requirement type="package" version="3.4">python3</requirement>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[
    python $__tool_directory__/snp-cache.py snp_sitecalls 
        "\$(md5sum $input $sample | cut -c -32 | md5sum | cut -c -32)"
        -c "
            cp $input ./reference.fasta                    &&
            samtools faidx ./reference.fasta               &&  
            samtools view -bS -F 4 $sample |
            samtools sort -o ./sorted.bam -                &&
            picard MarkDuplicates INPUT=./sorted.bam
                                  OUTPUT=/dev/stdout 
                                  METRICS_FILE=./metrics |
            samtools mpileup -f ./reference.fasta - -o ./pileup
            &&
            varscan mpileup2snp ./pileup
                                --min_var-freq 0.90 
                                --output-vcf 1
            > ./calls
            && tar -zcf /dev/stdout ./metrics ./pileup ./calls
        "
        -o ./archive.tar.gz
        -l $cache_log
        && cat $cache_log
        && tar -zxvf ./archive.tar.gz
        && cp ./metrics $metrics
        && cp ./pileup $pileup
        && cp ./calls $calls
    ]]></command>
    <inputs>
        <param name="input" label="FASTA Reference from your history" type="data" format="fasta" />
        <!-- <conditional name="reads">
            <param name="reads_select" type="select" label="Paired-end collection, or two datasets from your history">
                <option value="collection">Paired collection from your history</option>
                <option value="history">Two FASTQ datasets from your history</option>
            </param>
            <when value="collection">
                <param name="coll" type="data_collection" format="fastq,fastqsanger" collection_type="paired">
            </when>
            <when value="history">
                <param type="data" name="forward" format="fastq,fastqsanger" />
                <param type="data" name="reverse" format="fastq,fastqsanger" />
            </when>
        </conditional> -->
        <param name="sample" label="Read alignment to reference" type="data" format="sam" />
    </inputs>
    <outputs>
        <data name="calls" label="${sample.name.split(' ')[0]} unfiltered SNPs" format="vcf" />
        <data name="pileup" label="${sample.name.split(' ')[0]} pileup" format="pileup" hidden="true" />
        <data name="metrics" label="Metrics from Picard" format="txt" hidden="true" />
        <data label="S3 Cache log" name="cache_log" format="txt" hidden="true" />
    </outputs>
    <tests>
        <test>
            <param name="input" value="reference/lambda_virus.fasta" />
            <param name="sample" value="samples/sample2/reads.sam" />
            <output name="calls" value="samples/sample2/var.flt.vcf" />
            <output name="pileup" value="samples/sample2/reads.all.pileup" />
        </test>
    </tests>
    <help><![CDATA[
        <a href="http://snp-pipeline.readthedocs.io/en/latest/index.html">http://snp-pipeline.readthedocs.io/en/latest/index.html</a>
    ]]></help>
    <citations>
        <citation type="doi">10.7717/peerj-cs.20</citation>
    </citations>
</tool>