 
 (defn split-barcodes
   [in-fq sqxform-fn ot-fq-map barcodes-map other-barcodes qc-ctpt sqc%]
+
   (letio [bclen (->> ot-fq-map keys first count long)
           inf (io/open-streaming-gzip in-fq :in)
           lines (io/read-lines inf)

                                 V v)))
                      (fn[V fqrec]
                        (let [[id sq aux qc] (sqxform-fn fqrec)
                              bc (get-sq-bc sq barcodes-map other-barcodes)]
                          (if bc
                            (if (pass-qcscore qc qc-ctpt sqc%)
                              (let [len (count sq)

               ibcs))))


(defn get-sq-bc [sq bclen barcodes-map other-barcodes]
  (when sq
    (let [bc (str/substring sq 0 bclen)]
      (or (barcodes-map bc) (other-barcodes bc)))))

(defn pass-qcscore [qc qc-ctpt sqc%]
  (> (fil/percent-pass-qscore qc qc-ctpt) (double sqc%)))


(def SDBG (atom #{}))
;;;#{"GGATGG" "CTTAAC" "TAATTA" "ATGGAT" "AATTGC" "TGCTTA"}
(defn write-chunk-to-files [ot-fd-map recs]
  (let [file-groups (->> recs (group-by
                               (fn[[bc fqrec]]
                                 (let [fd (ot-fd-map bc)]
                                   (if fd fd
                                       (when (not (@SDBG bc))
                                         (swap! SDBG #(conj % bc))
                                         (prn :BAD-BC?! bc))))))
                         (mapv (fn[[fd rec]] [fd (mapv second rec)])))

        file-groups (filter (fn[[fd recs]] fd) file-groups)]
    (dorun
     (mapv (fn[fut] (deref fut))
           (mapv (fn[[fd recs]]
