exe/big_simon in big_simon-0.1.0 vs exe/big_simon in big_simon-0.1.1
- old
+ new
@@ -69,11 +69,11 @@
tmpdir_host = File.join tmpdir, "host"
# all_predictions_fname = File.join outdir, "scores_all.txt"
mean_scaled_scores_fname = File.join outdir, "scores_scaled.mean.txt"
-virus_recs, host_recs = [], []
+# virus_recs, host_recs = [], []
# Tempfile.open do |vir_f|
# Tempfile.open do |host_f|
# virus_fnames.each do |fname|
# ParseFasta::SeqFile.open(fname).each_record do |rec|
@@ -157,41 +157,21 @@
name_map_host, all_ids_host = BigSimon::Utils.set_up_tmp_dirs host_fnames, tmpdir_host, "host"
wish_outf = BigSimon::Runners.wish BigSimon::WISH, tmpdir_virus, tmpdir_host, tmpdir, threads
vhm_outf = BigSimon::Runners.vir_host_matcher BigSimon::VHM, tmpdir_virus, tmpdir_host, tmpdir
+# TODO separate the parser from the runner for mummer.
host_info_mummer = BigSimon::Runners.mummer BigSimon::MUMMER, tmpdir_virus, tmpdir_host, tmpdir, threads
-# Map them back to simple names. TODO just have it spit these out from the beginning.
-host_info_mummer_simple_names = {}
-inverted_name_map_virus = name_map_virus.invert
-inverted_name_map_host = name_map_host.invert
-
-host_info_mummer.each do |virus, host_tables|
- virname = virus
- if inverted_name_map_virus.has_key? virus
- virname = inverted_name_map_virus[virus]
- end
-
- host_info_mummer_simple_names[virname] = []
-
- host_tables.map do |table|
- hostname = inverted_name_map_host.has_key?(table[:host]) ? inverted_name_map_host[table[:host]] : table[:host]
- new_table = { host: hostname, score: table[:score], scaled_score: table[:scaled_score] }
-
- host_info_mummer_simple_names[virname] << new_table
- end
-end
-
host_info_wish = BigSimon::Parsers.wish wish_outf
host_info_vhm = BigSimon::Parsers.vir_host_matcher vhm_outf
-host_info_simple_names = BigSimon::Pipeline.collate_host_results [host_info_wish, host_info_vhm, host_info_mummer_simple_names], programs
+host_info_simple_names = BigSimon::Pipeline.collate_host_results [host_info_wish, host_info_vhm, host_info_mummer], programs
host_info = BigSimon::Pipeline.map_taxa host_info_simple_names, name_map_virus, name_map_host
-# puts
-# pp host_info
-# puts
+puts
+pp host_info
+puts
# Just a basic all info file
# File.open all_predictions_fname, "w" do |f|
# f.puts %w[virus host program score scaled.score].join "\t"