Hi sequenceserver team,
We started using s.server and we need help with adding links to our Jbrowse.
Here is the links.rb file that was updated according to the example here: https://jbrowse.org/docs/faq.html#how-can-i-link-blast-results-to-jbrowse
I still do not get the links…
What do we miss???
LInks.rb file:
module SequenceServer
Module to contain methods for generating sequence retrieval links.
module Links
require ‘erb’
Provide a method to URL encode query parameters. See [1].
include ERB::Util
Hi Alex,
Do you not see a ‘JBrowse’ link in the results page?
From your previous email:
You can edit links.rb file included in the sequenceserver installation, but that is generally not a good idea. You can place the file anywhere, including in /etc/sequenceserver, but you need to make sure two things. First, that the file is readable by the unix user that runs your sequenceserver instance. Second, tell sequenceserver to load this file by adding the following line to config file:
:require: ‘/path/to/links.rb’
I hope this helps. If not, you will have to give the mailing list more details, like what you tried, if there’s an error, etc.
Priyam
No, I do not see the “Jbrowse” link on the results page, no!
line “:require: ‘/path/to/links.rb’” exists in the config file, and the file is readable!
I tried only the above really, and I do not see any error. Just no links on the sequenceserver.
The screen that I see is attached.
Alex
Hmm, and SequenceServer is reading databases directory, etc. from the same config file in which you put the :require: line? I ask because sometimes users don’t realise that Apache runs processes as another user, which means SequenceServer will look for the configuration file in that user’s home directory. It also influences how ~ and . in paths are expanded. To be sure, use absolute path with the :require: option.
You can try increasing verbosity of SequenceServer’s logger by setting RACK_ENV environment variable to development (maybe using SetEnv - https://httpd.apache.org/docs/2.4/mod/mod_env.html#setenv) and look for “Loading extension: /path/to/links.rb” in Apache’s logs to make sure the file is being loaded by SequenceServer.
It might be worth checking Apache’s log even otherwise to see if there is some relevant info there.
Priyam
Hi, yes.
This is the conf file. It is in the /etc/sequenceserver/ directory:
As you see I use the absolute path…
:port: 7654
:host: 10.26.6.90
:database_dir: “/data/genome/Punica.granatum/wonderful/Index”
:num_threads: 8
:require_file: /var/lib/gems/2.3.0/gems/sequenceserver-1.0.14/lib/sequenceserver/links.rb
I also added the line to config.ru which is in “/var/lib/gems/2.3.0/gems/sequenceserver-1.0.14/” and put the “links.rb” in the same directory as well.
When I load it with sequenceserver -D database_dir -r links.rb I get the following:
The first lines kind of indicate that the file is loaded, isn’t it?
/var/lib/gems/2.3.0/gems/sequenceserver-1.0.14/lib/sequenceserver/links.rb:10: warning: already initialized constant SequenceServer::Links::NCBI_ID_PATTERN /var/lib/gems/2.3.0/gems/sequenceserver-1.0.14/links.rb:10: warning: previous definition of NCBI_ID_PATTERN was here /var/lib/gems/2.3.0/gems/sequenceserver-1.0.14/lib/sequenceserver/links.rb:11: warning: already initialized constant SequenceServer::Links::UNIPROT_ID_PATTERN /var/lib/gems/2.3.0/gems/sequenceserver-1.0.14/links.rb:11: warning: previous definition of UNIPROT_ID_PATTERN was here [2022-01-11 09:26:03] DEBUG Reading configuration file: /home/alex/.sequenceserver.conf. [2022-01-11 09:26:03] DEBUG Will use NCBI BLAST+ at: $PATH [2022-01-11 09:26:04] DEBUG Will use BLAST+ databases at: /data/genome/Punica.granatum/wonderful/V3/Draft [2022-01-11 09:26:04] DEBUG Found nucleotide database ‘Chr0 v3’ at ‘/data/genome/Punica.granatum/wonderful/V3/Draft/Chr0_v3.fasta’ [2022-01-11 09:26:04] DEBUG Found nucleotide database ‘wonderful v3’ at ‘/data/genome/Punica.granatum/wonderful/V3/Draft/wonderful_v3.fasta’ [2022-01-11 09:26:04] DEBUG Found nucleotide database ‘wonderful v3 chr0’ at ‘/data/genome/Punica.granatum/wonderful/V3/Draft/wonderful_v3_chr0.fasta’ [2022-01-11 09:26:04] DEBUG Loading extension: /var/lib/gems/2.3.0/gems/sequenceserver-1.0.14/links.rb [2022-01-11 09:26:04] DEBUG Will use 1 threads to run BLAST. [2022-01-11 09:26:04] WARN Will listen on all interfaces (0.0.0.0). Consider using 127.0.0.1 (–host option). [2022-01-11 09:26:04] INFO WEBrick 1.3.1 [2022-01-11 09:26:04] INFO ruby 2.3.1 (2016-04-26) [x86_64-linux-gnu] ** Could not bind to port 4567. Is SequenceServer already accessible at http://localhost:4567? No? Try running SequenceServer on another port, like so: sequenceserver -p 4570.
Does it work if you change require_file to require in the config file?
I am not sure what is happening then. You can try to debug what is happening - the file is clearly getting loaded, but why is the jbrowse method not getting called.
The methods in the links.rb file are called in line 27 of lib/sequenceserver/blast/hit.rb. You can put some puts statements there to see what’s going on. For example, ‘puts Links.instance_methods’ will show you which methods are being recognised. You will only get an output from this method when you run a BLAST search.
I would also suggest removing any ‘require’ statement that you may have put elsewhere (from your logs it looked like you put a require ‘path/to/links.rb’ somewhere in the code) and let sequenceserver load the file (using the :require: or -r option).
Priyam
Hi
I removed the links.rb from another place, and now I have it once and only in the folder that is mentioned in conf file.
I load it successfully, but then, when blasting i get the following message:
URI::InvalidURIError - bad URI(is not URI?): <10.26.6.90/pomegranate/>?loc=Chr8:18771420…18772420&addFeatures=%5B%7B%22seq_id%22%3A%22Chr8%22%2C%22start%22%3A18771920%2C%22end%22%3A20988172%2C%22type%22%3A%22match%22%2C%22subfeatures%22%3A%5B%7B%22start%22%3A18771920%2C%22end%22%3A18771933%2C%22type%22%3A%22match_part%22%7D%2C%7B%22start%22%3A20988172%2C%22end%22%3A20988185%2C%22type%22%3A%22match_part%22%7D%5D%7D%5D&addTracks=%5B%7B%22label%22%3A%22BLAST%22%2C%22key%22%3A%22BLAST%20hits%22%2C%22type%22%3A%22JBrowse%2FView%2FTrack%2FCanvasFeatures%22%2C%22store%22%3A%22url%22%2C%22glyph%22%3A%22JBrowse%2FView%2FFeatureGlyph%2FSegments%22%7D%5D&tracks=BLAST&highlight=Chr8:18771920…18771933: /usr/lib/ruby/2.3.0/uri/rfc3986_parser.rb:67:in split' /usr/lib/ruby/2.3.0/uri/rfc3986_parser.rb:73:in
parse’ /usr/lib/ruby/2.3.0/uri/common.rb:227:in parse' /var/lib/gems/2.3.0/gems/sequenceserver-1.0.14/lib/sequenceserver/routes.rb:75:in
absolute?’ /var/lib/gems/2.3.0/gems/sequenceserver-1.0.14/lib/sequenceserver/routes.rb:64:in a' /var/lib/gems/2.3.0/gems/sequenceserver-1.0.14/views/result.erb:101:in
block (4 levels) in singleton class’ /var/lib/gems/2.3.0/gems/sequenceserver-1.0.14/views/result.erb:100:in each' /var/lib/gems/2.3.0/gems/sequenceserver-1.0.14/views/result.erb:100:in
block (3 levels) in singleton class’ /var/lib/gems/2.3.0/gems/sequenceserver-1.0.14/views/result.erb:59:in each' /var/lib/gems/2.3.0/gems/sequenceserver-1.0.14/views/result.erb:59:in
block (2 levels) in singleton class’ /var/lib/gems/2.3.0/gems/sequenceserver-1.0.14/views/result.erb:5:in each' /var/lib/gems/2.3.0/gems/sequenceserver-1.0.14/views/result.erb:5:in
each_with_index’ /var/lib/gems/2.3.0/gems/sequenceserver-1.0.14/views/result.erb:5:in block in singleton class' /var/lib/gems/2.3.0/gems/sequenceserver-1.0.14/views/result.erb:-6:in
instance_eval’ /var/lib/gems/2.3.0/gems/sequenceserver-1.0.14/views/result.erb:-6:in singleton class' /var/lib/gems/2.3.0/gems/sequenceserver-1.0.14/views/result.erb:-9:in
__tilt_19800320’ /var/lib/gems/2.3.0/gems/tilt-2.0.9/lib/tilt/template.rb:170:in call' /var/lib/gems/2.3.0/gems/tilt-2.0.9/lib/tilt/template.rb:170:in
evaluate’ /var/lib/gems/2.3.0/gems/tilt-2.0.9/lib/tilt/template.rb:109:in render' /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:823:in
render’ /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:667:in erb' /var/lib/gems/2.3.0/gems/sequenceserver-1.0.14/lib/sequenceserver/routes.rb:135:in
block in class:Routes’ /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:in call' /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:in
block in compile!’ /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in block (3 levels) in route!' /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:994:in
route_eval’ /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in block (2 levels) in route!' /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1015:in
block in process_route’ /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:in catch' /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:in
process_route’ /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:973:in block in route!' /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:in
each’ /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:in route!' /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1085:in
block in dispatch!’ /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in block in invoke' /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in
catch’ /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in invoke' /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1082:in
dispatch!’ /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:in block in call!' /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in
block in invoke’ /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in catch' /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in
invoke’ /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:in call!' /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:895:in
call’ /var/lib/gems/2.3.0/gems/rack-1.6.11/lib/rack/head.rb:13:in call' /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:182:in
call’ /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:2013:in call' /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:in
block in call’ /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1787:in synchronize' /var/lib/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:in
call’ /var/lib/gems/2.3.0/gems/sequenceserver-1.0.14/lib/sequenceserver.rb:96:in call' /var/lib/gems/2.3.0/gems/rack-1.6.11/lib/rack/handler/webrick.rb:88:in
service’ /usr/lib/ruby/2.3.0/webrick/httpserver.rb:140:in service' /usr/lib/ruby/2.3.0/webrick/httpserver.rb:96:in
run’ /usr/lib/ruby/2.3.0/webrick/server.rb:296:in `block in start_thread’
What is the problem now?
Attached is my links.rb
module SequenceServer
Module to contain methods for generating sequence retrieval links.
module Links
require ‘erb’
Provide a method to URL encode query parameters. See [1].
include ERB::Util
Hi, Priyam,
I figured it out. It was the url that I set incorrectly in the links.rb together with the incorrect placement of the file itself (that you pointed out in your last letter).
It works fine now!
Many thanks,
Alex
Hi again,
So it all worked well on v1.14 and than we’ve updated our sequenceserver to 2.0 and here is what happens:
I have the link to Jbrowse, but when i press it - i get the error:
Request-URI Too Long
The requested URL’s length exceeds the capacity limit for this server.
I am a bit surprised that you get this error on migrating to 2.0 and nothing else changed?
Priyam
Nothing changed.
Any leads where and what should I do to fix?
Alex
Not really. I would try Apache config, as suggested by yourself.
If anything comes to light that can explain this issue, please let me know.
Priyam
I am having the same problems as Alexandra.
To fix the “URI TOO Long” error, I edited the file /usr/lib/ruby/2.5.0/webrick/httprequest.rb and increased the MAX_URI_LENGTH to 1024000.
Now, I receive the original error again:
{“message”:“GET /%3Chttp://:8080/%3E”,“title”:“Sinatra::NotFound”,“more_info”:“/var/lib/gems/2.5.0/gems/sinatra-2.2.2/lib/sinatra/base.rb:1090:in route_missing'\n/var/lib/gems/2.5.0/gems/sinatra-2.2.2/lib/sinatra/base.rb:1037:in
route!‘\n/var/lib/gems/2.5.0/gems/sinatra-2.2.2/lib/sinatra/base.rb:1033:in route!'\n/var/lib/gems/2.5.0/gems/sinatra-2.2.2/lib/sinatra/base.rb:1140:in
block in dispatch!’\n/var/lib/gems/2.5.0/gems/sinatra-2.2.2/lib/sinatra/base.rb:1112:in block in invoke'\n/var/lib/gems/2.5.0/gems/sinatra-2.2.2/lib/sinatra/base.rb:1112:in
catch’\n/var/lib/gems/2.5.0/gems/sinatra-2.2.2/lib/sinatra/base.rb:1112:in invoke'\n/var/lib/gems/2.5.0/gems/sinatra-2.2.2/lib/sinatra/base.rb:1135:in
dispatch!‘\n/var/lib/gems/2.5.0/gems/sinatra-2.2.2/lib/sinatra/base.rb:949:in block in call!'\n/var/lib/gems/2.5.0/gems/sinatra-2.2.2/lib/sinatra/base.rb:1112:in
block in invoke’\n/var/lib/gems/2.5.0/gems/sinatra-2.2.2/lib/sinatra/base.rb:1112:in catch'\n/var/lib/gems/2.5.0/gems/sinatra-2.2.2/lib/sinatra/base.rb:1112:in
invoke’\n/var/lib/gems/2.5.0/gems/sinatra-2.2.2/lib/sinatra/base.rb:949:in call!'\n/var/lib/gems/2.5.0/gems/sinatra-2.2.2/lib/sinatra/base.rb:938:in
call’\n/var/lib/gems/2.5.0/gems/rack-2.2.4/lib/rack/deflater.rb:44:in call'\n/var/lib/gems/2.5.0/gems/rack-2.2.4/lib/rack/head.rb:12:in
call’\n/var/lib/gems/2.5.0/gems/sinatra-2.2.2/lib/sinatra/base.rb:218:in call'\n/var/lib/gems/2.5.0/gems/sinatra-2.2.2/lib/sinatra/base.rb:1993:in
call’\n/var/lib/gems/2.5.0/gems/sinatra-2.2.2/lib/sinatra/base.rb:1553:in block in call'\n/var/lib/gems/2.5.0/gems/sinatra-2.2.2/lib/sinatra/base.rb:1769:in
synchronize’\n/var/lib/gems/2.5.0/gems/sinatra-2.2.2/lib/sinatra/base.rb:1553:in call'\n/var/lib/gems/2.5.0/gems/sequenceserver-2.0.0/lib/sequenceserver.rb:110:in
call’\n/var/lib/gems/2.5.0/gems/rack-2.2.4/lib/rack/handler/webrick.rb:95:in service'\n/usr/lib/ruby/2.5.0/webrick/httpserver.rb:140:in
service’\n/usr/lib/ruby/2.5.0/webrick/httpserver.rb:96:in run'\n/usr/lib/ruby/2.5.0/webrick/server.rb:307:in
block in start_thread’”}