HowTo? Have a single SS instance serve variable configurations of databases

HI,

I have seen discussions involving hosting multiple SS instance, each serving from different .sequenceserver.config files.

I would instead like a single SS instance to (optionally) accept a URL parameter that allows to override the default configuration by specifying an alternate file-system path.

With such a scheme, users could compose URLS like:

http://blast.stowers.org?c=/serverside/path/to/my/.sequenceserver.conf

or maybe more simply:

http://blast.stowers.org?d=/serverside/path/to/my/blastdb

This would allow a single SS (provisioned centrally, and augmented with HPC load balancing capabilities) to serve the varied labs at my institute by allowing reconfiguration “on the fly” to focus the UI on project-specific sets of blast databases.

Do you see that something like this is already possible with creative deployment of SS…
… or might it be possible without a significant overhaul to the SS configuration scheme…
… or are there architectural considerations I am ignorant of that make implementing such an capability unreasonable proposition?

Alternatively, and perhaps more simply, if SS could take a URL encoded regular expression parameter and limit list of displayed databases to only those which it matches.

http://blast.stowers.org?regex=’/serverside/path/to/my/blastdb/*’

This would continue to centrality of a single server-side configuration. Such URL might look like:

Thanks for your consideration…

Cheers,

Malcolm Cook
Stowers Institute for Medical Research
Kansas City, MO

The following snippet in routes.rb serves the search form.

get ‘/’ do
erb :search, :locals => { :databases => Database.group_by(&:type) }
end

You could,

get '/‘ do
dbs = Database.select { |d| d.name =~ params[:d] }
erb :search, :locals => { :databases => dbs.group_by(&:type) }
end

params contain query data (stuff after ? in url).

d.name returns absolute path to db file.

You can extend that to be more specific:

~/sequencedb

  • db1/
  • db2/
    `- db3/

(set ~/sequencedb as database dir in SequenceServer)

dbs = Database.select { |d| (d.name.split(‘/‘) - SequenceServer.config[:database_dir].split(‘/‘)).first == params[:d] }

… so that it doesn’t select databases based on the value of params[:d] anywhere in the path.

You can get creative in several ways with little knowledge of Ruby and SequenceServer.

If you want, you can do this without having to modify SequenceServer’s code. Load following file with -r command line option or :require: key in config file.

module SequenceServer
class Routes

Remove built-in ‘/‘ route.