Modified to work with MT containing VCFs.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3910 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
chartl 2010-07-30 14:59:59 +00:00
parent 6d91cd587e
commit f20cdbe60a
1 changed files with 9 additions and 4 deletions

View File

@ -1,5 +1,5 @@
from farm_commands2 import *
import os.path
import os
import sys
from optparse import OptionParser
from datetime import date
@ -24,15 +24,20 @@ def main():
b36vcf, hg18vcf = args
out = open(hg18vcf, 'w')
temp = open("tmp", 'w')
mitotemp = open("mtmp",'w')
for line in open(b36vcf):
length = len(line)
if length > 2 and line[0] != '#':
if line[0:2] == 'MT':
sys.exit('Cannot convert MT containing VCFs, sorry')
spline = line.split("\t")
spline[0] = "chrM"
mitotemp.write("\t".join(spline))
line = 'chr' + line
out.write(line)
temp.write(line)
out.close()
mitotemp.close()
os.system("cat mtmp tmp > "+hg18vcf+" ; rm mtmp ; rm tmp")
if __name__ == "__main__":
main()