How to remove duplicates from a fasta file using python
from Bio import SeqIO
import sys
import re 

unique = []
fasta_file = (sys.argv[1])
for myfile in SeqIO.parse(fasta_file, &quot;fasta&quot;):
    if len(myfile) &gt; 250:
        gene_id = myfile.id
        if gene.id not in unique:
            unique.append(gene.id)
            mylist = re.match(r&quot;H149xcV_[^\W_]+_[^\W_]+_[^\W_])_[^\W_]+&quot;, gene_id)
            print (&quot;&gt;&quot;+mylist.group(1)) 

```