view utils_add-read-counts.xml @ 6:4d16cf9414cf draft default tip

planemo upload for repository https://github.com/ErasmusMC-Bioinformatics/galaxytools-emc/tree/master/tools/segmentation_fold commit 3a3c1d069e0a079d8ea7c0b4ac856ef24141b1aa
author erasmus-medical-center
date Fri, 24 Feb 2017 04:18:22 -0500
parents b7cf9b172cfe
children
line wrap: on
line source

<tool id="smf_utils_add-read-counts" name="add-read-counts" version="@VERSION@-3">
    <description>Annotate sequences by adding the read counts from a bam file, within a region contained in the fasta header of the dbn file</description>
    
    <macros>
        <import>macros.xml</import>
    </macros>
    
    <expand macro="requirements" />
    <expand macro="version_command" />
    
    <command detect_errors="aggressive"><![CDATA[
        ln -f -s '${bam_input_file.metadata.bam_index}' '${bam_input_file}.bai' &&
        
        segmentation-fold-utils
            add-read-counts
                --regex '${regex.replace("'","\\'")}'
                '$dbn_input_file'
                '$bam_input_file'
                '$dbn_output_file'
    ]]></command>

    <inputs>
        <param name="dbn_input_file"
               type="data"
               format="dbn,txt,text"
               label="Input DBN file"
               help="The 'fasta'-headers should contain the genomic position being used to find overlapping reads in the BAM file"/>
        <param name="bam_input_file"
               type="data"
               format="bam"
               label="Input BAM file"/>
        <param name="regex"
               type="text"
               argument="--regex"
               value='>.*?(chr[^:]):([0-9]+)-([0-9]+)'
               label="Regex to capture the targeted location in DBN file"
               help="Do not change this value unless you're using customized software in the pipeline - default: '>.*?(chr[^:]):([0-9]+)-([0-9]+)'" />
    </inputs>

    <outputs>
        <data name="dbn_output_file"
              format="dbn"
              label="${tool.name} on ${dbn_input_file.hid}: ${dbn_input_file.name}"/>
    </outputs>

    <tests>
        <test>
            <param name="dbn_input_file" value="DBNFile.test_01.in.dbn" ftype="dbn"/>
            <param name="bam_input_file" value="DBNFile.test_01.in.bam" ftype="bam"/>
            <param name="regex" value='>.*?(chr[^:]):([0-9]+)-([0-9]+)'/>

            <output name="dbn_output_file">
                <assert_contents>
                    <has_line_matching expression="&gt;chr1:10-21 x unknown-01 \(aligned reads .*?: 20\)"/>
                    <has_line line="GGGGAAACCCC"/>
                    <has_line line="((((...))))&#009;((.((.)).))&#009;-2.5"/>
                    <has_line line="((.((.)).))&#009;(((((.)))))&#009;-3.5"/>
                    
                    <has_line_matching expression="&gt;chr1:25-36 x unknown-01 \(aligned reads.*?: 1\)"/>
                    <has_line line="AAAAAAAAAAA"/>
                    
                    <has_line_matching expression="&gt;chr1:45-56 x unknown-01 \(aligned reads .*?: 2\)"/>
                </assert_contents>
            </output>
        </test>
    </tests>
    
    <help><![CDATA[
This is an utility of the segmentation-fold package
    ]]></help>
    
    <expand macro="citations" />
</tool>