Parsing fasta file using seqIO
2
0
Entering edit mode
7.1 years ago

How to check if a multiple sequence file is in fasta format while parsing using seqIO

sequence biopython Fasta parsing • 2.6k views
ADD COMMENT
0
Entering edit mode

Hello

I have a multiple sequence file in fasta format.I am trying to parse sequences in python. All I need to check is the presence of '>' before every sequence. While this can be easily executed otherwise, I was hoping there would be a simpler option using SeqIO.parse. For now, if the sequences are not preceded by '>', I do not get any parsed output. thanks!

ADD REPLY
1
Entering edit mode

Please use ADD COMMENT or ADD REPLY to answer to previous reactions, as such this thread remains logically structured and easy to follow. I have now moved your post but as you can see it's not optimal. Adding an answer should only be used for providing a solution to the question asked.

ADD REPLY
0
Entering edit mode

BioPerl's SeqIO? Biopython's SeqIO? Some other seqIO? (Only clear from the tags you've added)

ADD REPLY
2
Entering edit mode
7.1 years ago
Joe 21k

You can’t really use SeqIO to check if the sequences are in fasta format, since SeqIO requires you to tell it that information when you read a file in (other than assuming its a FASTA, and waiting for it to fail if it isn’t).

ADD COMMENT
0
Entering edit mode
7.1 years ago
Hussain Ather ▴ 990

It looks like this question has been asked before. Here's a response in Perl A: Check If A File Is In Fasta Format

ADD COMMENT

Login before adding your answer.

Traffic: 2491 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6