Error when retrieving fasta file

I got this error when clicking on the fasta for a search result:

Thanks in advance!

This error happens when there’s stop codon (*) in the protein sequence database.

Priyam

Well that was an easy fix. Thank you!

Hello Daniel and Priyam, I have just reinstalled sequenceserver 1.0.11 and am getting this same error when attempting to retrieve fasta file hits. You stated why this may happen, but how do I fix the problem (specifically) . . . no bioinformatic skills in my toolkit!

Thanks, Michael

Something went wonky

Looks like you have encountered a bug in SequenceServer. Could you please report this incident to your admin or to SequenceServer Google Group (if you are the admin), quoting the error message below?

It looks like the actual bug is in blastdbcmd from NCBI:

$ blastdbcmd -outfmt ‘%g %i %a %t %s’ -db ‘prot.fa’ -entry ‘F1’

→ …CSCASIFÿÿQMFPSQFRDGPSITWSÿSNRAKSASVÿKASSSÿEGI…

Where every Stopcodon ‘*’ in the prot.fa is replaced by ‘ÿ’ by blastdbcmd (0xFF).
So replacing it in the output, fixes the issue.

So in sequence.rb (in my case in /var/lib/gems/2.1.0/gems/sequenceserver-1.0.11/lib/sequenceserver)
in Line 189-191 add the following:

command = “blastdbcmd -outfmt ‘%g %i %a %t %s’”
" -db ‘#{database_names.join(’ ‘)}’"
" -entry ‘#{sequence_ids.join(’,’)}’ | tr ‘\377’ ‘\052’"

This will translate 0xFF back to 0x2A and everything is fine.
This is probably better done later on and directly in ruby instead of piping through tr but i don’t know ruby well enough to do it the proper way and this works for me :wink: