Mercurial > repos > jeremie > breakdancer_test
comparison breakdancer.py @ 19:87a6ec1e2400 draft
Uploaded
author | jeremie |
---|---|
date | Tue, 01 Jul 2014 09:34:51 -0400 |
parents | 0fb455068d3c |
children | 199c0c7d3093 |
comparison
equal
deleted
inserted
replaced
18:d26b184866b4 | 19:87a6ec1e2400 |
---|---|
12 | 12 |
13 tmp_dir = tempfile.mkdtemp() | 13 tmp_dir = tempfile.mkdtemp() |
14 errorFile = tmp_dir+"/errorLog" | 14 errorFile = tmp_dir+"/errorLog" |
15 | 15 |
16 currentDir = os.path.dirname(os.path.abspath(__file__)) | 16 currentDir = os.path.dirname(os.path.abspath(__file__)) |
17 bam2cfg_path = currentDir+"/bam2cfg.pl" | 17 bam2cfg = "./bam2cfg.pl" |
18 # breakdancer_path = "/usr/bin/breakdancer-max" | 18 # breakdancer = "/usr/bin/breakdancer-max" |
19 breakdancer_path = "breakdancer-max" | 19 breakdancer = "breakdancer-max" |
20 breakdancer2vcf_path = currentDir+"/breakdancer2vcf.py" | 20 breakdancer2vcf = "./breakdancer2vcf.py" |
21 | 21 |
22 | 22 |
23 def bam2cfg(args): | 23 def bam2cfg(args): |
24 config = tmp_dir+"/breakdancer_config" | 24 config = tmp_dir+"/breakdancer_config" |
25 cmd = 'perl %s %s' % (bam2cfg_path, args.input_bam) | 25 cmd = 'perl %s %s' % (bam2cfg, args.input_bam) |
26 execute(cmd, output=config) | 26 execute(cmd, output=config) |
27 print ("\ncmd = %s \n" ) %(cmd) | 27 print ("\ncmd = %s \n" ) %(cmd) |
28 return config | 28 return config |
29 | 29 |
30 | 30 |
31 def breakdancer(args, config): | 31 def breakdancer(args, config): |
32 cmd = '%s %s' % (breakdancer_path, config) | 32 cmd = '%s %s' % (breakdancer, config) |
33 execute(cmd, output=args.output_raw) | 33 execute(cmd, output=args.output_raw) |
34 | 34 |
35 | 35 |
36 def breakdancer2vcf(args): | 36 def breakdancer2vcf(args): |
37 cmd = "python %s -i %s -o %s" % ( breakdancer2vcf_path, args.output_raw, args.output_vcf ) | 37 cmd = "python %s -i %s -o %s" % ( breakdancer2vcf, args.output_raw, args.output_vcf ) |
38 execute(cmd) | 38 execute(cmd) |
39 | 39 |
40 | 40 |
41 def execute( cmd, output="" ): | 41 def execute( cmd, output="" ): |
42 try: | 42 try: |