diff 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
line wrap: on
line diff
--- a/beagle4.py	Wed Jul 08 11:08:07 2015 -0400
+++ b/beagle4.py	Wed Sep 16 05:58:13 2015 -0400
@@ -3,6 +3,7 @@
 import tempfile
 import shutil
 from subprocess import call
+import gzip 
 
 def main():
   
@@ -34,11 +35,16 @@
     	call(['java', '-Xmx2g', '-jar', options.jarfile, options.gtgl+'='+options.gfile,'phase-its='+options.phits, 'impute-its='+options.impits , 'out='+outdir+'/'+outprefix ])
    
 
-    shutil.move(outdir+'/'+outprefix+'.vcf.gz',options.outfile)
+    #shutil.move(outdir+'/'+outprefix+'.vcf.gz',options.outfile)
+    #shutil.rmtree(outdir)
+    with gzip.open(outdir+os.sep+outprefix+'.vcf.gz','rb') as gzinfile:
+        with open(options.outfile,'w') as vcfoutfile:
+            for line in gzinfile:
+                vcfoutfile.write(line)
+
     shutil.rmtree(outdir)
 
 
-
 if __name__=='__main__':
     main()