Module: MartSearch::ServerViewHelpers::GbrowseLinks

Included in:
MartSearch::ServerViewHelpers
Defined in:
lib/martsearch/server_view_helpers/gbrowse_links.rb

Overview

View helpers for linking to a Gbrowse instance.

Author:

  • Darren Oakley

Instance Method Summary collapse

Instance Method Details

#mgi_gbrowse_img(width, chromosome, start_pos, end_pos, img_tracks = {}) ⇒ Object

Helper function to embed an image from the MGI GBrowse server.

See Also:

  • #format_gbrowse_img_opts


14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/martsearch/server_view_helpers/gbrowse_links.rb', line 14

def mgi_gbrowse_img( width, chromosome, start_pos, end_pos, img_tracks={} )
  mgi_url        = "http://gbrowse.informatics.jax.org/cgi-bin/gbrowse_img/mouse_current/"
  default_tracks = {
    'NCBI_Transcripts'               => :expanded_labeled,
    'ENSEMBL_Transcripts'            => :expanded_labeled,
    'MGI_Representative_Transcripts' => :expanded_labeled,
    'VEGA_Transcripts'               => :expanded_labeled
  }
  
  img_url = mgi_url + format_gbrowse_img_opts( width, chromosome, start_pos, end_pos, img_tracks )
  
  embed_url = mgi_url + format_gbrowse_img_opts( 700, chromosome, start_pos, end_pos, img_tracks.merge!(default_tracks) )
  embed_url << 'embed=1;'
  embed_url << '&iframe=true&width=95%&height=95%'
  
  return "<a href=\"#{embed_url}\" rel=\"prettyPhoto\"><img src=\"#{img_url}\" /></a>"
end