215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
|
# File 'lib/protk/tandem_search_tool.rb', line 215
def taxonomy_doc(db_info)
throw "Invalid input db_info must be a FastaDatabase object" unless db_info.class==FastaDatabase
database_path=db_info.path
taxon=db_info.name
taxo_parser=XML::Parser.file(@taxonomy_path)
taxo_doc=taxo_parser.parse
taxon_label=taxo_doc.find('/bioml/taxon')
throw "Exactly one taxon label is required in the taxonomy_template file" unless taxon_label.length==1
taxon_label[0].attributes['label']=taxon
db_file=taxo_doc.find('/bioml/taxon/file')
throw "Exactly one database file is required in the taxonomy_template file" unless db_file.length==1
db_file[0].attributes['URL']=database_path
taxo_doc
end
|