Biopython error message: Protein FASTA provided for nucleotide sequence
1
0
Entering edit mode
7.2 years ago
biotim • 0

Hi, everyone!

Apologies for the simplistic question, but I'm just getting started with Biopython, and I'm having a lot of trouble using qblast() to blast a text file of DNA sequences in FASTA format. The relevant bit of my code is:

"fastaFile = open("all targets.txt", "r")

resultHandle = NCBIWWW.qblast("blastn", "nt", fastaFile, word_size = 7, hitlist_size = 5, megablast = True)"

with the parameters based on requirements from another member of my team. The error message is:

"ValueError: Error message from NCBI: Message ID#24 Error: Failed to read the Blast query: Protein FASTA provided for nucleotide sequence"

The sequence I'm providing is certainly not a protein FASTA. I've tried setting them all to their defaults, and I've tried a few example FASTA files, with the same error being raised. My code works fine when provided with a GI number, or a raw sequence. I'm wondering if the error is something to do with the headers of my FASTA sequences being read as part of the sequence itself, and the non-GCTA letters are causing it to be read as a protein sequence.

Thank you for reading, and I would really appreciate any help anyone could offer!

blast biopython software error FASTA • 11k views
ADD COMMENT
0
Entering edit mode

can we have a look at "all targets.txt"?

ADD REPLY
3
Entering edit mode
5.4 years ago
marcobgg4 ▴ 30

Hi, hope i can be of some help even this late. The mistake is quite simple and i have done it myself 5 minutes ago while learning qblast. Basically u are using blastn that is for nucleotides instead of blastp to process your protein.

I.e. you should do

resultHandle = NCBIWWW.qblast("blastp", "nt", fastaFile, word_size = 7, hitlist_size = 5, megablast = True)

instead of

resultHandle = NCBIWWW.qblast("blastn", "nt", fastaFile, word_size = 7, hitlist_size = 5, megablast = True)
ADD COMMENT

Login before adding your answer.

Traffic: 2931 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