   "Parallel region query; returns all pts at least eps similar to pt."
   [pt pts metric eps]
   (letfn [(is-local? [x] (>= (metric pt x) eps))]
-    (r/fold 5 (r/monoid into vector) conj (r/filter is-local? pts))))
-
+    (r/fold partition-size
+            (r/monoid into vector) conj (r/filter is-local? pts))))
 
 
 (defn expand-cluster


(def sample-proteins
  (reduce into 
          (map read-fasta (take 3 prefixed-files)))) 

(time (def trial (dbscan sample-proteins protein-metric 100 4)))


(comment

(read-fasta "resources/simple.fasta")



(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)

;;;

