import sys
infile = sys.argv[1]
outfile = sys.argv[2]
gff_list = []
fh = open(infile)
for x in fh:
if x[0] == '#': continue
y = x.strip().split('\t')
gff_list.append(y)
gff_list.sort(key=lambda a:int(a[3]))
gff_list.sort(key=lambda a:a[0])
fh = open(outfile,'w')
for x in gff_list:
fh.write("\t".join(x) + "\n")
转载于:https://www.cnblogs.com/xlai/p/6569403.html