diff utils_add-read-counts.xml @ 4:63df1e23f4ff draft

planemo upload for repository https://github.com/ErasmusMC-Bioinformatics/segmentation_fold_galaxy_wrapper commit 00690c63c51a7f7563f2428c313d7fa75f2657e5-dirty
author yhoogstrate
date Thu, 28 Jul 2016 10:25:37 -0400
parents
children b7cf9b172cfe
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/utils_add-read-counts.xml	Thu Jul 28 10:25:37 2016 -0400
@@ -0,0 +1,81 @@
+<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.0.1">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>
\ No newline at end of file