Class: PepXMLWriter
- Inherits:
-
Object
- Object
- PepXMLWriter
- Defined in:
- lib/protk/pepxml_writer.rb
Constant Summary collapse
- PEPXML_NS_PREFIX =
"pepxml"
- PEPXML_NS =
"http://regis-web.systemsbiology.net/pepXML"
Instance Attribute Summary collapse
-
#template_doc ⇒ Object
readonly
Returns the value of attribute template_doc.
Instance Method Summary collapse
- #append_spectrum_query(query_node) ⇒ Object
-
#initialize ⇒ PepXMLWriter
constructor
A new instance of PepXMLWriter.
- #save(file_path) ⇒ Object
Constructor Details
#initialize ⇒ PepXMLWriter
Returns a new instance of PepXMLWriter.
10 11 12 13 14 |
# File 'lib/protk/pepxml_writer.rb', line 10 def initialize template_path="#{File.dirname(__FILE__)}/data/template_pep.xml" template_parser=XML::Parser.file(template_path) @template_doc=template_parser.parse end |
Instance Attribute Details
#template_doc ⇒ Object (readonly)
Returns the value of attribute template_doc.
8 9 10 |
# File 'lib/protk/pepxml_writer.rb', line 8 def template_doc @template_doc end |
Instance Method Details
#append_spectrum_query(query_node) ⇒ Object
16 17 18 |
# File 'lib/protk/pepxml_writer.rb', line 16 def append_spectrum_query(query_node) @template_doc.root << query_node end |
#save(file_path) ⇒ Object
20 21 22 |
# File 'lib/protk/pepxml_writer.rb', line 20 def save(file_path) @template_doc.save(file_path,:indent=>true,:encoding => XML::Encoding::UTF_8) end |