 
 (defn get-exp-sample-info [csv]
   (let [recs (->> csv slurp csv/read-csv)
-        x (coll/drop-until
-           (fn[v] (#{"tnseq", "rnaseq", "trmseq" "wgseq"} (first v)))
+        x (coll/dropv-until
+           (fn[v] (#{"tnseq", "rnaseq", "termseq" "wgseq"} (first v)))
            recs)
         recs (if (seq x) x (cons ["rnaseq" "noexp" "noexp"] recs))
         exp-rec [(coll/takev 3 (first recs))]] ; ensure 3 fields
     (loop [S (rest recs)
            I [exp-rec]]
       (if (not (seq S))
-        (apply concat I)
-        (let [s (coll/drop-until (fn[v] (str/digits? (first v))) S)
-              i (coll/take-until (fn[v] (not (str/digits? (first v)))) s)
+        (let [sections I
+              exp (-> sections first ffirst keyword)
+              ks [:exp-rec :ncbi-xref :run-xref :bc-xref]
+              ks (if (= exp :termseq) ks (remove #(= % :run-xref) ks))
+              secmap (zipmap ks sections)
+              secmap (if (not= exp :termseq)
+                       secmap
+                       (assoc secmap :run-xref
+                              (mapv #(coll/takev 3 %) (secmap :run-xref))))]
+          secmap)
+        (let [s (coll/dropv-until (fn[v] (str/digits? (first v))) S)
+              i (coll/takev-until (fn[v] (not (str/digits? (first v)))) s)
               ;; ensure 3 fields for NCBI xref
-              i (if (= 1 (count I)) (map #(coll/takev 3 %) i) i)]
+              i (if (= 1 (count I)) (mapv #(coll/takev 3 %) i) i)]
           (recur (coll/drop-until (fn[v] (not (str/digits? (first v)))) s)
                  (conj I i)))))))
 


(defn get-exp-type
  [exp-samp-info]
  (-> exp-samp-info ffirst keyword))


(defn ensure-dirs [& dirs]

      ((fn[m]
         (assoc m :replicate-names
                (->> (m :exp-sample-info)
                     :bc-xref
                     (map second)
                     (group-by (fn[rnm]
                                 (->> rnm (str/split #"-")
