 (defn genomic-matrix-loader-run
   "Run a generated genomic-matrix-loader test case. Useful for repeated failed
   cases. Run with *verbose* to print detailed test failures"
-  [tsv id]
-  (with-file [file (str (io/file docroot "generated" id))]
-    (write-genomic-matrix file tsv)
+  [tsv id clinical]
+  (with-file [file (str (io/file docroot "generated" id))
+              meta-file (str file ".json")]
+    (write-genomic-matrix file tsv clinical meta-file)
     (db-disk-fixture
       db
       (loader db detector docroot file)

                  (doseq [f# ["test.h2.db" "test.lock.db" "test.trace.db"]]
                    (io/delete-file f# true)))))))

(def ^:dynamic *test-runs* 100)

(defn check-matrix [db id tsv]
  (let [{:keys [probes samples matrix]} tsv

  *test-runs*
  (prop/for-all
    [tsv gen-tsv
     id (gen/such-that not-empty gen/string-alpha-numeric)
     clinical gen/boolean]
    (genomic-matrix-loader-run tsv id clinical)))

(defn matrix2 [db]
  (ct/testing "tsv matrix from file"
