step1:将fasta均分为N个文件,每个文件序列数目相等
参考这篇文章:https://blog.csdn.net/whiteof/article/details/123685985
输出结果中每条序列格式均为:id:squence
step2:调整输出fasta格式,将id和sequence分行
import sys
infile, outfile = sys.argv[1], sys.argv[2]
def change_fasta(infa, outfile):
outf = open(outfile, "w")
faf = open(infa, "r")
f = faf.readlines()
for line in f:
newline = line.replace(':', '\n')
outf.write(newline)
change_fasta(infile, outfile)
网友评论