changeset 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 9e8de4ce2a3c
children
files beagle4.py
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
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()