Class: PepXMLWriter

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializePepXMLWriter

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_docObject (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