   "merges results from all organisms into one big fat map, and filters out the other two go branches"
   (filter
     (fn [result]
-      (.log js/console "XXX" (clj->js result))
       (= (:ontology-branch result) go-branch))
      (apply concat (map (fn [[_ organism]]
        organism

        organisms-present (keys counts)
        missing-organisms (find-missing-organisms counts)]
    ;  (.clear js/console)
      (.log js/console "C"(clj->js merged-results))
    {:rows final-heatmap-matrix :headers go-terms :max-count max-count :missing-organisms missing-organisms }
    ))


(defn build-result-matrix [go-terms aggregate-ortholog-counts]
  "This is basically a matrix representation of the table we'll output. We can't just use maps because the order is important, and maps can't be trusted."
  (apply concat (map (fn [[organism orthologs]]
    (.log js/console "XXX" (clj->js organism) (clj->js orthologs))
  (map (fn [[ortholog terms]]
      (concat [organism ortholog] (map-terms go-terms terms))
    ) orthologs)
  ) aggregate-ortholog-counts)))
