Class: Mspire::Mzml::CV

Inherits:
Object
  • Object
show all
Defined in:
lib/mspire/mzml/cv.rb

Constant Summary collapse

IMS =

These are derived by looking in the obo folder at the top of mspire

self.new("IMS",  "Imaging MS Ontology", "http://www.maldi-msi.org/download/imzml/imagingMS.obo", "0.9.1")
MS =
self.new('MS', "Proteomics Standards Initiative Mass Spectrometry Ontology", "http://psidev.cvs.sourceforge.net/*checkout*/psidev/psi/psi-ms/mzML/controlledVocabulary/psi-ms.obo", "3.18.0")
UO =

the version for UO doesn’t really exist: seen files where they use the download date: DD:MM:YYY

self.new("UO", "Unit Ontology", "http://obo.cvs.sourceforge.net/*checkout*/obo/obo/ontology/phenotype/unit.obo", "16:02:2012")
DEFAULT_CVS =
[MS, UO, IMS]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, full_name, uri, version = nil) ⇒ CV

Returns a new instance of CV.



17
18
19
# File 'lib/mspire/mzml/cv.rb', line 17

def initialize(id, full_name, uri, version=nil)
  @id, @full_name, @uri, @version = id, full_name, uri, version
end

Instance Attribute Details

#full_nameObject

(required) The usual name for the resource (e.g. The PSI-MS Controlled Vocabulary).



11
12
13
# File 'lib/mspire/mzml/cv.rb', line 11

def full_name
  @full_name
end

#idObject

(required) The short label to be used as a reference tag with which to refer to this particular Controlled Vocabulary source description (e.g., from the cvLabel attribute, in CVParamType elements).



9
10
11
# File 'lib/mspire/mzml/cv.rb', line 9

def id
  @id
end

#uriObject

(required) The URI for the resource.



13
14
15
# File 'lib/mspire/mzml/cv.rb', line 13

def uri
  @uri
end

#versionObject

(optional) The version of the CV from which the referred-to terms are drawn.



15
16
17
# File 'lib/mspire/mzml/cv.rb', line 15

def version
  @version
end

Class Method Details

.list_xml(objs, builder) ⇒ Object



28
29
30
31
32
33
# File 'lib/mspire/mzml/cv.rb', line 28

def self.list_xml(objs, builder)
  builder.cvList(count: objs.size) do |cvl_n|
    objs.each {|obj| obj.to_xml(cvl_n) }
  end
  builder
end

Instance Method Details

#to_xml(builder) ⇒ Object



21
22
23
24
25
26
# File 'lib/mspire/mzml/cv.rb', line 21

def to_xml(builder)
  atts = {id: @id, fullName: @full_name, :URI => @uri}
  atts[:version] = @version if @version
  builder.cv( atts )
  builder
end