Be smart about the headers.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3912 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
chartl 2010-07-30 16:11:16 +00:00
parent eeb767a012
commit 6dcb63888d
1 changed files with 11 additions and 7 deletions

View File

@ -28,13 +28,17 @@ def main():
mitotemp = open("mtmp",'w') mitotemp = open("mtmp",'w')
for line in open(b36vcf): for line in open(b36vcf):
length = len(line) length = len(line)
if length > 2 and line[0] != '#': if length > 2 :
if line[0:2] == 'MT': if line[0:2] == 'MT' or line[0] == "#":
spline = line.split("\t") if line[0] == "#":
spline[0] = "chrM" mitotemp.write(line)
mitotemp.write("\t".join(spline)) else:
line = 'chr' + line spline = line.split("\t")
temp.write(line) spline[0] = "chrM"
mitotemp.write("\t".join(spline))
else:
line = 'chr' + line
temp.write(line)
temp.close() temp.close()
mitotemp.close() mitotemp.close()
os.system("cat mtmp tmp > "+hg18vcf+" ; rm mtmp ; rm tmp") os.system("cat mtmp tmp > "+hg18vcf+" ; rm mtmp ; rm tmp")