Module: MartSearch::ServerViewHelpers::EnsemblLinks

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

Overview

View helpers for linking to Ensembl/Vega

Author:

Instance Method Summary (collapse)

Instance Method Details

Helper function to construct a url for linking to Ensembl from a series of co-ordinates.

Parameters:

  • species (String/Symbol)

    The Ensembl species to link to

  • chr (String)

    The chromosome

  • start_pos (String/Integer)

    The start location that you would like contigview to centre on

  • end_pos (String/Integer)

    The end location that you would like contigview to centre on

  • das_tracks (Array) (defaults to: [])

    Any extra tracks that need to be turned on

Raises:

  • TypeError if an unkown species is passed



60
61
62
# File 'lib/martsearch/server_view_helpers/ensembl_links.rb', line 60

def ensembl_link_url_from_coords( species, chr, start_pos, end_pos, das_tracks=[] )
  ensembl_vega_contigview_link_url( :ensembl, species, "?r=#{chr}:#{start_pos}-#{end_pos};", das_tracks )
end

Helper function to construct a url for linking to Ensembl from a Ensembl Exon ID.

Parameters:

  • species (String/Symbol)

    The Ensembl species to link to

  • exon (String)

    The Ensembl Exon ID



38
39
40
# File 'lib/martsearch/server_view_helpers/ensembl_links.rb', line 38

def ensembl_link_url_from_exon( species, exon )
  ensembl_vega_exonview_link_url( :ensembl, species, exon )
end

Helper function to construct a url for linking to Ensembl from an Ensembl Gene ID.

Parameters:

  • species (String/Symbol)

    The Ensembl species to link to

  • gene (String)

    The Ensembl Gene ID

  • das_tracks (Array) (defaults to: [])

    Any extra tracks that need to be turned on

Raises:

  • TypeError if an unkown species is passed



18
19
20
# File 'lib/martsearch/server_view_helpers/ensembl_links.rb', line 18

def ensembl_link_url_from_gene( species, gene, das_tracks=[] )
  ensembl_vega_contigview_link_url( :ensembl, species, "?g=#{gene}", das_tracks )
end

Helper function to construct a url for linking to Ensembl from an Ensembl Transcript ID.

Parameters:

  • species (String/Symbol)

    The Ensembl species to link to

  • gene (String)

    The Ensembl Gene ID

  • transcript (String)

    The Ensembl Transcript ID

  • view (String/Symbol) (defaults to: :transcript)

    The display to view (exon|transcript)



29
30
31
# File 'lib/martsearch/server_view_helpers/ensembl_links.rb', line 29

def ensembl_link_url_from_transcript( species, gene, transcript, view=:transcript )
  ensembl_vega_transcriptview_link_url( :ensembl, species, view, "g=#{gene};t=#{transcript}" )
end

Helper function to construct a url for linking to Vega from a Ensembl Exon ID.

Parameters:

  • species (String/Symbol)

    The Ensembl species to link to

  • exon (String)

    The Ensembl Exon ID



47
48
49
# File 'lib/martsearch/server_view_helpers/ensembl_links.rb', line 47

def vega_link_url_from_exon( species, exon )
  ensembl_vega_exonview_link_url( :vega, species, exon )
end

Helper function to construct a url for linking to Vega from a Vega Gene ID.

Parameters:

  • species (String/Symbol)

    The Vega species to link to

  • gene (String)

    The Vega Gene ID

  • das_tracks (Array) (defaults to: [])

    Any extra tracks that need to be turned on

Raises:

  • TypeError if an unkown species is passed



71
72
73
# File 'lib/martsearch/server_view_helpers/ensembl_links.rb', line 71

def vega_link_url_from_gene( species, gene, das_tracks=[] )
  ensembl_vega_contigview_link_url( :vega, species, "?g=#{gene}", das_tracks )
end