Module: MARQ::Platform

Defined in:
lib/MARQ/main.rb

Class Method Summary collapse

Class Method Details

.codes(platform) ⇒ Object



62
63
64
65
# File 'lib/MARQ/main.rb', line 62

def self.codes(platform)
  platform = MARQ::Name.clean(platform)
  Open.read(File.join(path(platform), 'codes')).scan(/[^\s]+/)
end

.cross_platform(platform) ⇒ Object



67
68
69
70
# File 'lib/MARQ/main.rb', line 67

def self.cross_platform(platform)
  platform = MARQ::Name.clean(platform)
  Open.read(File.join(path(platform), 'cross_platform')).scan(/[^\s]+/)
end

.datasets(platform) ⇒ Object



54
55
56
57
58
59
60
# File 'lib/MARQ/main.rb', line 54

def self.datasets(platform)
  if is_GEO? platform
    GEO.platform_datasets(platform)
  else
    CustomDS.platform_datasets(platform)
  end
end

.exists?(platform) ⇒ Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/MARQ/main.rb', line 46

def self.exists?(platform)
  path(platform) != nil
end

.has_cross_platform?(platform) ⇒ Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/MARQ/main.rb', line 50

def self.has_cross_platform?(platform)
  File.exists? File.join(path(platform), 'cross_platform')
end

.is_cross_platform?(platform) ⇒ Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/MARQ/main.rb', line 33

def self.is_cross_platform?(platform)
  MARQ::Name.is_cross_platform? platform
end

.is_GEO?(platform) ⇒ Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/MARQ/main.rb', line 29

def self.is_GEO?(platform)
  ! platform.match(/^GPL/).nil?
end

.organism(platform) ⇒ Object



72
73
74
75
76
77
78
79
# File 'lib/MARQ/main.rb', line 72

def self.organism(platform)
  platform = MARQ::Name.clean(platform)
  if is_GEO? platform
    GEO.platform_organism platform
  else
    CustomDS.platform_organism platform
  end
end

.organism_platforms(organism) ⇒ Object



90
91
92
93
94
95
# File 'lib/MARQ/main.rb', line 90

def self.organism_platforms(organism)
  GEO.platforms.select {|platform|
    GEO::SOFT.GPL(platform)[:organism] == organism && MARQ::Platform.datasets(platform).any?
  } +
  CustomDS.organism_platforms(organism)
end

.path(platform) ⇒ Object



37
38
39
40
41
42
43
44
# File 'lib/MARQ/main.rb', line 37

def self.path(platform)
  platform = MARQ::Name.clean(platform)
  if is_GEO? platform
    GEO.platform_path(platform)
  else
    CustomDS.platform_path(platform)
  end
end

.process(platform) ⇒ Object



81
82
83
84
85
86
87
88
# File 'lib/MARQ/main.rb', line 81

def self.process(platform)
  platform = MARQ::Name.clean(platform)
  if is_GEO? platform
    GEO.process_platform(platform)
  else
    CustomDS.process_platform(platform)
  end
end