                         `i` INT NOT NULL,
                         PRIMARY KEY(`eid`, `sid`))"])
 
-(declare score-decode)
-
-(declare probes scores experiments samples)
+
+;
+; Table models
+;
+
+(declare probes scores experiments samples exp_samples)
 
 (defentity cohorts
   (has-many experiments {:fk :cid})

(defn for-experiment-named [q exp]
  (for-experiment q (subselect experiments (fields "id") (where {:file exp}))))

(defn with-genes [q genes]
  (fields (where q {:probes.name [in genes]}) [:probes.name :gene]))

(defn do-select [q]
  (exec q))

(defn create[]
  (kdb/transaction

  (select samples (fields :id :sample)
          (where {:cid cid :sample [in sample-list]})))

; hash seq of maps by given key
(defn- hash-by-key [k s]
  (zipmap (map #(% k) s) s))
