changeset 7:15df15127c18 draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/methyldackel commit 6a688af07eb65f08922cf59dabcbc1b16277db8c
author bgruening
date Fri, 23 Mar 2018 17:52:57 -0400
parents 906db57d5d65
children 183cb55b1729
files MethylDackel.xml test-data/cg100.bed test-data/test7_output.tsv test-data/test8_output.tsv
diffstat 4 files changed, 226 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/MethylDackel.xml	Tue Jun 13 01:01:31 2017 -0400
+++ b/MethylDackel.xml	Fri Mar 23 17:52:57 2018 -0400
@@ -1,18 +1,10 @@
-<tool id="pileometh" name="MethylDackel" version="0.3.0">
+<tool id="pileometh" name="MethylDackel" version="0.3.0.1">
     <description>A tool for processing bisulfite sequencing alignments</description>
     <requirements>
         <requirement type="package" version="0.3.0">methyldackel</requirement>
     </requirements>
-    <stdio>
-        <!-- Anything other than zero is an error -->
-        <exit_code range="1:" />
-        <exit_code range=":-1" />
-        <!-- In case the return code has not been set propery check stderr too -->
-        <regex match="Error:" />
-        <regex match="Exception:" />
-    </stdio>
     <version_command><![CDATA[MethylDackel --version]]></version_command>
-    <command><![CDATA[
+    <command detect_errors="aggressive"><![CDATA[
         #if $reference_source.reference_source_selector == "cached":
             ln -s $reference_source.ref_file.fields.path reference.fasta &&
         #else:
@@ -44,6 +36,9 @@
                 #if $advanced_options.mbias_regionString:
                     -r $advanced_options.mbias_regionString
                 #end if
+                #if $advanced_options.regionBed:
+                    -l '$advanced_options.regionBed'
+                #end if
                 $advanced_options.keepDupes
                 $advanced_options.keepSingleton
                 $advanced_options.keepDiscordant
@@ -75,6 +70,7 @@
                 #end if
                 $advanced_options.CHG
                 $advanced_options.CHH
+                $advanced_options.noCpG
             #end if
 
             reference.fasta
@@ -82,7 +78,7 @@
             $input_sortedAlignBAM
 
             #if $main_task.task == "mbias":
-                out_mbias &&
+                out_mbias $main_task.tsv > out_mbias.tsv &&
                 touch out_mbias_OT.svg &&
                 touch out_mbias_OB.svg &&
                 touch out_mbias_CTOT.svg &&
@@ -131,7 +127,10 @@
                 <param name="CTOT" type="text" value="" label="Complementary to the original bottom strand bounds (comma-separated, no spaces)" />
                 <param name="CTOB" type="text" value="" label="Complementary to the original bottom strand bounds (comma-separated, no spaces)" />
             </when>
-            <when value="mbias"/>
+            <when value="mbias">
+                <param name="tsv" type="boolean" truevalue="--txt" falsevalue=""
+                       label="output tab separated mbias metrics"/>
+            </when>
         </conditional>
         <conditional name="advanced_options">
             <param name="options" type="select" label="Advanced options">
@@ -139,7 +138,8 @@
                 <option value="yes">Display advanced options</option>
             </param>
             <when value="yes">
-                <param name="mbias_regionString" type="text" value="" label="Region string in which to extract methylation"/>
+                <param name="mbias_regionString" type="text" value="" label="Region string in which to extract methylation (e.g. chr1:1-100)"/>
+                <param name="regionBed" type="data" optional="true" format='bed' label="Bed file of regions for inclusion"/>
                 <param name="keepDupes" type="boolean" checked="false" truevalue="--keepDupes" falsevalue=""
                     label="By default, any alignment marked as a duplicate is ignored. This option causes them to be incorporated" />
                 <param name="keepSingleton" type="boolean" checked="false" truevalue="--keepSingleton" falsevalue=""
@@ -150,7 +150,7 @@
                 <param name="min_phred" type="integer" value="5" label="Minimum Phred threshold to include a base (default 5). This must be >0."/>
                 <param name="max_pbdepth" type="integer" value="2000" label="Maximum per-base depth (default 2000)"/>
                 <param name="min_pbdepth" type="integer" value="1" min="1" label="Minimum per-base depth"
-                    help="Minimum per-base dpeth for reporting output. If you use --mergeContext (above), then this applies to the merged CpG/CHG (default 1). (-d)" />
+                    help="Minimum per-base depth for reporting output. If you use --mergeContext (above), then this applies to the merged CpG/CHG (default 1). (-d)" />
 
                 <param name="ignoreFlags" type="integer" value="3840" label="Ignore certain alignments"
                     help="By deault, any alignment marked as secondary (bit 0x100), failing QC (bit 0x200), a PCR/optical duplicate (0x400) or supplemental (0x800) is ignored. This equates to a value of 0xF00 or 3840 in decimal. If you would like to change that, you can specify a new value here." />
@@ -170,10 +170,12 @@
                 <param name="methylKit" type="boolean" checked="false" truevalue="--methylKit" falsevalue=""
                     label="Output in the format required by methylKit. This is mutually exclusive with --counts, --fraction, and --logit" />
 
+                <param name="noCpG" type="boolean" checked="false" truevalue="--noCpG" falsevalue=""
+                    label="Do not output CpG context methylation metrics" />
                 <param name="CHG" type="boolean" checked="false" truevalue="--CHG" falsevalue=""
-                    label="Additional output file with CHG methylation metrics" />
+                    label="Output CHG context methylation metrics" />
                 <param name="CHH" type="boolean" checked="false" truevalue="--CHH" falsevalue=""
-                    label="Additional output file with CHH methylation metrics" />
+                    label="Output CHH context methylation metrics" />
 
                 <param name="nOT" type="text" value="" label="Original top strand absolute bounds (comma-separated, no spaces)"
                     help="Like --OT, but always exclude INT bases from a given end
@@ -196,6 +198,7 @@
                 <filter>not advanced_options['methylKit']</filter>
                 <filter>not advanced_options['counts']</filter>
                 <filter>not advanced_options['fraction']</filter>
+                <filter>not advanced_options['noCpG']</filter>
             </data>
             <data  name="outFileExtractCpGLogit" format="bedgraph" from_work_dir="output_CpG.logit.bedGraph" 
                 label="${tool.name} on ${on_string} (logit)">
@@ -281,6 +284,11 @@
                 <filter>advanced_options['options'] == "yes"</filter>
                 <filter>advanced_options['CHH']</filter>
             </data>
+            <data  name="outFileMbiasTSV" format="tabular" from_work_dir="out_mbias.tsv"
+                label="${tool.name} on ${on_string} (methylation bias, tsv)">
+                <filter>main_task['task']  == 'mbias'</filter>
+                <filter>main_task['tsv']</filter>
+            </data>
             <data  name="outFileMbiasCpGOT" format="svg" from_work_dir="out_mbias_OT.svg"
                 label="${tool.name} on ${on_string} (methylation bias, original top strand)">
                 <filter>main_task['task']  == 'mbias'</filter>
@@ -361,6 +369,27 @@
             <param name="methylKit" value="true" />
             <output name="outFileExtractCpGMethylKit" file="test_5.methylKit" ftype="text" compare="diff"/>
         </test>
+        <test>
+            <param name="task" value="mbias" />
+            <param name="min_mapq" value="2" />
+            <param name="options" value="yes"/>
+            <param name="tsv" value="--txt"/>
+            <param name="reference_source_selector" value="history" />
+            <param name="ref_file" value="cg100.fa" ftype="fasta" />
+            <param name="input_sortedAlignBAM" value="cg_aln.bam" ftype="bam"/>
+            <output name="outFileMbiasTSV" file="test7_output.tsv" ftype="tabular" compare="diff"/>
+        </test>
+        <test>
+            <param name="task" value="mbias" />
+            <param name="min_mapq" value="2" />
+            <param name="options" value="yes"/>
+            <param name="regionBed" ftype="bed" value="cg100.bed"/>
+            <param name="tsv" value="--txt"/>
+            <param name="reference_source_selector" value="history" />
+            <param name="ref_file" value="cg100.fa" ftype="fasta" />
+            <param name="input_sortedAlignBAM" value="cg_aln.bam" ftype="bam"/>
+            <output name="outFileMbiasTSV" file="test8_output.tsv" ftype="tabular" compare="diff"/>
+        </test>
     </tests>
     <help><![CDATA[
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/cg100.bed	Fri Mar 23 17:52:57 2018 -0400
@@ -0,0 +1,1 @@
+chrCG	10	90
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/test7_output.tsv	Fri Mar 23 17:52:57 2018 -0400
@@ -0,0 +1,99 @@
+Strand	Read	Position	nMethylated	nUnmethylated
+OT	1	1	1	0
+OT	2	1	1	0
+OT	1	3	1	0
+OT	2	3	1	0
+OT	1	5	1	0
+OT	2	5	1	0
+OT	1	7	1	0
+OT	2	7	1	0
+OT	1	9	1	0
+OT	2	9	1	0
+OT	1	11	1	0
+OT	2	11	1	0
+OT	1	13	1	0
+OT	2	13	1	0
+OT	1	15	1	0
+OT	2	15	1	0
+OT	1	17	0	1
+OT	2	17	1	0
+OT	1	19	1	0
+OT	2	19	1	0
+OT	1	21	1	0
+OT	2	21	1	0
+OT	1	23	1	0
+OT	2	23	1	0
+OT	1	25	1	0
+OT	2	25	1	0
+OT	1	27	1	0
+OT	2	27	1	0
+OT	1	29	1	0
+OT	2	29	1	0
+OT	1	31	1	0
+OT	2	31	1	0
+OT	1	33	1	0
+OT	2	33	1	0
+OT	1	35	1	0
+OT	2	35	1	0
+OT	1	37	1	0
+OT	2	37	1	0
+OT	1	39	1	0
+OT	2	39	1	0
+OT	1	41	1	0
+OT	2	41	1	0
+OT	1	43	1	0
+OT	2	43	1	0
+OT	1	45	1	0
+OT	2	45	1	0
+OT	1	47	1	0
+OT	2	47	1	0
+OT	1	49	1	0
+OT	2	49	1	0
+OT	1	51	1	0
+OT	2	51	1	0
+OT	1	53	1	0
+OT	2	53	1	0
+OT	1	55	1	0
+OT	2	55	1	0
+OT	1	57	1	0
+OT	2	57	1	0
+OT	1	59	1	0
+OT	2	59	1	0
+OT	1	61	1	0
+OT	2	61	1	0
+OT	1	63	1	0
+OT	2	63	1	0
+OT	1	65	1	0
+OT	2	65	1	0
+OT	1	67	1	0
+OT	2	67	1	0
+OT	1	69	1	0
+OT	2	69	1	0
+OT	1	71	1	0
+OT	2	71	1	0
+OT	1	73	1	0
+OT	2	73	1	0
+OT	1	75	1	0
+OT	2	75	1	0
+OT	1	77	1	0
+OT	2	77	1	0
+OT	1	79	1	0
+OT	2	79	1	0
+OT	1	81	1	0
+OT	2	81	1	0
+OT	1	83	1	0
+OT	2	83	1	0
+OT	1	85	1	0
+OT	2	85	1	0
+OT	1	87	1	0
+OT	2	87	1	0
+OT	1	89	1	0
+OT	2	89	1	0
+OT	1	91	1	0
+OT	2	91	1	0
+OT	1	93	1	0
+OT	2	93	1	0
+OT	1	95	1	0
+OT	2	95	1	0
+OT	1	97	1	0
+OT	2	97	1	0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/test8_output.tsv	Fri Mar 23 17:52:57 2018 -0400
@@ -0,0 +1,81 @@
+Strand	Read	Position	nMethylated	nUnmethylated
+OT	1	11	1	0
+OT	2	11	1	0
+OT	1	13	1	0
+OT	2	13	1	0
+OT	1	15	1	0
+OT	2	15	1	0
+OT	1	17	0	1
+OT	2	17	1	0
+OT	1	19	1	0
+OT	2	19	1	0
+OT	1	21	1	0
+OT	2	21	1	0
+OT	1	23	1	0
+OT	2	23	1	0
+OT	1	25	1	0
+OT	2	25	1	0
+OT	1	27	1	0
+OT	2	27	1	0
+OT	1	29	1	0
+OT	2	29	1	0
+OT	1	31	1	0
+OT	2	31	1	0
+OT	1	33	1	0
+OT	2	33	1	0
+OT	1	35	1	0
+OT	2	35	1	0
+OT	1	37	1	0
+OT	2	37	1	0
+OT	1	39	1	0
+OT	2	39	1	0
+OT	1	41	1	0
+OT	2	41	1	0
+OT	1	43	1	0
+OT	2	43	1	0
+OT	1	45	1	0
+OT	2	45	1	0
+OT	1	47	1	0
+OT	2	47	1	0
+OT	1	49	1	0
+OT	2	49	1	0
+OT	1	51	1	0
+OT	2	51	1	0
+OT	1	53	1	0
+OT	2	53	1	0
+OT	1	55	1	0
+OT	2	55	1	0
+OT	1	57	1	0
+OT	2	57	1	0
+OT	1	59	1	0
+OT	2	59	1	0
+OT	1	61	1	0
+OT	2	61	1	0
+OT	1	63	1	0
+OT	2	63	1	0
+OT	1	65	1	0
+OT	2	65	1	0
+OT	1	67	1	0
+OT	2	67	1	0
+OT	1	69	1	0
+OT	2	69	1	0
+OT	1	71	1	0
+OT	2	71	1	0
+OT	1	73	1	0
+OT	2	73	1	0
+OT	1	75	1	0
+OT	2	75	1	0
+OT	1	77	1	0
+OT	2	77	1	0
+OT	1	79	1	0
+OT	2	79	1	0
+OT	1	81	1	0
+OT	2	81	1	0
+OT	1	83	1	0
+OT	2	83	1	0
+OT	1	85	1	0
+OT	2	85	1	0
+OT	1	87	1	0
+OT	2	87	1	0
+OT	1	89	1	0
+OT	2	89	1	0