import os import re import argparse import subprocess
parser = argparse.ArgumentParser(description="You should add those parameters") parser.add_argument("-i","--input", type = str, help = "The input fasta file") parser.add_argument("-o","--output", type = str, help = "The output fasta file") #args = parser.parse_args() args =parser.parse_known_args()[0]
# 输入的fasta文件转换成字典 file_open = open(args.input,"r") file_read = file_open.readlines() file_new = open(args.output,"w") for line in file_read: if"*"in line: line = line.replace("*","") + "\n" else: line = line line = line.replace(">","\n>") file_new.write(line)