comparison bamedit.py @ 13:1ceeba7b95a4 draft

Uploaded
author modencode-dcc
date Mon, 21 Jan 2013 13:33:01 -0500
parents 34450ff137d3
children
comparison
equal deleted inserted replaced
12:7a51d316635a 13:1ceeba7b95a4
10 10
11 CHUNK_SIZE = 1024 11 CHUNK_SIZE = 1024
12 12
13 def main(): 13 def main():
14 options = simplejson.load( open( sys.argv[1] ) ) 14 options = simplejson.load( open( sys.argv[1] ) )
15 script_path = sys.argv[2]
15 16
16 #experiment_name = '_'.join( options['bamout'] ) 17 #experiment_name = '_'.join( options['bamout'] )
17 18
18 if(options['action'] == "merge"): 19 if(options['action'] == "merge"):
19 cmdline = "samtools merge %s %s %s" % ( options['bamout'], options['input1'], options['input2'] ) 20 cmdline = "samtools merge %s %s %s" % ( options['bamout'], options['input1'], options['input2'] )
20 if('input3' in options): 21 if('input3' in options):
21 cmdline = "samtools merge %s %s %s %s" % ( options['bamout'], options['input1'], options['input2'], options['input3'] ) 22 cmdline = "samtools merge %s %s %s %s" % ( options['bamout'], options['input1'], options['input2'], options['input3'] )
22 elif (options['action'] == "split"): 23 elif (options['action'] == "split"):
23 cmdline = "bash /mnt/galaxyTools/galaxy-central/tools/modENCODE_DCC_tools/bamedit/split.sh %s %s %s" % ( options['bamout'], options['bamout2'], options['input1'] ) 24 cmdline = "bash %s/split.sh %s %s %s" % ( script_path, options['bamout'], options['bamout2'], options['input1'] )
24 elif (options['action'] == "pileup"): 25 elif (options['action'] == "pileup"):
25 cmdline = "perl /mnt/galaxyTools/galaxy-central/tools/modENCODE_DCC_tools/bamedit/pileup.pl %s %s %s %s %s" % ( options['input1'], options['input2'], options['bamout'], options['bamname'], options['refname'] ) 26 cmdline = "perl %s/pileup.pl %s %s %s %s %s" % ( script_path, options['input1'], options['input2'], options['bamout'], options['bamname'], options['refname'] )
26 elif (options['action'] == "filter"): 27 elif (options['action'] == "filter"):
27 cmdline = "samtools view -q %s %s -bo %s" % ( options['quality'], options['input1'], options['bamout'] ) 28 cmdline = "samtools view -q %s %s -bo %s" % ( options['quality'], options['input1'], options['bamout'] )
28 29
29 #create tempdir for output files and stderr reports 30 #create tempdir for output files and stderr reports
30 tmp_dir = tempfile.mkdtemp() 31 tmp_dir = tempfile.mkdtemp()