I have several sequenceserver pages/processes running on the same server (on different port, with different set of blast databases).
I would like to customize the title (add a “project name” for each page) like in http://fungalgenomics.science.uu.nl/blast/ for example. How can I do that ?
And is it possible to have one title different for each page ?
Moreover, I would like to customize the blast database selector area (e.g. add a “check all” checkbox or more complex selection options). This is done in several sequenceserver pages listed in https://sequenceserver.com/#users (e.g. http://blast.tardigrades.org/)
Can we do that with the --require option ? If yes, were can I find an example of such a file ?
Using a custom title for each page is a bit of work but easily doable. You would need to find where sequenceserver is installed 1 and copy over the views folder from there. You would need to make one copy for each project. Let’s call them views_project_1, views_project_2, etc.
Change the title in search.erb in each of the views folder.
Next, create a file alongside each folder that we will load using the --require option to change where SequenceServer looks for the views folder. Let’s call these files require_project_1.rb, require_project_2.rb and so on.
I am assuming you have Ruby 2.0 or higher. Otherwise dir above won’t work. For older Ruby, try:
dir = File.dirname(FILE)
SequenceServer::Routes.set :views, “#{dir}/views_project_1”
Change the ‘views_project_1’ part in each require file to point to respective views folder.
All you need to do now is to (kill and) restart your SequenceServer processes with the --require switch this time:
sequenceserver -r require_project_1.rb
Unfortunately, it is not possible to implement ‘Check all’ button using the require file as it would require JavaScript interaction as well. However, we have implemented the ‘Check all’ button in version 2.0 of SequenceServer, currently in beta 2. All of above works as it is in version 2.0.
Thank you for your explanation.
I ended up adding a variable in the search.erb file <%= SequenceServer::WEB_PAGE_TITLE %>, and I provide the content of the variable in a .rb file given in the --require option:
module SequenceServer
WEB_PAGE_TITLE = 'Blast server for project P'
end
But it could be useful to redefine where SequenceServer looks for the views folder. Thanks for the tip !
I have another question: is it possible to change the order in which the banks appear (not alphabetical) ?
to change the order in which the banks appear (not alphabetical) ?
to group databases (e.g. by substring) that can be extended to see all databases, in the case where there are plenty of databases, to ease browsing (for example http://eplant.org:4567/)
For the ordering of databases the answer remains the same: best is to name the databases such that alphabetical sorting of databases reflects the order you want (you can add numbers, [genome], (mRNA) etc. in front).
If not, have a play around with Database component in public/js/search.js. When changing JavaScript code, use the -D option to launch SequenceServer. Once you are happy with your changes, the command to build the frontend code is:
npm run-script build
Unfortunately, there is no built in way to group databases. If you want to create your own, it would again be the Database component in search.js. This part of the codebase is very messy - my apologies in advance if you are going to be working through it.
Hi Priyam,
Thanks for your answer.
However, it seems that the displayed databases are not globally sorted alphabetically, but are sorted, in the first place, according to the repositories available in the path provided with the -d option. Moreover, alias databases (.nal files) are always displayed below the regular databases (.nhr, *.nin… files). Is that the desired behavior?
thank you for all your detailed contributions. I am happy that you’re finding Sequenceserver useful, and we are very grateful for your input!
It sounds like you’ve detected a bug in the 2.0 prerelease. I think we should add an automated test to check that this kind of thing is automatically detected in the future.
In 1.x, the sorting would have been alphabetical, rather than following what blastdbcmd is outputting. That way, the type of name-based grouping that Priyam indicates can work.
FWIW, there is some preliminary code for grouping very large numbers of databases. https://github.com/wurmlab/sequenceserver/issues/307 . I agree that seqserv should have some way of handling this elegantly. (probably by letting the sysadmin optionally decide to use of this type of mechanism). For now, we have not simply incorporated such code because it would require rigorous automated testing across many browser versions…