download FASTA failed

Dear Sequenceserver users,

I’m a newbie in Sequenceserver.
The download of the FASTA file after blasting a query returned the following error:

Hey,

Can you tell me the id of the sequence you are trying to download? I suspect there’s a / in sequence id which is causing things to fail.

– Priyam

I’ve met the same problem. My sequence name is Arundo_Drought_Unigene000001
Yuan

BTW, my error is

ArgumentError - invalid byte sequence in UTF-8:
/var/lib/gems/2.1.0/gems/sequenceserver-1.0.4/lib/sequenceserver/sequence.rb:197:in split' /var/lib/gems/2.1.0/gems/sequenceserver-1.0.4/lib/sequenceserver/sequence.rb:197:in block in run’
/var/lib/gems/2.1.0/gems/sequenceserver-1.0.4/lib/sequenceserver/sequence.rb:196:in each_line' /var/lib/gems/2.1.0/gems/sequenceserver-1.0.4/lib/sequenceserver/sequence.rb:196:in each’
/var/lib/gems/2.1.0/gems/sequenceserver-1.0.4/lib/sequenceserver/sequence.rb:196:in map' /var/lib/gems/2.1.0/gems/sequenceserver-1.0.4/lib/sequenceserver/sequence.rb:196:in run’
/var/lib/gems/2.1.0/gems/sequenceserver-1.0.4/lib/sequenceserver/sequence.rb:172:in initialize' /var/lib/gems/2.1.0/gems/sequenceserver-1.0.4/lib/sequenceserver/routes.rb:142:in new’
/var/lib/gems/2.1.0/gems/sequenceserver-1.0.4/lib/sequenceserver/routes.rb:142:in block in <class:Routes>' /var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1610:in call’
/var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1610:in block in compile!' /var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:974:in []’
/var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:974:in block (3 levels) in route!' /var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:993:in route_eval’
/var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:974:in block (2 levels) in route!' /var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1014:in block in process_route’
/var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1012:in catch' /var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1012:in process_route’
/var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:972:in block in route!' /var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:971:in each’
/var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:971:in route!' /var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1084:in block in dispatch!’
/var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in block in invoke' /var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in catch’
/var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in invoke' /var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1081:in dispatch!’
/var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:906:in block in call!' /var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in block in invoke’
/var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in catch' /var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in invoke’
/var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:906:in call!' /var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:894:in call’
/var/lib/gems/2.1.0/gems/rack-1.6.4/lib/rack/head.rb:13:in call' /var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:181:in call’
/var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:2021:in call' /var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1486:in block in call’
/var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1795:in synchronize' /var/lib/gems/2.1.0/gems/sinatra-1.4.6/lib/sinatra/base.rb:1486:in call’
/var/lib/gems/2.1.0/gems/sequenceserver-1.0.4/lib/sequenceserver.rb:90:in call' /var/lib/gems/2.1.0/gems/rack-1.6.4/lib/rack/handler/webrick.rb:88:in service’
/usr/lib/ruby/2.1.0/webrick/httpserver.rb:138:in service' /usr/lib/ruby/2.1.0/webrick/httpserver.rb:94:in run’
/usr/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread’

BTW, seems it only happens with blastp, with blastn, it’s fine.

I think it’s the same as - https://github.com/wurmlab/sequenceserver/issues/188. We have this on our list and get to it as soon as possible.

– Priyam

Hi,

I had the same problem, I solved it by patching the code in “lib/sequenceserver/sequence.rb”. The method “run” line 188 has to replaced by:

`

`
def run
command = “blastdbcmd -outfmt ‘%g %i %a %t %s’”
" -db ‘#{database_names.join(’ ‘)}’"
" -entry ‘#{sequence_ids.join(’,’)}’"

logger.debug(“Executing: #{command}”)

out = #{command} 2> /dev/null
@sequences = out.each_line.map do |line|
line = line.chars.select(&:valid_encoding?).join.encode(‘UTF-8’, :invalid => :replace)
Sequence.new(*line.chomp.split(’ '))
end
extend(IO) && write if in_file
end

`

`

The problem is due the an encoing error of the stars at the end of some protein sequences (automatic predictions). This code removes any non UTF-8 characters.

I hope that it will help.

This patch doesn’t solve the first problem of this post.

Pierre-Yves

Hi,

I also had the same issue, although with a slightly different error message: “ArgumentError - invalid byte sequence in US-ASCII”. Pierre-Yves’ patch fixed the problem (thanks).

Cheers,
Roy.

Hi,
I got the following error while trying to download fasta file of subject sequence from a blast (tblastn) hit.
Could any one please help me. Thanks.

Not sure. The only reason I can imagine you would get this error is that you renamed or moved files around in database directory, restarted SequenceServer, and tried to use FASTA download link from an older search results.