view bam_to_bigwig.xml @ 1:2e812b4f91ce draft default tip

planemo upload commit 250051c3d660df43da92c76913552767ce142a45-dirty
author yating-l
date Tue, 30 May 2017 18:18:20 -0400
parents 61f39c77b13d
children
line wrap: on
line source

<tool id="bam_to_bigwig" name="Convert Bam to BigWig" version="0.1.0">
    <requirements>
        <requirement type="package" version="1.0">ucsc_tools_340</requirement>
        <requirement type="package" version="2.24">bedtools</requirement>
    </requirements>
    <stdio>
        <exit_code range="1:" />
    </stdio>
    <command><![CDATA[
        faToTwoBit $input_reference_fasta two_bit.2bit;
        twoBitInfo two_bit.2bit stdout | sort -k2nr > chrom.sizes;
        bedtools genomecov -bg -split -ibam $input_bam -g chrom.sizes 
        | LC_COLLATE=C sort -k1,1 -k2,2n
        > temp.bg &&
        bedGraphToBigWig temp.bg chrom.sizes $output_bigwig;
    ]]></command>
    <inputs>
        <param format="bam" name="input_bam" type="data" label="Choose BAM file" />
        <param format="fasta" name="input_reference_fasta"
               type="data" label="Choose Reference Genome (Fasta)" />
    </inputs>
    <outputs>
        <data format="bigwig" name="output_bigwig" />
    </outputs>
    <help>
        This tool converts a Bam file to a BigWig file.

        It needs:
            - A Bam file
            - The reference genome as a Fasta file
    </help>
</tool>