view paired_bam_dealer.xml @ 1:bd0524e92afd

planemo upload commit b'd1ace1d44eded428481c00e5ab393ac83e02c2b1\n'
author jpayne
date Wed, 06 Dec 2017 13:16:24 -0500
parents 6325216db1fe
children 628a56494663
line wrap: on
line source
<tool id="paired_bam_dealer" name="Deal out" version="0.1.0">
	<description>paired-end reads by alignment or non-alignment to a reference</description>
    <requirements>
    	<requirement type="package" version="1.5">samtools</requirement>
    	<requirement type="package" version="2.26">bedtools</requirement>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[
        bamToFastq -i <(samtools sort -n <(samtools view -u -f 1 -F 12 $input_bam  )) 
        	-fq $mapped_1
        	-fq2 $mapped_2		&& 	echo "mapped out"	&&
        bamToFastq -i <(
        	samtools merge -u -
        					  <(samtools view -u -f 4  -F 264 $input_bam)
        					  <(samtools view -u -f 8  -F 260 $input_bam)
        					  <(samtools view -u -f 12 -F 256 $input_bam)
        		| samtools sort -n 
        	)
        	-fq $unmapped_1
        	-fq2 $unmapped_2	&& echo "unmapped out"
    ]]></command>
    <inputs>
    	<param format="bam" name="input_bam" type="data" label="BAM alignment" />
    </inputs>
    <outputs>
    	<data format="fastqsanger" label="unmapping reads, reverse" name="unmapped_2" />
    	<data format="fastqsanger" label="unmapping reads, forward" name="unmapped_1" />
    	<data format="fastqsanger" label="mapping reads, reverse" name="mapped_2" />
    	<data format="fastqsanger" label="mapping reads, forward" name="mapped_1" />
    </outputs>
    <tests>
    	<test>
    		<param name="input_bam" value="mapped_reads.bam" />
    		<output name="mapped_1" value="forward_mapped.fastq" />
    		<output name="mapped_2" value="reverse_mapped.fastq" />
    		<output name="unmapped_1" value="forward_unmapped.fastq" />
    		<output name="unmapped_2" value="reverse_unmapped.fastq" />
    	</test>
    </tests>
    <help><![CDATA[
        Input is a BAM alignment of paired-end reads to a reference. Output is paired-end files of reads mapping and reads not mapping to reference.
    ]]></help>

    <citations>
    </citations>
</tool>