python21

作者: rong酱 | 来源:发表于2021-12-24 14:52 被阅读0次
#!/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)

相关文章

网友评论

      本文标题:python21

      本文链接:https://www.haomeiwen.com/subject/yyilqrtx.html