splitname

作者: 生信小白2018 | 来源:发表于2019-08-07 14:12 被阅读0次

    GSVIVT01000001001 pacid=17816625 transcript=GSVIVT01000001001 locus=GSVIVG01000001001 ID=GSVIVT01000001001.Genoscope12X annot-version=Genoscope.12X
    变为
    GSVIVT01000001001

    ##splitname.py for python2
    #!/usr/lib/python
    #-*- coding:utf-8 --*-
    
    import sys, os
    def splitname(infile, outfile):
            ini = open(infile, 'r')
            out = open(outfile, 'w')
    
            for line in ini:
                    if line[0]=='>':
                            lineL=line.split(' ')
                            print >>out, lineL[0]
                    else:
                            print >>out, line.strip()
    if __name__=="__main__":
            infile = sys.argv[1]
            outfile = sys.argv[2]
            splitname(infile, outfile)
    

    相关文章

      网友评论

          本文标题:splitname

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