Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Header remover
import argparse
from Bio import SeqIO
parser=argparse.ArgumentParser()
parser.add_argument("inputFile", help="input fasta file")
parser.add_argument("outputFile",help="output file name")
parser.add_argument("sampleName",help="sample name to be removed")
args = parser.parse_args()
fileOut = open(args.outputFile, "w")
if args.sampleName:
for seq_record in SeqIO.parse(args.inputFile, "fasta"):
if not (args.sampleName in seq_record.id):
SeqIO.write(seq_record,args.input_file,"fasta")
fileOut.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.