Method: PepXML#extract_engine
- Defined in:
- lib/protk/pepxml.rb
#extract_engine ⇒ Object
Obtain the search engine name from the input file The name of the engine is returned in lowercase and should contain no spaces Names of common engines are searched for and extracted in simplified form if possible
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/protk/pepxml.rb', line 67 def extract_engine() reader = XML::Reader.file(self.file_name) throw "Failed to open xml file #{file_name}" unless reader!=nil while(reader.read) if ( reader.name == "search_summary" ) dbnode=reader. dbvalue=dbnode['search_engine'] reader.close engine_name=dbvalue.gsub(/ /,"_") engine_name=engine_name.gsub(/\(/,"") engine_name=engine_name.gsub(/\)/,"") engine_name=engine_name.gsub(/\!/,"") return engine_name.downcase end end end |