changeset 12:836578426f44 draft

Uploaded
author bgruening
date Fri, 24 Jan 2014 10:35:51 -0500
parents ac24388a0fda
children b680eea82cf3
files macs2_callpeak.xml macs2_macros.xml macs2_predict.xml macs2_predictd.xml tool_dependencies.xml
diffstat 5 files changed, 43 insertions(+), 135 deletions(-) [+]
line wrap: on
line diff
--- a/macs2_callpeak.xml	Thu Jan 23 11:31:32 2014 -0500
+++ b/macs2_callpeak.xml	Fri Jan 24 10:35:51 2014 -0500
@@ -3,7 +3,6 @@
     <expand macro="requirements">
         <requirement type="package" version="3.0.1">R_3_0_1</requirement>
         <requirement type="set_environment">MACS2_SCRIPT_PATH</requirement>
-        <!-- awk and R is missing -->
     </expand>
     <expand macro="version_command" />
     <macros>
@@ -29,7 +28,7 @@
 
         --bw='$band_width'
 
-        ##advanced options
+        ## advanced options
         #if str( $advanced_options.advanced_options_selector ) == 'on':
             --mfold $advanced_options.mfoldlo $advanced_options.mfoldhi
             $advanced_options.nolambda
@@ -44,57 +43,28 @@
             --mfold 10 30
         #end if
 
-        $bdg
+        ## With --bdg two additional output files will be generated.
+        #if 'bdg' in str($outputs).split(','):
+            --bdg
+        #end if
 
-        ##pq value select options
+        ## pq value select options
         #if str( $pq_options.pq_options_selector ) == 'qvalue':
             --qvalue $pq_options.qvalue
         #else:
             --pvalue $pq_options.pvalue
         #end if
 
-        ##model options
+        ## model options
         #if str( $nomodel_type.nomodel_type_selector ) == 'nomodel':
             --nomodel --shiftsize='$nomodel_type.shiftsize'
         #end if
 
         2> $temp_stderr;
-        #######################################################
-        ## move files generated by callpeak command 
 
-        ## TODO
         ## run R to create pdf from model script
-        #if os.path.exists( os.getcwd(), "MACS2_model.r" ) ):
-            Rscript "MACS2_model.r" > "MACS2_model.r.log";
-        #end if
-
-
-        ## move bed out to proper output file
-        ##set $file = os.path.join( $tmp_dir, "%s_peaks.bed" % $experiment_name )
-        ##if os.path.exists( $file ):
-        ##    mv $file $output_bed_file
-        ##end if
-
-        ## OICR peak_xls file
-        ##set $file = os.path.join( $tmp_dir, "%s_peaks.xls" % $experiment_name )
-        ##if os.path.exists( $file ):
-        ##    mv $file output_peaks $output_peaks_file
-        ##end if
-
-        ### peaks.encodepeaks (narrowpeaks) file
-        ##set $file = os.path.join ( $tmp_dir, "%s_peaks.encodePeak" % $experiment_name )
-        ##if os.path.exists( $file ):
-        ##    mv $file $output_narrowpeaks_file
-
-
-        ##parse xls files to interval files as needed
-        ##TODO is in working dir
-        #if 'peaks_interval' in str($outputs).split(','):
-            #if os.path.exists( 'MACS2_peaks.xls' ):
-                echo '#peaks file' > $output_xls_to_interval_peaks_file;
-                awk '$2-=1' MACS2_peaks.xls >> $output_xls_to_interval_peaks_file;
-                ##xls_to_interval( create_peak_xls_file, output_xls_to_interval_peaks_file, header = 'peaks file' )
-            #end if
+        #if 'pdf' in str($outputs).split(','):
+            Rscript MACS2_model.r > MACS2_model.r.log;
         #end if
 
         #if 'html' in str($outputs).split(','):
@@ -103,7 +73,7 @@
             if [ \$count != 0 ];
             then 
                 mkdir $output_extra_files.extra_files_path;
-                mv MACS2* $output_extra_files.extra_files_path;
+                cp MACS2* $output_extra_files.extra_files_path;
                 python \$MACS2_SCRIPT_PATH/dir2html.py $output_extra_files.extra_files_path $temp_stderr > $output_extra_files;
             fi;
         #end if
@@ -119,7 +89,6 @@
 
         <param name="band_width" type="integer" value="300" label="Band width for picking regions to compute fragment size"
             help="This value is only used while building the shifting model." />
-        <param name="bdg" type="boolean" truevalue="-B" falsevalue="" checked="False" label="Save fragment pileup, control lambda, -log10pvalue/qvalue in bedGraph" help="Files are located in the html report."/>
 
         <conditional name="pq_options">
             <param name="pq_options_selector" type="select" label="Peak detection based on" help="default uses q-value">
@@ -146,13 +115,11 @@
 
         <param name="outputs" type="select" display="checkboxes" multiple="True" label="Outputs">
             <option value="peaks_bed" selected="True">Peaks as BED file</option>
+            <option value="narrow">narrow Peaks</option>
+            <option value="summits" selected="true">summits</option>
+            <option value="bdg" selected="true">Scores in bedGraph files (--bdg)</option>
             <option value="html">Summary page (html)</option>
-            <option value="narrow">narrow Peaks</option>
-            <option value="broad">broad Peaks</option>
-            <option value="gapped">gapped Peaks</option>
-            <option value="summits" selected="true">summits</option>
-            <option value="peaks_interval">Peaks as interval file</option>
-            <option value="plot">Plot in PDF</option>
+            <option value="pdf">Plot in PDF</option>
             <validator type="no_options" message="Please select at least one output file." />
         </param>
 
@@ -188,10 +155,12 @@
             <filter>'narrow' in outputs</filter>
         </data>
         <data name="output_broadpeaks" format="tabular" from_work_dir="MACS2_broad_peaks.bed" label="${tool.name} on ${on_string} (broad Peaks)">
-            <filter>'broad' in outputs</filter>
-        </data>
-        <data name="output_gappedpeaks" format="tabular" from_work_dir="MACS2_peaks.gappedPeak" label="${tool.name} on ${on_string} (gapped Peaks)">
-            <filter>'gapped' in outputs</filter>
+            <filter>
+            ((
+              advanced_options['advanced_options_selector'] == "on" and
+              advanced_options['broad_options']['broad_options_selector'] == "--broad"
+            ))
+            </filter>
         </data>
         <data name="output_summits" format="bed" from_work_dir="MACS2_summits.bed" label="${tool.name} on ${on_string} (summits in BED)">
             <filter>'summits' in outputs</filter>
@@ -199,8 +168,11 @@
         <data name="output_plot" format="pdf" from_work_dir="MACS2_model.pdf" label="${tool.name} on ${on_string} (plot)">
             <filter>'pdf' in outputs</filter>
         </data>
-        <data name="output_xls_to_interval_peaks_file" format="interval" label="${tool.name} on ${on_string} (peaks: interval)">
-            <filter>'peaks_interval' in outputs</filter>
+        <data name="output_treat_pileup" format="bedgraph" from_work_dir="MACS2_treat_pileup.bdg" label="${tool.name} on ${on_string} (Bedgraph Treatment)">
+            <filter>'bdg' in outputs</filter>
+        </data>
+        <data name="output_control_lambda" format="bedgraph" from_work_dir="MACS2_control_lambda.bdg" label="${tool.name} on ${on_string} (Bedgraph Control)">
+            <filter>'bdg' in outputs</filter>
         </data>
         <data name="output_extra_files" format="html" label="${tool.name} on ${on_string} (html report)">
             <filter>'html' in outputs</filter>
@@ -225,6 +197,9 @@
 
 **Peak Calling**: Main MACS2 Function to Call peaks from alignment results.
 
+If you choose "Scores in bedGraph files" MACS will output the fragment pileup, control lambda, -log10-pvalue and -log10-qvalue scores in bedGraph files.
+
+
 **Compare .bdg files**: Deduct noise by comparing two signal tracks in bedGraph.
 
 
--- a/macs2_macros.xml	Thu Jan 23 11:31:32 2014 -0500
+++ b/macs2_macros.xml	Fri Jan 24 10:35:51 2014 -0500
@@ -1,7 +1,7 @@
 <macros>
     <xml name="requirements">
         <requirements>
-            <requirement type="package" version="2.0.10.2">macs2</requirement>
+            <requirement type="package" version="2.0.10.3">macs2</requirement>
             <requirement type="package" version="1.7.1">numpy</requirement>
             <yield />
         </requirements>
--- a/macs2_predict.xml	Thu Jan 23 11:31:32 2014 -0500
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-<tool id="macs2_predict" name="MACS2 predictd" version="2.0.10.0">
-    <description>Predict 'd' or fragment size from alignment results</description>
-    <expand macro="requirements">
-        <requirement type="package" version="3.0.1">R_3_0_1</requirement>
-    </expand>
-    <expand macro="version_command" />
-    <macros>
-        <import>macs2_macros.xml</import>
-    </macros>
-    <command>
-        macs2 predictd
-            -i #echo ','.join($infiles)#
-            --tsize $tsize
-            @effective_genome_size@
-            --bw $band_width
-            --mfold $advanced_options.mfoldlo $advanced_options.mfoldhi
-            &gt; $outfile;
-
-        Rscript predicted_model.R &gt; $outfile_image
-    </command>
-    <expand macro="stdio" />
-    <inputs>
-        <repeat name="infiles" title="ChIP-seq alignment files" min="1" 
-            help="If multiple files are given, then they will all be read and combined. Note that pair-end data is not supposed to work with this command.">
-
-            <param name="infile" type="data" format="bam,sam,bed" multiple="True" optional="True" label="ChIP-seq alignment file" help="-i" />
-        </repeat>
-
-        <expand macro="conditional_effective_genome_size" />
-        <expand macro="tag_size" />
-
-        <param name="band_width" type="integer" value="300" label="Band width for picking regions to compute fragment size"
-            help="This value is only used while building the shifting model. (--bw)" />
-
-        <param name="mfoldlo" type="integer" label="Fold-enrichment lower limit" value="5"
-            help="Select the regions with MFOLD high-confidence enrichment ratio against background to build model (--mfold)"/>
-        <param name="mfoldhi" type="integer" label="Fold-enrichment upper-limit" value="50"
-            help="Select the regions with MFOLD high-confidence enrichment ratio against background to build model (--mfold)"/>
-
-    </inputs>
-
-    <outputs>
-        <data name="outfile" format="txt" label="${tool.name} on ${on_string} - d value" />
-        <data name="outfile_image" format="png" label="${tool.name} on ${on_string} - X-correlation image" />
-    </outputs>
-    <tests>
-        <!--none yet for macs2-->
-    </tests>
-    <help>
-**What it does**
-
-bdgdiff from macs2
-
-
-Note that pair-end data is not supposed to work with this command.
-
-
-@citation@
-    </help>
-</tool>
--- a/macs2_predictd.xml	Thu Jan 23 11:31:32 2014 -0500
+++ b/macs2_predictd.xml	Fri Jan 24 10:35:51 2014 -0500
@@ -1,5 +1,5 @@
-<tool id="macs2_predict" name="Predict" version="2.0.10.0">
-    <description>d or fragment size from alignment results</description>
+<tool id="macs2_predictd" name="MACS2 predictd" version="2.0.10.0">
+    <description>Predict 'd' or fragment size from alignment results</description>
     <expand macro="requirements">
         <requirement type="package" version="3.0.1">R_3_0_1</requirement>
     </expand>
@@ -8,24 +8,19 @@
         <import>macs2_macros.xml</import>
     </macros>
     <command>
-        macs2 predict
-            -i #echo ','.join($infiles)#
+        macs2 predictd
+            -i #echo ','.join( map( str, $infiles) )#
             --tsize $tsize
             @effective_genome_size@
             --bw $band_width
-            --mfold $advanced_options.mfoldlo $advanced_options.mfoldhi
+            --mfold $mfoldlo $mfoldhi
             &gt; $outfile;
 
         Rscript predicted_model.R &gt; $outfile_image
     </command>
-        <expand macro="stdio" />
+    <expand macro="stdio" />
     <inputs>
-        <repeat name="infiles" title="ChIP-seq alignment files" min="1" 
-            help="If multiple files are given, then they will all be read and combined. Note that pair-end data is not supposed to work with this command.">
-
-            <param name="infile" type="data" format="bam,sam,bed" multiple="True" optional="True" label="ChIP-seq alignment file" help="-i" />
-        </repeat>
-
+        <param name="infiles" type="data" format="bam,sam,bed" multiple="True" label="ChIP-seq alignment file" help="If multiple files are given, then they will all be read and combined. Note that pair-end data is not supposed to work with this command. (-i)" />
         <expand macro="conditional_effective_genome_size" />
         <expand macro="tag_size" />
 
@@ -55,12 +50,6 @@
 Note that pair-end data is not supposed to work with this command.
 
 
-------
-
-**Citation**
-
-For the underlying tool, please cite Zhang Y, Liu T, Meyer CA, Eeckhoute J, Johnson DS, Bernstein BE, Nusbaum C, Myers RM, Brown M, Li W, Liu XS. Model-based analysis of ChIP-Seq (MACS). Genome Biol. 2008;9(9):R137.
-
-Integration of MACS2 with Galaxy performed by Ziru Zhou ( ziruzhou@gmail.com ). Please send your comments/questions to modENCODE DCC at help@modencode.org.
+@citation@
     </help>
 </tool>
--- a/tool_dependencies.xml	Thu Jan 23 11:31:32 2014 -0500
+++ b/tool_dependencies.xml	Fri Jan 24 10:35:51 2014 -0500
@@ -12,10 +12,14 @@
     <set_environment version="1.0">
         <environment_variable action="set_to" name="MACS2_SCRIPT_PATH">$REPOSITORY_INSTALL_DIR</environment_variable>
     </set_environment>
-    <package name="macs2" version="2.0.10.2">
+    <!-- 2.0.10 12162013 -->
+    <package name="macs2" version="2.0.10.3">
         <install version="1.0">
             <actions>
-                <action type="download_by_url">https://pypi.python.org/packages/source/M/MACS2/MACS2-2.0.10.07132012.tar.gz</action>
+                <action type="shell_command">git clone --recursive https://github.com/taoliu/MACS.git</action>
+                <action type="shell_command">git checkout 7ccb571d2f2dcb5be1d75f323b1d17a59b926deb</action>
+                <action type="shell_command">git submodule update --recursive</action>
+
                 <action type="set_environment_for_install">
                     <repository changeset_revision="84125ffacb90" name="package_numpy_1_7" owner="iuc" toolshed="http://testtoolshed.g2.bx.psu.edu">
                         <package name="numpy" version="1.7.1" />