I want to print sequences form fasta file which do not have non-canonical nucleotides. Example fasta is:
>1 ATAcctcatctaGTGTG ATGCTGCTAGTZ >2 agagagagagagagag
My code is
from Bio import SeqIO for record in SeqIO.parse("test.fasta", "fasta") : if set(record.seq) <= "ATCGatcg": print record
Instead of print the sequence of
>2, it prints both.
What am I doing wrong? Thanks