Hi I am trying to learnt python3 and Biopython,
I am trying to check imported fasta file before processing so far using:
sequences = SeqIO.parse("fake_fasta_file", "fasta")
if not any(sequa):
print('\n SOMETHING IS WRONG WITH YOUR INPUT FILE \n')
exit()
works but as soon as I enter a '>' in my fake_fasta_file , as an example
nihvivicòvo-l
,mnjobùJN
, Békibpç
, mnkn
nbigp
ù
mlkn
mlnù
> ftfyfiuuogpigèi
any(sequences) returns True even if:
for seq_record in sequences:
print(seq_record)
doesnt print anything
Any better way to check for real fasta file in Biopython ?
Or maybe it my fault using any() on the iterator instead of creating
a list of seq_record and checking on that ?