comparison macs2_wrapper.py @ 20:db2805f9df66 draft

Replace simplejson with json.
author stemcellcommons
date Wed, 09 Apr 2014 18:06:03 -0400
parents 49777e347e25
children eed6c8dcef5d
comparison
equal deleted inserted replaced
19:e9c2c7d24e4e 20:db2805f9df66
1 #purpose: macs2 python wrapper 1 # macs2 python wrapper
2 #author: Ziru Zhou 2 # based on http://toolshed.g2.bx.psu.edu/view/modencode-dcc/macs2
3 #date: November, 2012
4 3
5 import sys, subprocess, tempfile, shutil, glob, os, os.path, gzip 4 import sys, subprocess, tempfile, shutil, glob, os, os.path, gzip
6 from galaxy import eggs 5 from galaxy import eggs
7 import pkg_resources 6 import json
8 pkg_resources.require( "simplejson" )
9 import simplejson
10 7
11 CHUNK_SIZE = 1024 8 CHUNK_SIZE = 1024
12 9
13 #========================================================================================== 10 #==========================================================================================
14 #functions 11 #functions
55 #========================================================================================== 52 #==========================================================================================
56 #main 53 #main
57 #========================================================================================== 54 #==========================================================================================
58 def main(): 55 def main():
59 #take in options file and output file names 56 #take in options file and output file names
60 options = simplejson.load( open( sys.argv[1] ) ) 57 options = json.load( open( sys.argv[1] ) )
61 outputs = simplejson.load( open( sys.argv[2] ) ) 58 outputs = json.load( open( sys.argv[2] ) )
62 59
63 #================================================================================= 60 #=================================================================================
64 #parse options and execute macs2 61 #parse options and execute macs2
65 #================================================================================= 62 #=================================================================================
66 #default inputs that are in every major command 63 #default inputs that are in every major command