Hello

I have a .ffn file having 1000 sequences. I wanted to check whether all the fasta headers have sequence underneath them, and it would be great if I also get to know about the fasta headers which do not have sequences underneath them.

Thanks
BioPython is ideal for this.

    from Bio import SeqIO
    
    records=list(SeqIO.parse("your_file.fasta","fasta"))
    for record in records:
        if len(record.seq)==0:
            print(record.id)

This will give you ids of headers without any sequences.