changeset 1:d0986d2be693 draft

Substantial reimplementation of internals, also renamed id and version.
author pjbriggs
date Thu, 29 Jan 2015 11:11:21 -0500
parents fdad0c8c0957
children 15889783e759
files macs21_wrapper.py macs21_wrapper.xml tool_dependencies.xml
diffstat 3 files changed, 259 insertions(+), 318 deletions(-) [+]
line wrap: on
line diff
--- a/macs21_wrapper.py	Wed Jan 21 11:07:37 2015 -0500
+++ b/macs21_wrapper.py	Thu Jan 29 11:11:21 2015 -0500
@@ -1,208 +1,177 @@
-#purpose: macs2 python wrapper
-#author: Ziru Zhou
-#date: November, 2012
+#!/bin/env python
+#
+# Galaxy wrapper to run MACS 2.1
+#
+# Completely rewritten from the original macs2 wrapped by Ziru Zhou
+# taken from http://toolshed.g2.bx.psu.edu/view/modencode-dcc/macs2
 
-import sys, subprocess, tempfile, shutil, glob, os, os.path, gzip
-from galaxy import eggs
-import pkg_resources
-pkg_resources.require( "simplejson" )
-import simplejson
+import sys
+import os
+import subprocess
+import tempfile
+import shutil
 
-CHUNK_SIZE = 1024
+def move_file(working_dir,name,destination):
+    """Move a file 'name' from 'working_dir' to 'destination'
+
+    """
+    if destination is None:
+        # Nothing to do
+        return
+    source = os.path.join(working_dir,name)
+    if os.path.exists(source):
+        shutil.move(source,destination)
 
-#==========================================================================================
-#functions
-#==========================================================================================
-def gunzip_cat_glob_path( glob_path, target_filename, delete = False ):
-    out = open( target_filename, 'wb' )
-    for filename in glob.glob( glob_path ):
-        fh = gzip.open( filename, 'rb' )
-        while True:
-            data = fh.read( CHUNK_SIZE )
-            if data:
-                out.write( data )
-            else:
-                break
-        fh.close()
-        if delete:
-            os.unlink( filename )
-    out.close()
+def convert_xls_to_interval(xls_file,interval_file,header=None):
+    """Convert MACS XLS file to interval
+
+    From the MACS readme: "Coordinates in XLS is 1-based which is different with
+    BED format."
 
-def xls_to_interval( xls_file, interval_file, header = None ):
-    out = open( interval_file, 'wb' )
+    However this function no longer performs any coordinate conversions, it
+    simply ensures that any blank or non-data lines are commented out
+
+    """
+    fp = open(interval_file,'wb')
     if header:
-        out.write( '#%s\n' % header )
-    wrote_header = False
-    #From macs readme: Coordinates in XLS is 1-based which is different with BED format.
-    #PJB: updated to keep original 'start' coordinate i.e. do not convert to BED
-    for line in open( xls_file ):
-        #keep all existing comment lines
-        if line.startswith( '#' ):
-            out.write( line )
-	#added for macs2 since there is an extra newline 
-        ##elif line.startswith( '\n' ):
-        ##    out.write( line )
-        elif not wrote_header:
-            out.write( '#%s' % line )
-	    print line
-            wrote_header = True
+        fp.write('#%s\n' % header)
+    for line in open(xls_file):
+        # Keep all existing comment lines
+        if line.startswith('#'):
+            fp.write(line)
         else:
-            fields = line.split( '\t' )
-            if len( fields ) > 1:
+            # Split line into fields and test to see if
+            # the 'start' field is actually an integer
+            fields = line.split('\t')
+            if len(fields) > 1:
                 try:
-                    # Try to convert 'start' to int and shift
-                    ##fields[1] = str( int( fields[1] ) - 1 )
-                    # PJB don't correct, just test to see if it's an integer
-                    int( fields[1] )
+                    int(fields[1])
                 except ValueError:
                     # Integer conversion failed so comment out
                     # "bad" line instead
                     fields[0] = "#%s" % fields[0]
-            out.write( '\t'.join( fields ) )
-    out.close()
-
-#==========================================================================================
-#main
-#==========================================================================================
-def main():
-    #take in options file and output file names
-    options = simplejson.load( open( sys.argv[1] ) )
-    outputs = simplejson.load( open( sys.argv[2] ) )
+            fp.write( '\t'.join( fields ) )
+    fp.close()
 
-    #=================================================================================
-    #parse options and execute macs2
-    #=================================================================================
-    #default inputs that are in every major command
-    experiment_name = '_'.join( options['experiment_name'].split() ) #save experiment name here, it will be used by macs for some file names
-    cmdline = "macs2 %s -t %s" % ( options['command'], ",".join( options['input_chipseq'] ) )
-    if options['input_control']:
-        cmdline = "%s -c %s" % ( cmdline, ",".join( options['input_control'] ) )
+if __name__ == "__main__":
 
-    #=================================================================================
-    if (options['command'] == "callpeak"):
-    	output_summits_bed = outputs['output_summits_bed_file']
-    	output_extra_html = outputs['output_extra_file']
-    	output_extra_path = outputs['output_extra_file_path']
-    	output_peaks =  outputs['output_peaks_file']
-   	output_narrowpeaks = outputs['output_narrowpeaks_file']
-   	output_broadpeaks = outputs['output_broadpeaks_file']
-   	output_gappedpeaks = outputs['output_gappedpeaks_file']
-	output_xls_to_interval_peaks_file = outputs['output_xls_to_interval_peaks_file']
-        output_treat_pileup = outputs['output_treat_pileup_file']
-        output_lambda_bedgraph = outputs['output_lambda_bedgraph_file']
+    # Echo the command line
+    print ' '.join(sys.argv)
 
-        cmdline = "%s --format='%s' --name='%s' --gsize='%s' --bw='%s'" % ( cmdline, options['format'], experiment_name, options['gsize'], options['bw'] )
-        if (options['broad'] == 'broad'):
-            cmdline = "%s --broad --broad-cutoff='%s'" % ( cmdline, options['broad_cutoff'] )
-	if 'pvalue' in options:
-            cmdline = "%s --pvalue='%s'" % ( cmdline, options['pvalue'] )
-	elif 'qvalue' in options:
-            cmdline = "%s --qvalue='%s'" % ( cmdline, options['qvalue'] )
-        cmdline = "%s --mfold %s %s %s %s %s %s --keep-dup %s" % (cmdline, options['mfoldlo'], options['mfoldhi'], options['nolambda'], options['bdg'], options['spmr'], options['call_summits'], options['keep_dup'] )
-		
-	if 'nomodel' in options:
-        	cmdline = "%s --nomodel --extsize='%s'" % ( cmdline, options['nomodel'] )
-    #=================================================================================
-    if (options['command'] == "bdgcmp"):
-	output_bdgcmp = outputs['output_bdgcmp_file']
-
-	cmdline = "%s -m %s -p %s -o bdgcmp_out.bdg" % ( cmdline, options['m'], options['pseudocount'] )
-    #=================================================================================
+    # Initialise output files - values are set by reading from
+    # the command line supplied by the Galaxy wrapper
+    output_extra_html = None
+    output_extra_path = None
+    output_broadpeaks = None
+    output_gappedpeaks = None
+    output_narrowpeaks = None
+    output_treat_pileup = None
+    output_lambda_bedgraph = None
+    output_xls_to_interval_peaks_file = None
+    output_peaks = None
+    output_bdgcmp = None
 
-    tmp_dir = tempfile.mkdtemp() #macs makes very messy output, need to contain it into a temp dir, then provide to user
-    stderr_name = tempfile.NamedTemporaryFile().name # redirect stderr here, macs provides lots of info via stderr, make it into a report
-    proc = subprocess.Popen( args=cmdline, shell=True, cwd=tmp_dir, stderr=open( stderr_name, 'wb' ) )
-    proc.wait()
-    #We don't want to set tool run to error state if only warnings or info, e.g. mfold could be decreased to improve model, but let user view macs log
-    #Do not terminate if error code, allow dataset (e.g. log) creation and cleanup
-    if proc.returncode:
-        stderr_f = open( stderr_name )
-        while True:
-            chunk = stderr_f.read( CHUNK_SIZE )
-            if not chunk:
-                stderr_f.close()
-                break
-            sys.stderr.write( chunk )
-    
-    #=================================================================================
-    #copy files created by macs2 to appripriate directory with the provided names
-    #=================================================================================
+    # Build the MACS 2.1 command line
+    # Initial arguments are always the same: command & input ChIP-seq file name
+    cmdline = ["macs2 %s -t %s" % (sys.argv[1],sys.argv[2])]
 
-    #=================================================================================
-    #move files generated by callpeak command 
-    if (options['command'] == "callpeak"):
-    	#run R to create pdf from model script
-    	if os.path.exists( os.path.join( tmp_dir, "%s_model.r" % experiment_name ) ):
-     	   	cmdline = 'R --vanilla --slave < "%s_model.r" > "%s_model.r.log"' % ( experiment_name, experiment_name )
-     	   	proc = subprocess.Popen( args=cmdline, shell=True, cwd=tmp_dir )
-		proc.wait()
-        
-    	#move bed out to proper output file
-    	created_bed_name =  os.path.join( tmp_dir, "%s_summits.bed" % experiment_name )
-    	if os.path.exists( created_bed_name ):
-        	shutil.move( created_bed_name, output_summits_bed )
-
-    	#OICR peak_xls file
-    	created_peak_xls_file =  os.path.join( tmp_dir, "%s_peaks.xls" % experiment_name )
-    	if os.path.exists( created_peak_xls_file ):
-        	# shutil.copy( created_peak_xls_file, os.path.join ( "/mnt/galaxyData/tmp/", "%s_peaks.xls" % ( os.path.basename(output_extra_path) )))
-		shutil.copyfile( created_peak_xls_file, output_peaks )   
-
-    	#peaks.encodepeaks (narrowpeaks) file
-    	created_narrowpeak_file = os.path.join (tmp_dir, "%s_peaks.narrowPeak" % experiment_name )
-    	if os.path.exists( created_narrowpeak_file ):
-		shutil.move (created_narrowpeak_file, output_narrowpeaks )
-
-        #peaks.broadpeaks file
-    	created_broadpeak_file = os.path.join (tmp_dir, "%s_peaks.broadPeak" % experiment_name )
-    	if os.path.exists( created_broadpeak_file ):
-		shutil.move (created_broadpeak_file, output_broadpeaks )
-
-        #peaks.gappedpeaks file
-    	created_gappedpeak_file = os.path.join (tmp_dir, "%s_peaks.gappedPeak" % experiment_name )
-    	if os.path.exists( created_gappedpeak_file ):
-		shutil.move (created_gappedpeak_file, output_gappedpeaks )
+    # Process remaining args
+    for arg in sys.argv[3:]:
+        if arg.startswith('--format='):
+            # Convert format to uppercase
+            format_ = arg.split('=')[1].upper()
+            cmdline.append("--format=%s" % format_)
+        elif arg.startswith('--name='):
+            # Replace whitespace in name with underscores
+            experiment_name = '_'.join(arg.split('=')[1].split())
+            cmdline.append("--name=%s" % experiment_name)
+        elif arg.startswith('--output-'):
+            # Handle destinations for output files
+            arg0,filen = arg.split('=')
+            if arg0 == '--output-summits':
+                output_summits = filen
+            elif arg0 == '--output-extra-files':
+                output_extra_html = filen
+            elif  arg0 == '--output-extra-files-path':
+                output_extra_path = filen
+            elif  arg0 == '--output-broadpeaks':
+                output_broadpeaks = filen
+            elif  arg0 == '--output-gappedpeaks':
+                output_gappedpeaks = filen
+            elif  arg0 == '--output-narrowpeaks':
+                output_narrowpeaks = filen
+            elif  arg0 == '--output-pileup':
+                output_treat_pileup = filen
+            elif  arg0 == '--output-lambda-bedgraph':
+                output_lambda_bedgraph = filen
+            elif  arg0 == '--output-xls-to-interval':
+                output_xls_to_interval_peaks_file = filen
+            elif  arg0 == '--output-peaks':
+                output_peaks = filen
+        else:
+            # Pass remaining args directly to MACS
+            # command line
+            cmdline.append(arg)
+    
+    cmdline = ' '.join(cmdline)
+    print "Generated command line:\n%s" % cmdline
 
- 	#parse xls files to interval files as needed
-   	#if 'xls_to_interval' in options:
-    	if (options['xls_to_interval'] == "True"):
-        	create_peak_xls_file = os.path.join( tmp_dir, '%s_peaks.xls' % experiment_name )
-        	if os.path.exists( create_peak_xls_file ):
-            		xls_to_interval( create_peak_xls_file, output_xls_to_interval_peaks_file, header = 'peaks file' )
-
-        #bedgraph bedgraph files
-        if (options['bdg']):
-            created_treat_pileup_file = os.path.join (tmp_dir, "%s_treat_pileup.bdg" % experiment_name )
-            if os.path.exists( created_treat_pileup_file ):
-		shutil.move (created_treat_pileup_file, output_treat_pileup )
-            created_lambda_bedgraph_file = os.path.join (tmp_dir, "%s_control_lambda.bdg" % experiment_name )
-            if os.path.exists( created_lambda_bedgraph_file ):
-		shutil.move (created_lambda_bedgraph_file, output_lambda_bedgraph )
+    # Execute MACS2
+    #
+    # Make a working directory
+    working_dir = tempfile.mkdtemp()
+    #
+    # Collect stderr in a file for reporting later
+    stderr_filen = tempfile.NamedTemporaryFile().name
+    #
+    # Run MACS2
+    proc = subprocess.Popen(args=cmdline,shell=True,cwd=working_dir,
+                            stderr=open(stderr_filen,'wb'))
+    proc.wait()
+    
+    # Run R script to create PDF from model script
+    if os.path.exists(os.path.join(working_dir,"%s_model.r" % experiment_name)):
+        cmdline = 'R --vanilla --slave < "%s_model.r" > "%s_model.r.log"' % \
+                  (experiment_name, experiment_name)
+        proc = subprocess.Popen(args=cmdline,shell=True,cwd=working_dir)
+        proc.wait()
 
-    	#move all remaining files to extra files path of html file output to allow user download
-    	out_html = open( output_extra_html, 'wb' )
-    	out_html.write( '<html><head><title>Additional output created by MACS (%s)</title></head><body><h3>Additional Files:</h3><p><ul>\n' % experiment_name )
-    	os.mkdir( output_extra_path )
-    	for filename in sorted( os.listdir( tmp_dir ) ):
-    		shutil.move( os.path.join( tmp_dir, filename ), os.path.join( output_extra_path, filename ) )
-        	out_html.write( '<li><a href="%s">%s</a></li>\n' % ( filename, filename ) )
-		#out_html.write( '<li><a href="%s">%s</a>peakxls %s SomethingDifferent tmp_dir %s path %s exp_name %s</li>\n' % ( created_peak_xls_file, filename, filename, tmp_dir, output_extra_path, experiment_name ) )
-    	out_html.write( '</ul></p>\n' )
-    	out_html.write( '<h3>Messages from MACS:</h3>\n<p><pre>%s</pre></p>\n' % open( stderr_name, 'rb' ).read() )
-    	out_html.write( '</body></html>\n' )
-    	out_html.close()
+    # Convert XLS to interval, if requested
+    if output_xls_to_interval_peaks_file is not None:
+        peaks_xls_file = os.path.join(working_dir,'%s_peaks.xls' % experiment_name )
+        if os.path.exists(peaks_xls_file):
+            convert_xls_to_interval(peaks_xls_file,output_xls_to_interval_peaks_file,
+                                    header='peaks file')
+        
+    # Move MACS2 output files from working dir to their final destinations
+    move_file(working_dir,"%s_summits.bed" % experiment_name,output_summits)
+    move_file(working_dir,"%s_peaks.xls" % experiment_name,output_peaks)
+    move_file(working_dir,"%s_peaks.narrowPeak" % experiment_name,output_narrowpeaks)
+    move_file(working_dir,"%s_peaks.broadPeak" % experiment_name,output_broadpeaks)
+    move_file(working_dir,"%s_peaks.gappedPeak" % experiment_name,output_gappedpeaks)
+    move_file(working_dir,"%s_treat_pileup.bdg" % experiment_name,output_treat_pileup)
+    move_file(working_dir,"%s_control_lambda.bdg" % experiment_name,output_lambda_bedgraph)
+    move_file(working_dir,"bdgcmp_out.bdg",output_bdgcmp)
 
-    #=================================================================================
-    #move files generated by bdgcmp command
-    if (options['command'] == "bdgcmp"):
-    	created_bdgcmp_file = os.path.join (tmp_dir, "bdgcmp_out.bdg" )
-    	if os.path.exists( created_bdgcmp_file ):
-		shutil.move (created_bdgcmp_file, output_bdgcmp )
-     
-    #=================================================================================    
-    #cleanup
-    #=================================================================================    
-    os.unlink( stderr_name )
-    os.rmdir( tmp_dir )
+    # Move remaining file to the 'extra files' path and link from the HTML
+    # file to allow user to access them from within Galaxy
+    html_file = open(output_extra_html,'wb')
+    html_file.write('<html><head><title>Additional output created by MACS (%s)</title></head><body><h3>Additional Files:</h3><p><ul>\n' % experiment_name)
+    # Make the 'extra files' directory
+    os.mkdir(output_extra_path)
+    # Move the files
+    for filen in sorted(os.listdir(working_dir)):
+        shutil.move(os.path.join(working_dir,filen),
+                    os.path.join(output_extra_path,filen))
+        html_file.write( '<li><a href="%s">%s</a></li>\n' % (filen,filen))
+    # All files moved, close out HTML
+    html_file.write( '</ul></p>\n' )
+    # Append any stderr output
+    html_file.write('<h3>Messages from MACS:</h3>\n<p><pre>%s</pre></p>\n' %
+                    open(stderr_filen,'rb').read())
+    html_file.write('</body></html>\n')
+    html_file.close()
 
-if __name__ == "__main__": main()
+    # Clean up the working directory and files
+    os.unlink(stderr_filen)
+    os.rmdir(working_dir)
--- a/macs21_wrapper.xml	Wed Jan 21 11:07:37 2015 -0500
+++ b/macs21_wrapper.xml	Thu Jan 29 11:11:21 2015 -0500
@@ -1,25 +1,115 @@
-<tool id="fls_modencode_peakcalling_macs2.1" name="MACS2.1.0" version="2">
+<tool id="macs2_1_peakcalling" name="MACS2.1.0" version="2.1.0-1">
   <requirements>
     <requirement type="package" version="2.7">python</requirement>
     <requirement type="package" version="1.8.1">numpy</requirement>
     <requirement type="package" version="2.1.0.20140616">macs2</requirement>
   </requirements>
-  <description>Model-based Analysis of ChIP-Seq [golem]</description>
-  <command interpreter="python">macs21_wrapper.py $options_file $outputs_file</command>
+  <description>Model-based Analysis of ChIP-Seq</description>
+  <command interpreter="python">
+    macs21_wrapper.py
+    ##
+    ## Major command
+    $major_command.major_command_selector
+    ##
+    ## ChIP-seq input
+    $major_command.input_chipseq_file1
+    ##
+    ## ChIP-seq control
+    #if str($major_command.input_control_file1) != 'None'
+       -c $major_command.input_control_file1
+    #end if
+    ##
+    ## Call peaks
+    #if str($major_command.major_command_selector) == 'callpeak'
+       --format=$major_command.input_chipseq_file1.extension
+       --name="$experiment_name"
+       --bw=$major_command.bw
+       ##
+       ## Genome size
+       #if str($major_command.genome_size.gsize) == ''
+	  --gsize=$major_command.genome_size.user_defined_gsize
+       #else:
+          --gsize=$major_command.genome_size.gsize
+       #end if
+       ##
+       ## Broad peaks
+       #if str($major_command.broad_options.broad_regions) == 'broad'
+          --broad --broad-cutoff=$major_command.broad_options.broad_cutoff
+       #end if
+       ##
+       ## (no)model options
+       #if str($major_command.nomodel_type.nomodel_type_selector) == 'nomodel'
+          --nomodel --extsize=$major_command.nomodel_type.extsize
+       #end if
+       ##
+       ## pq value select options
+       #if str($major_command.pq_options.pq_options_selector) == 'qvalue'
+          --qvalue=$major_command.pq_options.qvalue
+       #else
+          --pvalue=$major_command.pq_options.pvalue
+       #end if
+       ##
+       ## Advanced options
+       #if str($major_command.advanced_options.advanced_options_selector) == 'on'
+          --mfold $major_command.advanced_options.mfoldlo $major_command.advanced_options.mfoldhi
+          $major_command.advanced_options.nolambda
+	  #if $major_command.bdg_options.bdg == True
+             -B $major_command.bdg_options.spmr
+	  #end if
+          $major_command.advanced_options.call_summits
+          #if str($major_command.advanced_options.keep_duplicates.keep_dup) == ''
+             --keep-dup $major_command.advanced_options.keep_duplicates.maximum_tags
+          #else
+             --keep-dup $major_command.advanced_options.keep_duplicates.keep_dup
+          #end if
+       #else
+          ## Defaults if advanced options not set
+          --mfold 5 50 --keep-dup 1
+       #end if
+       ##
+       ## Output files
+       --output-summits=$output_summits_bed_file
+       --output-extra-files=$output_extra_files
+       --output-extra-files-path=$output_extra_files.files_path
+       ##
+       ## Narrow/broad peak outputs
+       #if str($major_command.broad_options.broad_regions) == 'broad'
+          --output-broadpeaks=$output_broadpeaks_file
+          --output-gappedpeaks=$output_gappedpeaks_file
+       #else
+          --output-narrowpeaks=$output_narrowpeaks_file
+       #end if
+       ##
+       ## Bedgraph outputs
+       #if str($major_command.bdg_options.bdg) == 'True'
+          --output-pileup $output_treat_pileup_file 
+          --output-lambda-bedgraph=$output_lambda_bedgraph_file
+       #end if
+       ##
+       ## XLS/interval output
+       #if str($major_command.xls_to_interval) == 'True'
+          --output-xls-to-interval=$output_xls_to_interval_peaks_file
+       #else
+          --output-peaks=$output_peaks_file
+       #end if
+    #end if
+    ##
+    ## Compare .bdg files
+    #if str($major_command.major_command_selector) == 'bdgcmp'
+       -m $major_command.bdgcmp_options.bdgcmp_options_selector
+       -p $major_command.pseudocount
+       --output-bdgcmp $output_bdgcmp_file
+    #end if
+  </command>
   <inputs>
-    <!--experiment name and option of selecting paired or single end will always be present-->
+    <!--experiment name used as base for output file names -->
     <param name="experiment_name" type="text" value="MACS2.1.0 in Galaxy" size="50"
 	   label="Experiment Name"/>
-    <!--select one of the 7 major commands offered by macs2-->
+    <!--select a major MACS2 command-->
     <conditional name="major_command">
       <param name="major_command_selector" type="select" label="Select action to be performed">
 	<option value="callpeak">Peak Calling</option>
-	<!--<option value="filterdup">filterdup</option>
-	<option value="randsample">randsample</option>-->
 	<option value="bdgcmp">Compare .bdg Files</option>
-	<!--<option value="bdgdiff">bdgdiff</option>
-	<option value="bdgpeakcall">bdgpeakcall</option>
-	<option value="bdgbroadcall">bdgbroadcall</option>-->
       </param>
       <!--callpeak option of macs2-->
       <when value="callpeak">
@@ -36,7 +126,6 @@
 		   value="0.1" help="default: 0.1 (--broad-cutoff)"/>
 	  </when>
 	</conditional>
-	<!--may need to add a few more formats at later time-->
         <param name="input_chipseq_file1" type="data" format="bed,sam,bam"
 	       label="ChIP-seq read file" />
         <param name="input_control_file1" type="data" format="bed,sam,bam" optional="True"
@@ -217,123 +306,6 @@
       <filter>major_command['major_command_selector'] == 'bdgcmp'</filter>
     </data>
   </outputs>
-  <configfiles>
-    <configfile name="outputs_file">&lt;%
-import simplejson
-%&gt;
-##=======================================================================================
-#set $__outputs = { 'command':str( $major_command.major_command_selector ) }
-#if str( $major_command.major_command_selector ) == 'callpeak':
-	#set $__outputs['output_summits_bed_file'] = str( $output_summits_bed_file )
-	#set $__outputs['output_extra_file'] = str( $output_extra_files )
-	#set $__outputs['output_extra_file_path'] = str( $output_extra_files.files_path )
-	#set $__outputs['output_peaks_file'] = str( $output_peaks_file )
-	#set $__outputs['output_narrowpeaks_file'] = str( $output_narrowpeaks_file )
-	#set $__outputs['output_broadpeaks_file'] = str( $output_broadpeaks_file )
-	#set $__outputs['output_gappedpeaks_file'] = str( $output_gappedpeaks_file )
-	#set $__outputs['output_xls_to_interval_peaks_file'] = str( $output_xls_to_interval_peaks_file )
-	#set $__outputs['output_treat_pileup_file'] = str( $output_treat_pileup_file )
-	#set $__outputs['output_lambda_bedgraph_file'] = str( $output_lambda_bedgraph_file )
-#end if
-##=======================================================================================
-#if str( $major_command.major_command_selector ) == 'bdgcmp':
-	#set $__outputs['output_bdgcmp_file'] = str( $output_bdgcmp_file )
-#end if
-
-${ simplejson.dumps( __outputs ) }
-    </configfile>
-    <configfile name="options_file">&lt;%
-import simplejson
-%&gt;
-##=======================================================================================
-#set $__options = { 'experiment_name':str( $experiment_name ) }
-##treatment/tag input files and format
-#set $__options['input_chipseq'] = [ str( $major_command.input_chipseq_file1 ) ]
-#set $__options['format'] = $major_command.input_chipseq_file1.extension.upper()
-
-##control/input files
-#set $__options['input_control'] = []
-#if str( $major_command.input_control_file1 ) != 'None':
-	#set $_hole = __options['input_control'].append( str( $major_command.input_control_file1 ) )
-#end if
-
-#if str( $major_command.major_command_selector ) == 'callpeak':
-	#set $__options['command'] = str( "callpeak" )
-	#set $__options['bw'] = str( $major_command.bw )
-	#set $__options['xls_to_interval'] = str( $major_command.xls_to_interval )
-
-	##bdg options
-	#if $major_command.bdg_options.bdg == True:
-		#set $__options['bdg'] = str( "-B" )
-		#set $__options['spmr'] = str( $major_command.bdg_options.spmr )
-	#else:
-		#set $__options['bdg'] = str( "" )
-		#set $__options['spmr'] = str( "" )
-	#end if
-
-	##broad_options
-	#if str( $major_command.broad_options.broad_regions ) == 'broad':
-		#set $__options['broad'] = str( $major_command.broad_options.broad_regions )
-		#set $__options['broad_cutoff'] = str( $major_command.broad_options.broad_cutoff )
-	#else:
-		#set $__options['broad'] = str( "" )
-		#set $__options['broad_cutoff'] = str( "" )
-	#end if
-
-	##genome sizes
-	#if str( $major_command.genome_size.gsize ) == '':
-		#set $__options['gsize'] = int( $major_command.genome_size.user_defined_gsize )
-	#else:
-		#set $__options['gsize'] = str( $major_command.genome_size.gsize )
-	#end if
-
-	##advanced options
-	#if str( $major_command.advanced_options.advanced_options_selector ) == 'on':
-		#set $__options['mfoldlo'] = int( $major_command.advanced_options.mfoldlo )
-		#set $__options['mfoldhi'] = int( $major_command.advanced_options.mfoldhi )
-		#set $__options['nolambda'] = str( $major_command.advanced_options.nolambda )
-		#set $__options['call_summits'] = str( $major_command.advanced_options.call_summits )
-		#if str( $major_command.advanced_options.keep_duplicates.keep_dup ) == '':
-			#set $__options['keep_dup'] = int( $major_command.advanced_options.keep_duplicates.maximum_tags )
-		#else:
-			#set $__options['keep_dup'] = str( $major_command.advanced_options.keep_duplicates.keep_dup )
-		#end if
-	#else:
-		#set $__options['mfoldlo'] = int( "5" )
-		#set $__options['mfoldhi'] = int( "50" )
-		#set $__options['nolambda'] = str( "" )
-		#set $__options['call_summits'] = str( "" )
-		#set $__options['keep_dup'] = int( "1" )
-	#end if
-
-	##enable xls file options
-	##if str( $major_command.xls_to_interval ) == 'create':
-		##set $__options['xls_to_interval'] = { 'peaks_file': str( $output_xls_to_interval_peaks_file ), 'negative_peaks_file': str( $output_xls_to_interval_negative_peaks_file ) }
-	##end if
-	
-	##pq value select options
-	#if str( $major_command.pq_options.pq_options_selector ) == 'qvalue':
-		#set $__options['qvalue'] = str( $major_command.pq_options.qvalue )
-	#else:
-		#set $__options['pvalue'] = str( $major_command.pq_options.pvalue )
-	#end if
-	
-	##model options
-	#if str( $major_command.nomodel_type.nomodel_type_selector ) == 'nomodel':
-		#set $__options['nomodel'] = str( $major_command.nomodel_type.extsize )
-	#end if
-#end if
-##=======================================================================================
-#if str( $major_command.major_command_selector ) == 'bdgcmp':
-	#set $__options['command'] = str( "bdgcmp" )
-	#set $__options['pseudocount'] = float( str( $major_command.pseudocount ) )
-	#set $__options['m'] = str( $major_command.bdgcmp_options.bdgcmp_options_selector )
-#end if
-##=======================================================================================
-
-${ simplejson.dumps( __options ) }
-    </configfile>
-  </configfiles>
   <tests>
 	<!--none yet for macs2-->
   </tests>
--- a/tool_dependencies.xml	Wed Jan 21 11:07:37 2015 -0500
+++ b/tool_dependencies.xml	Thu Jan 29 11:11:21 2015 -0500
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <tool_dependency>
   <package name="python" version="2.7">
-    <repository changeset_revision="74d009a2a4cb" name="package_python_2_7" owner="iuc" prior_installation_required="True" toolshed="https://testtoolshed.g2.bx.psu.edu" />
+    <repository changeset_revision="2c52c900e56a" name="package_python_2_7" owner="iuc" prior_installation_required="True" toolshed="https://testtoolshed.g2.bx.psu.edu" />
   </package>
   <package name="numpy" version="1.8.1">
     <repository changeset_revision="0f9f634dec8a" name="package_numpy_1_8" owner="iuc" prior_installation_required="True" toolshed="https://testtoolshed.g2.bx.psu.edu" />
@@ -11,7 +11,7 @@
             <actions>
               <action type="download_by_url">https://pypi.python.org/packages/source/M/MACS2/MACS2-2.1.0.20140616.tar.gz</action>
               <action type="set_environment_for_install">
-		<repository changeset_revision="74d009a2a4cb" name="package_python_2_7" owner="iuc" toolshed="https://testtoolshed.g2.bx.psu.edu">
+		<repository changeset_revision="2c52c900e56a" name="package_python_2_7" owner="iuc" toolshed="https://testtoolshed.g2.bx.psu.edu">
 		  <package name="python" version="2.7" />
 		</repository>
 		<repository changeset_revision="0f9f634dec8a" name="package_numpy_1_8" owner="iuc" toolshed="https://testtoolshed.g2.bx.psu.edu">