view lumpy.xml @ 1:a006d42dd759 draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/lumpy commit bd0a0b0717fd7da2ff703668b21ff7db3677d61b
author drosofff
date Tue, 06 Dec 2016 09:29:31 -0500
parents 8b3daa745d9b
children b1e152172de9
line wrap: on
line source

<tool id="lumpy" name="lumpy-sv" version="0.1">
    <description>find structural variants</description>
    <requirements>
        <requirement type="package" version="0.2.12">lumpy-sv</requirement>
        <requirement type="package" version="1.3.1">samtools</requirement>
        <requirement type="package" version="1.11.2">numpy</requirement>
    </requirements>
    <stdio>
        <exit_code range="1:" level="fatal" description="Tool exception" />
    </stdio>
    <version_command>lumpy --version</version_command>
    <command><![CDATA[
        ln -f -s "$input_file" input.bam &&
        #if $seq_method.seq_method_list == "paired-end":
            samtools view -b -F 1294 input.bam > "input.discordants.unsorted.bam" &&
            samtools view -h input.bam | python $__tool_directory__/extractSplitReads_BwaMem.py -i stdin | samtools view -Sb - > "input.splitters.unsorted.bam" &&
            samtools sort input.discordants.unsorted.bam > input.discordants.bam &&
            samtools sort input.splitters.unsorted.bam > input.splitters.bam &&
            samtools view -r readgroup input.bam
                |tail -n +$seq_method.additional_params.samplingValue
                |python $__tool_directory__/pairend_distro.py -r 101 -X 4 -N $seq_method.additional_params.samplingValue -o input.lib.histo > meandev.txt &&
            mean=\$(cat meandev.txt | sed s/mean:// | sed -r s/stdev:.+//) &&
            stdev=\$(cat meandev.txt | sed -r s/mean:.+stdev://) &&
            lumpy -mw 4 -tt 0 
                -pe id:input.bam,bam_file:input.discordants.bam,histo_file:input.lib.histo,mean:"\$mean",stdev:"\$stdev",read_length:$seq_method.readLength,min_non_overlap:$seq_method.additional_params.min_non_overlap,discordant_z:$seq_method.additional_params.discordant_z,back_distance:$seq_method.additional_params.back_distance,weight:$seq_method.additional_params.weight,min_mapping_threshold:$seq_method.additional_params.min_mapping_threshold 
                -sr id:input.bam,bam_file:input.splitters.bam,back_distance:$seq_method.additional_params.back_distance,weight:$seq_method.additional_params.weight,min_mapping_threshold:$seq_method.additional_params.min_mapping_threshold > output.vcf &&
            mv input.discordants.bam $discordants &&
            mv input.splitters.bam $splits &&
            mv input.lib.histo $histogram &&
            mv output.vcf $vcf_call &&
            rm input.discordants.unsorted.bam input.splitters.unsorted.bam meandev.txt
        #end if
        #if $seq_method.seq_method_list == "single-read":
            samtools view -h input.bam | python $__tool_directory__/extractSplitReads_BwaMem.py -i stdin | samtools view -Sb - > "input.splitters.unsorted.bam" &&
            lumpy -mw 4 -tt 0
                -sr id:input.bam,bam_file:input.splitters.unsorted.bam,back_distance:$seq_method.additional_params.back_distance,weight:$seq_method.additional_params.weight,min_mapping_threshold:$seq_method.additional_params.min_mapping_threshold > output.vcf &&
            mv input.splitters.unsorted.bam $splits &&
            mv output.vcf $vcf_call
        #end if

    ]]></command>
    <!-- basic error handling -->
    <inputs>
        <param format="bam" name="input_file" type="data" label="One BAM alignment file produced by BWA-mem"/>
        <conditional name="seq_method">
            <param help="Paired-end or single-read sequencing" label="Sequencing method" name="seq_method_list" type="select">
                <option selected="True" value="paired-end">Paired-end sequencing</option>
                <option value="single-read">Single-read sequencing</option>
            </param>
            <when value="paired-end">
                <param name="readLength" value="151"  type="integer" label="read length" help="e.g. 151 nt" />
                <section name="additional_params" title="Additional Options" expanded="False">
                    <param name="samplingValue" value="100000"  type="integer" label="number of reads to compute mean and stdev of read length" help="e.g. 10000" />
                    <param name="min_non_overlap" value="101"  type="integer" label="min_non_overlap" help="e.g. 101" />
                    <param name="discordant_z" value="5"  type="integer" label="discordant_z" help="e.g. 5" />
                    <param name="back_distance" value="10"  type="integer" label="back_distance" help="e.g. 10" />
                    <param name="weight" value="1"  type="integer" label="weight" help="e.g. 1" />
                    <param name="min_mapping_threshold" value="20"  type="integer" label="min_mapping_threshold" help="e.g. 20" />
                </section>
            </when>
            <when value="single-read">
                <section name="additional_params" title="Additional Options" expanded="False">
                    <param name="back_distance" value="10"  type="integer" label="back_distance" help="e.g. 10" />
                    <param name="weight" value="1"  type="integer" label="weight" help="e.g. 1" />
                    <param name="min_mapping_threshold" value="20"  type="integer" label="min_mapping_threshold" help="e.g. 20" />
                </section>
            </when>
            
        </conditional>

    </inputs>

    <outputs>
        <data format="tabular" name="histogram" type="data" label="Lumpy on ${input_file.element_identifier}: Fragment size distribution">
            <filter>seq_method['seq_method_list'] == "paired-end"</filter>
        </data>
        <data format="bam" name="splits" type="data" label="Lumpy on ${input_file.element_identifier}: Split Reads (Bam format)"/>
        <data format="bam" name="discordants" type="data" label="Lumpy on ${input_file.element_identifier}: Discordant Pairs (Bam format)">
            <filter>seq_method['seq_method_list'] == "paired-end"</filter>
        </data>
        <data format="vcf" name="vcf_call" type="data" label="Lumpy on ${input_file.element_identifier}: Variant Calling (vcf format)"/>
    </outputs>

    <tests>
        <test>
            <param name="input_file" value="sr.input.bam" ftype="bam"/>
            <param name="seq_method_list" value="single-read" />
            <param name="back_distance" value="10"/>
            <param name="weight" value="1" />
            <param name="min_mapping_threshold" value="20" />
            <output name="vcf_call" file="output.vcf" ftype="vcf"/>
        </test>
   </tests>

    <help>
    
**lumpy-sv manual**

Read the lumpy-sv_ documentation for details on using lumpy.

.. _lumpy-sv: https://github.com/arq5x/lumpy-sv

**lumpy options**

v 0.2.13
Author:  Ryan Layer (rl6sf@virginia.edu)

Summary: Find structural variations in various signals.

Options::

	-g	Genome file (defines chromosome order)
	-e	Show evidence for each call
	-w	File read windows size (default 1000000)
	-mw	minimum weight for a call
	-msw	minimum per-sample weight for a call
	-tt	trim threshold
	-x	exclude file bed file
	-t	temp file prefix, must be to a writeable directory
	-P	output probability curve for each variant
	-b	output BEDPE instead of VCF
	-sr	bam_file:&lt;file name&gt;,
		id:&lt;sample name&gt;,
		back_distance:&lt;distance&gt;,
		min_mapping_threshold:&lt;mapping quality&gt;,
		weight:&lt;sample weight&gt;,
		min_clip:&lt;minimum clip length&gt;,
		read_group:&lt;string&gt;

	-pe	bam_file:&lt;file name&gt;,
		id:&lt;sample name&gt;,
		histo_file:&lt;file name&gt;,
		mean:&lt;value&gt;,
		stdev:&lt;value&gt;,
		read_length:&lt;length&gt;,
		min_non_overlap:&lt;length&gt;,
		discordant_z:&lt;z value&gt;,
		back_distance:&lt;distance&gt;,
		min_mapping_threshold:&lt;mapping quality&gt;,
		weight:&lt;sample weight&gt;,
		read_group:&lt;string&gt;

	-bedpe	bedpe_file:&lt;bedpe file&gt;,
		id:&lt;sample name&gt;,
		weight:&lt;sample weight&gt;
		
    </help>

    <citations>
    <citation type="doi">10.1186/gb-2014-15-6-r84</citation>
  </citations>
</tool>