#!/usr/bin/env python
sifa=open('he.fa','w')
with open('he.vcf','r') as si:
sil=si.readlines()
for sili in sil:
#print(sili)
linecon=""
silin=sili.strip().split("\t")
chrnum=silin[0]
pos=silin[1]
seque=silin[4]
info=silin[7]
infocon=info.strip().split(";")
#print(infocon)
for infoconi in infocon:
if "SVLEN" in infoconi:
infocont=infoconi.strip().split("=")
#print(infocont)
infocontprex=infocont[0]
infocont_con=infocont[1]
if str(infocontprex)=="SVLEN":
lenght=infocont_con
linecon=">"+chrnum+"_"+pos+"_"+lenght+"\n"+seque+"\n"
sifa.write(linecon)
网友评论