splitname

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)