comparison breakdancer.py @ 21:199c0c7d3093 draft

Uploaded
author jeremie
date Tue, 01 Jul 2014 10:09:33 -0400
parents 87a6ec1e2400
children b4f641515363
comparison
equal deleted inserted replaced
20:b122ca66efc7 21:199c0c7d3093
3 import argparse, optparse, os, shutil, subprocess, sys, tempfile, shlex, time 3 import argparse, optparse, os, shutil, subprocess, sys, tempfile, shlex, time
4 4
5 5
6 parser = argparse.ArgumentParser(description='') 6 parser = argparse.ArgumentParser(description='')
7 7
8 parser.add_argument('-x', dest='binPath')
8 parser.add_argument ( '-i1', dest='input_bam', help='the bam input file' ) 9 parser.add_argument ( '-i1', dest='input_bam', help='the bam input file' )
9 parser.add_argument ( '-o1', dest='output_raw', help='the output file' ) 10 parser.add_argument ( '-o1', dest='output_raw', help='the output file' )
10 parser.add_argument ( '-o2', dest='output_vcf', help='the output file' ) 11 parser.add_argument ( '-o2', dest='output_vcf', help='the output file' )
11 12
12 13
13 tmp_dir = tempfile.mkdtemp() 14 tmp_dir = tempfile.mkdtemp()
14 errorFile = tmp_dir+"/errorLog" 15 errorFile = tmp_dir+"/errorLog"
15 16
16 currentDir = os.path.dirname(os.path.abspath(__file__)) 17 currentDir = os.path.dirname(os.path.abspath(__file__))
17 bam2cfg = "./bam2cfg.pl" 18
18 # breakdancer = "/usr/bin/breakdancer-max" 19 binPath = args.binPath
19 breakdancer = "breakdancer-max" 20 bam2cfg = binPath+"/bam2cfg.pl"
20 breakdancer2vcf = "./breakdancer2vcf.py" 21 breakdancer = binPath+"/breakdancer-max"
22 breakdancer2vcf = binPath+"/breakdancer2vcf.py"
21 23
22 24
23 def bam2cfg(args): 25 def bam2cfg(args):
24 config = tmp_dir+"/breakdancer_config" 26 config = tmp_dir+"/breakdancer_config"
25 cmd = 'perl %s %s' % (bam2cfg, args.input_bam) 27 cmd = 'perl %s %s' % (bam2cfg, args.input_bam)