class Mspire::Ident::Pepxml::TerminalModification

Modified aminoacid, static or variable

Attributes

description[RW]
mass[RW]

Mass of modified terminus

massdiff[RW]

Mass difference with respect to unmodified terminus

protein_terminus[RW]

whether modification can reside only at protein terminus (specified n or c)

symbol[RW]

symbol used by search engine to designate this modification

terminus[RW]

n for N-terminus, c for C-terminus

variable[RW]

Y if both modified and unmodified terminus could be present in the dataset, N if only modified terminus can be present

Public Class Methods

new(hash={}) click to toggle source
# File lib/mspire/ident/pepxml/modifications.rb, line 67
def initialize(hash={})
  hash.each {|k,v| send("#{k}=", v) }
end

Public Instance Methods

to_xml(builder=nil) click to toggle source

returns the builder or an xml string if no builder supplied

# File lib/mspire/ident/pepxml/modifications.rb, line 72
def to_xml(builder=nil)
  xmlb = builder || Nokogiri::XML::Builder.new
  #short_element_xml_from_instance_vars("terminal_modification")
 attrs = [:terminus, :massdiff, :mass, :variable, :protein_terminus, :description].map {|at| v=send(at) ; [at,v] if v }.compact
 hash = Hash[attrs] 
  hash[:massdiff] = hash[:massdiff].to_plus_minus_string
  xmlb.terminal_modification(hash)
  builder || xmlb.doc.root.to_xml
end