Sha256: da0c7116c48d76abf6dad4c6254c340682cfa15c02329a25011305bb9da4235a

Contents?: true

Size: 1.75 KB

Versions: 4

Compression:

Stored size: 1.75 KB

Contents

module Mspire
  class Mzml
    class CV

      # (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)
        builder.cvList(count: objs.size) do |cvl_n|
          objs.each {|obj| obj.to_xml(cvl_n) }
        end
        builder
      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

4 entries across 4 versions & 1 rubygems

Version Path
mspire-0.7.5 lib/mspire/mzml/cv.rb
mspire-0.7.4 lib/mspire/mzml/cv.rb
mspire-0.7.3 lib/mspire/mzml/cv.rb
mspire-0.7.2 lib/mspire/mzml/cv.rb