Sha256: 987265e58769b1fb47470166fd6f1912aaa0be715b16c87faf300d9231251792
Contents?: true
Size: 1.96 KB
Versions: 1
Compression:
Stored size: 1.96 KB
Contents
module Mspire class Mzml class CV # note: CV is NOT paramable! # (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). attr_accessor :id # (required) The usual name for the resource (e.g. The PSI-MS Controlled Vocabulary). attr_accessor :full_name # (required) The URI for the resource. attr_accessor :uri # (optional) The version of the CV from which the referred-to terms are drawn. attr_accessor :version def initialize(id, full_name, uri, version=nil) @id, @full_name, @uri, @version = id, full_name, uri, version end def to_xml(builder) atts = {id: @id, fullName: @full_name, :URI => @uri} atts[:version] = @version if @version builder.cv( atts ) builder end 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 def self.from_xml(xml) self.new(xml[:id], xml[:fullName], xml[:URI], xml[:version]) end # These are derived by looking in the obo folder at the top of mspire IMS = 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") # the version for UO doesn't really exist: seen files where they use the # download date: DD:MM:YYY UO = 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] end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
mspire-0.8.0 | lib/mspire/mzml/cv.rb |