Skip to content
Snippets Groups Projects
Commit 42db360f authored by MORICE Jérôme's avatar MORICE Jérôme
Browse files

commit

parent 9da04dbc
No related branches found
No related tags found
No related merge requests found
import argparse
import os, sys
import re
from Bio import SeqIO
# Construct the argument parser
ap = argparse.ArgumentParser()
# Add the arguments to the parser
ap.add_argument("-f", "--file", required=False, help="name of the file")
args = vars(ap.parse_args())
for record in SeqIO.parse(args['file'], "fasta"):
record.description=''
if ((record.seq[-1]=='.') or (record.seq[-1] == '*')):
record.seq=record.seq[:-1]
if ('.' in record.seq):
print(record.id + "Invalid seq : " + record.seq, file=sys.stderr)
else :
SeqIO.write(record, sys.stdout, "fasta")
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment