Class: GalaxyUtil
- Inherits:
-
Object
- Object
- GalaxyUtil
- Defined in:
- lib/protk/galaxy_util.rb
Class Method Summary collapse
- .for_galaxy? ⇒ Boolean
- .stage_pepxml(input_pepxml_path) ⇒ Object
- .stage_protxml(input_protxml_path) ⇒ Object
Class Method Details
.for_galaxy? ⇒ Boolean
9 10 11 12 13 |
# File 'lib/protk/galaxy_util.rb', line 9 def self.for_galaxy? fg = ARGV[0]=="--galaxy" ARGV.shift if fg fg end |
.stage_pepxml(input_pepxml_path) ⇒ Object
15 16 17 18 |
# File 'lib/protk/galaxy_util.rb', line 15 def self.stage_pepxml(input_pepxml_path) stager = GalaxyStager.new(input_pepxml_path, :extension => ".pep.xml") stager end |
.stage_protxml(input_protxml_path) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/protk/galaxy_util.rb', line 20 def self.stage_protxml(input_protxml_path) # This method takes in the path to a protxml created in Galaxy, # finds the dependent pepxml and peak lists (mzml files), creates # symbolic links to the peak lists with the correct extension and # and indexes them if needed (both seem required for TPP quant # tools) and then produces new protxml and pepxml files with paths # updated to these new peak list files. protxml_path="interact.prot.xml" FileUtils.copy(input_protxml_path, "interact.prot.xml") protxml = ProtXML.new(protxml_path) pepxml_path = protxml.find_pep_xml() protxml_stager = GalaxyStager.new(protxml_path, :extension => ".prot.xml", :force_copy => true) pepxml_stager = GalaxyStager.new(pepxml_path, :name => "interact", :extension => ".xml", :force_copy => true) pepxml_path = pepxml_stager.staged_path pepxml_stager.replace_references(protxml_path) runs = PepXML.new(pepxml_stager.staged_path).find_runs() run_stagers = runs.map do |base_name, run| run_stager = GalaxyStager.new(base_name, :extension => ".#{run[:type]}") ConvertUtil.ensure_mzml_indexed(run_stager.staged_path) run_stager.replace_references(pepxml_path, :base_only => true) run_stager end protxml_path end |