Class: Mspire::Ident::Pepxml::TerminalModification
- Inherits:
-
Object
- Object
- Mspire::Ident::Pepxml::TerminalModification
- Includes:
- Merge
- Defined in:
- lib/mspire/ident/pepxml/modifications.rb
Overview
Modified aminoacid, static or variable
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#mass ⇒ Object
Mass of modified terminus.
-
#massdiff ⇒ Object
Mass difference with respect to unmodified terminus.
-
#protein_terminus ⇒ Object
whether modification can reside only at protein terminus (specified n or c).
-
#symbol ⇒ Object
symbol used by search engine to designate this modification.
-
#terminus ⇒ Object
n for N-terminus, c for C-terminus.
-
#variable ⇒ Object
Y if both modified and unmodified terminus could be present in the dataset, N if only modified terminus can be present.
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ TerminalModification
constructor
A new instance of TerminalModification.
-
#to_xml(builder = nil) ⇒ Object
returns the builder or an xml string if no builder supplied.
Methods included from Merge
Constructor Details
#initialize(hash = {}) ⇒ TerminalModification
Returns a new instance of TerminalModification.
67 68 69 |
# File 'lib/mspire/ident/pepxml/modifications.rb', line 67 def initialize(hash={}) hash.each {|k,v| send("#{k}=", v) } end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
65 66 67 |
# File 'lib/mspire/ident/pepxml/modifications.rb', line 65 def description @description end |
#mass ⇒ Object
Mass of modified terminus
56 57 58 |
# File 'lib/mspire/ident/pepxml/modifications.rb', line 56 def mass @mass end |
#massdiff ⇒ Object
Mass difference with respect to unmodified terminus
54 55 56 |
# File 'lib/mspire/ident/pepxml/modifications.rb', line 54 def massdiff @massdiff end |
#protein_terminus ⇒ Object
whether modification can reside only at protein terminus (specified n or c)
64 65 66 |
# File 'lib/mspire/ident/pepxml/modifications.rb', line 64 def protein_terminus @protein_terminus end |
#symbol ⇒ Object
symbol used by search engine to designate this modification
61 62 63 |
# File 'lib/mspire/ident/pepxml/modifications.rb', line 61 def symbol @symbol end |
#terminus ⇒ Object
n for N-terminus, c for C-terminus
52 53 54 |
# File 'lib/mspire/ident/pepxml/modifications.rb', line 52 def terminus @terminus end |
#variable ⇒ Object
Y if both modified and unmodified terminus could be present in the dataset, N if only modified terminus can be present
59 60 61 |
# File 'lib/mspire/ident/pepxml/modifications.rb', line 59 def variable @variable end |
Instance Method Details
#to_xml(builder = nil) ⇒ Object
returns the builder or an xml string if no builder supplied
72 73 74 75 76 77 78 79 80 |
# 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 } hash = Hash[attrs] hash[:massdiff] = hash[:massdiff].to_plus_minus_string xmlb.terminal_modification(hash) builder || xmlb.doc.root.to_xml end |