Module: MartSearch::ServerViewHelpers::UcscLinks

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

Overview

View helpers for linking to the UCSC Genome Browser

Author:

Instance Method Summary (collapse)

Instance Method Details

Helper function to generate link URL to Mouse UCSC



19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/martsearch/server_view_helpers/ucsc_links.rb', line 19

def ucsc_link_url( species, chromosome, start_pos, end_pos, tracks={} )
  url = 'http://genome.ucsc.edu/cgi-bin/hgTracks?'
  
  db = case species
  when :mouse then 'mm9'
  when :human then 'hg19'
  end
  
  url << "db=#{db}"
  url << "&#{process_ucsc_tracks(tracks)}" unless tracks.empty?
  url << "&position=chr#{chromosome}:#{start_pos}-#{end_pos}"
  
  return url
end