   "Find a piled-up base and an indel from an alignment."
   [^long ref-pos ^SAMAlignment aln]
   (let [relative-pos (- ref-pos (.pos aln))
-        qual ((:quals-at-ref aln) relative-pos)
-        [base indel] ((:seqs-at-ref aln) relative-pos)
+        qual (aget ^shorts (:quals-at-ref aln) relative-pos)
+        ^PosBase pb (aget ^objects (:seqs-at-ref aln) relative-pos)
+        base (.base pb)
+        indel (.indel pb)
         deletion? (number? indel)]
     (plpio/->PileupBase
      (zero? relative-pos)

  (let [empty-qual? (and (= (.length qual) 1)
                         (= (.charAt qual 0) \*))]
    (if empty-qual?
      (vec (repeat (count idx) 93)) ;; \~
      (mapv (fn [[_ x]]
              (if (number? x)
                (qual/fastq-char->phred-byte (.charAt qual x))
                93))
            idx))))

(defn- seqs-at-ref
  [idx ^String s]
  (mapv (fn [[op x xs]]
          (let [c (if (number? x) (.charAt s x) x)]
            (case op
              :m [c]
              :d [c xs]
              :i [c (subs s (first xs) (last xs))]))) idx))

(defn index-cigar
  "Align bases and base quality scores with the reference coordinate."

  [^long min-base-quality]
  (fn [p]
    (->> #(<= min-base-quality (.qual ^PileupBase %))
         (partial filter)
         (update p 1))))

(defn- unzip-2
