view utils_add-read-counts.xml @ 5:b7cf9b172cfe draft

planemo upload for repository https://github.com/ErasmusMC-Bioinformatics/segmentation_fold_galaxy_wrapper commit b97b90c692604239ed6e9423655c6c5d05798b32-dirty
author yhoogstrate
date Wed, 03 Aug 2016 04:54:40 -0400
parents 63df1e23f4ff
children 4d16cf9414cf
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>
    
    <requirements>
        <requirement type="package" version="2.7.10">python</requirement>
        <requirement type="package" version="1.9">numpy</requirement>
        <requirement type="package" version="0.8.2.1">pysam</requirement>
        <requirement type="package" version="0.6.1">htseq</requirement>
        <requirement type="package" version="2.1.0">segmentation-fold-utils</requirement>
    </requirements>
    <expand macro="stdio" />
    
    <version_command>@VERSION_COMMAND_UTILS@</version_command>
    
    <command><![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>