Class: Mspire::Mzml::CV
- Inherits:
-
Object
- Object
- Mspire::Mzml::CV
- 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
-
#full_name ⇒ Object
(required) The usual name for the resource (e.g. The PSI-MS Controlled Vocabulary).
-
#id ⇒ Object
(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).
-
#uri ⇒ Object
(required) The URI for the resource.
-
#version ⇒ Object
(optional) The version of the CV from which the referred-to terms are drawn.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id, full_name, uri, version = nil) ⇒ CV
constructor
A new instance of CV.
- #to_xml(builder) ⇒ Object
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_name ⇒ Object
(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 |
#id ⇒ Object
(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 |
#uri ⇒ Object
(required) The URI for the resource.
13 14 15 |
# File 'lib/mspire/mzml/cv.rb', line 13 def uri @uri end |
#version ⇒ Object
(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
.from_xml(xml) ⇒ Object
36 37 38 |
# File 'lib/mspire/mzml/cv.rb', line 36 def self.from_xml(xml) self.new(xml[:id], xml[:fullName], xml[:URI], xml[:version]) end |
.list_xml(objs, builder) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/mspire/mzml/cv.rb', line 28 def self.list_xml(objs, builder) # we don't extend Mzml::List because of custom name below 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 |