class Mspire::Ident::Pepxml::MsmsRunSummary

Attributes

base_name[RW]

The name of the pep xml file without any extension

ms_detector[RW]
ms_ionization[RW]
ms_manufacturer[RW]

The name of the mass spec manufacturer

ms_mass_analyzer[RW]
ms_model[RW]
pepxml_version[RW]
raw_data[RW]
raw_data_type[RW]
sample_enzyme[RW]

A SampleEnzyme object (responds to: name, cut, no_cut, sense)

search_summary[RW]

A SearchSummary object

spectrum_queries[RW]

An array of spectrum_queries

Public Class Methods

from_pepxml_node(node) click to toggle source
# File lib/mspire/ident/pepxml/msms_run_summary.rb, line 66
def self.from_pepxml_node(node)
  self.new.from_pepxml_node(node)
end
new(hash={}, &block) click to toggle source

takes a hash of name, value pairs if block given, yields a SampleEnzyme object, a SearchSummary and an array for SpectrumQueries

# File lib/mspire/ident/pepxml/msms_run_summary.rb, line 42
def initialize(hash={}, &block)
  @spectrum_queries = []
  merge!(hash, &block)
  block.call(block_arg) if block
end

Public Instance Methods

block_arg() click to toggle source
# File lib/mspire/ident/pepxml/msms_run_summary.rb, line 33
def block_arg
  [@sample_enzyme = Mspire::Ident::Pepxml::SampleEnzyme.new,    
    @search_summary = Mspire::Ident::Pepxml::SearchSummary.new,
    @spectrum_queries ]
end
from_pepxml_node(node) click to toggle source

peps correspond to search_results

# File lib/mspire/ident/pepxml/msms_run_summary.rb, line 71
def from_pepxml_node(node)
  @base_name = node['base_name']
  @ms_manufacturer = node['msManufacturer']
  @ms_model = node['msModel']
  @ms_manufacturer = node['msIonization']
  @ms_mass_analyzer = node['msMassAnalyzer']
  @ms_detector = node['msDetector']
  @raw_data_type = node['raw_data_type']
  @raw_data = node['raw_data']
  self
end
to_xml(builder=nil) click to toggle source

optionally takes an xml builder object and returns the builder, or the xml string if no builder was given sets the index attribute of each spectrum query if it is not already set

# File lib/mspire/ident/pepxml/msms_run_summary.rb, line 51
def to_xml(builder=nil)
  xmlb = builder || Nokogiri::XML::Builder.new
  hash = {:base_name => base_name, :msManufacturer => ms_manufacturer, :msModel => ms_model, :msIonization => ms_ionization, :msMassAnalyzer => ms_mass_analyzer, :msDetector => ms_detector, :raw_data_type => raw_data_type, :raw_data => raw_data}
  hash.each {|k,v| hash.delete(k) unless v }
  xmlb.msms_run_summary(hash) do |xmlb|
    sample_enzyme.to_xml(xmlb) if sample_enzyme
    search_summary.to_xml(xmlb) if search_summary
    spectrum_queries.each_with_index do |sq,i| 
      sq.index = i+1 unless sq.index
      sq.to_xml(xmlb)
    end
  end
  builder || xmlb.doc.root.to_xml
end