 (defn medioid
   "Return element of cluster that maximizes sum of similarity scores" 
   [cluster metric]
-  (let [mem-metric (if memoized-mediods
+  (let [mem-metric (if memoized-medioids
                      (memoize-metric metric)
                       metric)]
     (second 

            [clojure.java.io :as io])
  (:import match.Match2))

(declare region-query-s)
(declare region-query-p)
(declare memoized-metric)

;; TODO: find optimal subdivision for r/fold

(def memoized-dbscan
  "If true, calls to the metric passed to dbscan will be memoized"
  true)

(def memoized-mediods
  "If true, calls to the metric passed to mediod-protein will be memoized"
  true)

(def region-query
  "Select region-query-s (serial) or region-query-p (parallel)"
  region-query-p)

(def partition-size
  "Approximate subdivision size for clojure.core.reducers/fold"
  16)

;;;

(defn region-query-s
  "Serial region query; returns all pts *at least* eps similar to pt."

(defn expand-cluster
  "Expand cluster at pt
   Returns false if there is not cluster to be had
   Returns the core points of the cluster and an updated visited set otherwise"
  [pt pts metric eps min-pts visited]

  (let [local (region-query pt pts metric eps)]
