comparison beagle4.py @ 4:b970ba62539e draft default tip

Updated beagle4.py to output uncompressed VCF files - had been outputting VCF.GZ
author bobbledavidson
date Wed, 16 Sep 2015 05:58:13 -0400
parents c36b11eab590
children
comparison
equal deleted inserted replaced
3:9e8de4ce2a3c 4:b970ba62539e
1 import os 1 import os
2 import optparse 2 import optparse
3 import tempfile 3 import tempfile
4 import shutil 4 import shutil
5 from subprocess import call 5 from subprocess import call
6 import gzip
6 7
7 def main(): 8 def main():
8 9
9 parser = optparse.OptionParser() 10 parser = optparse.OptionParser()
10 parser.add_option('--jar', dest='jarfile', default=None) 11 parser.add_option('--jar', dest='jarfile', default=None)
32 call(['java', '-Xmx2g', '-jar', options.jarfile, 'ref='+options.ref, options.gtgl+'='+options.gfile, 'phase-its='+options.phits,'impute-its='+options.impits , 'out='+outdir+'/'+outprefix ]) 33 call(['java', '-Xmx2g', '-jar', options.jarfile, 'ref='+options.ref, options.gtgl+'='+options.gfile, 'phase-its='+options.phits,'impute-its='+options.impits , 'out='+outdir+'/'+outprefix ])
33 else: 34 else:
34 call(['java', '-Xmx2g', '-jar', options.jarfile, options.gtgl+'='+options.gfile,'phase-its='+options.phits, 'impute-its='+options.impits , 'out='+outdir+'/'+outprefix ]) 35 call(['java', '-Xmx2g', '-jar', options.jarfile, options.gtgl+'='+options.gfile,'phase-its='+options.phits, 'impute-its='+options.impits , 'out='+outdir+'/'+outprefix ])
35 36
36 37
37 shutil.move(outdir+'/'+outprefix+'.vcf.gz',options.outfile) 38 #shutil.move(outdir+'/'+outprefix+'.vcf.gz',options.outfile)
39 #shutil.rmtree(outdir)
40 with gzip.open(outdir+os.sep+outprefix+'.vcf.gz','rb') as gzinfile:
41 with open(options.outfile,'w') as vcfoutfile:
42 for line in gzinfile:
43 vcfoutfile.write(line)
44
38 shutil.rmtree(outdir) 45 shutil.rmtree(outdir)
39
40 46
41 47
42 if __name__=='__main__': 48 if __name__=='__main__':
43 main() 49 main()
44 50