Hi,
I’ve stitched together a def for links.rb that works great to generate a link to jbrowse for a single database:
`
def jbrowse
r_start = hsps.map(&:sstart).min
r_end = r_start + hsps.map(&:length).max
contig = encode self.accession
rest = encode self
url = “http://localhost/apollo/jbrowse/index.html?organism=1”\
“&highlight=#{contig}” “%3A#{r_start}…#{r_end}”\
“&loc=#{contig}” “%3A#{r_start}…#{r_end}” “&tracks=maker”
{
:order => 5,
:title => ‘View in JBrowse’,
:url => url,
:icon => ‘fa-share-square-o’
}
end
`
However, my ruby knowledge is very limited and I’m struggling to figure out how to make a custom URL dependent on the database from which the hit comes. Basically, I want to change organism=X in the example above according to a set of regular expressions that match the relevant database name. I’ve played around with whichdb (hit_database=whichdb) but get errors about arrays and structs when trying to match it.
Any chance you could suggest a solution?
Cheers,
Den