Module: GEO::Remote

Defined in:
lib/MARQ/GEO.rb

Overview

Get information from Entrez

Constant Summary collapse

@@nice =
1

Class Method Summary collapse

Class Method Details

.dataset_platform(dataset) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/MARQ/GEO.rb', line 30

def self.dataset_platform(dataset)
  if dataset =~ /GSE/
    Open.read("http://www.ncbi.nlm.nih.gov/projects/geo/query/acc.cgi?acc=#{dataset}", :nice => @@nice).scan(/GPL\d+/).uniq.sort.join("_")
  else
    Open.read("http://www.ncbi.nlm.nih.gov/sites/GDSbrowser?acc=#{dataset}", :nice => @@nice).scan(/GPL\d+/).uniq.sort.join("_")
  end
end

.organism_platforms(org) ⇒ Object



19
20
21
22
23
# File 'lib/MARQ/GEO.rb', line 19

def self.organism_platforms(org)
  name = Organism.name(org)
  Open.read("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=gds&term=\"#{name}\"[Organism:exp]+AND+%22gpl%22[Filter]&retmax=10000", :nice => @@nice).
    scan(/<Id>(\d+?)<\/Id>/).collect{|id| id.first}.collect{|id| "GPL#{id.sub(/^100*/,'')}"}
end

.platform_datasets(platform) ⇒ Object



25
26
27
28
# File 'lib/MARQ/GEO.rb', line 25

def self.platform_datasets(platform)
  Open.read("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=gds&term=#{platform}[Accession]&retmax=2000", :nice => @@nice).
  scan(/<Id>(\d+?)<\/Id>/).collect{|id| id.first}.select{|id| !id.match(/^(1|2)000/) }.collect{|id| "GDS#{id}"}
end

.platform_organism(platform) ⇒ Object



43
44
45
46
# File 'lib/MARQ/GEO.rb', line 43

def self.platform_organism(platform)
  Open.read("http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=#{platform}", :nice => @@nice).
    scan(%r#<a href="http://www.ncbi.nlm.nih.gov/Taxonomy/Browser/wwwtax.cgi\?mode=Info&amp;id=\d+" onmouseout="onLinkOut\('HelpMessage' , geo_empty_help\)" onmouseover="onLinkOver\('HelpMessage' , geoaxema_organismus\)">(.*?)</a>#).collect{|p| p.first}.join(', ')
end

.series_dataset?(gse) ⇒ Boolean

Returns:

  • (Boolean)


38
39
40
41
# File 'lib/MARQ/GEO.rb', line 38

def self.series_dataset?(gse)
  Open.read("http://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=geo&term=#{gse}[Accession]&retmax=2000", :nice => @@nice).
  match(/<Id>(\d+?)<\/Id>/) != nil
end