         options-summary]
        (string/join \newline)))
 
+
 (defn error-msg [errors]
   (str "The following errors occurred while parsing your command:\n\n"
        (string/join \newline errors)))
 
+
 (defn exit [status msg]
   (println msg)
   (System/exit status))
 
+
 (def default-minlen 0)
+
 
 (def cli-options
   [[nil "--minlen N" "Minimum length sequence to include in stats"

   :min-sequence-length nil
   :max-sequence-length nil})

(defn update-stats
  "Update stats accumulator with information from the next sequence"
  [stats record]
  (let [{:keys [num-sequences num-bases min-sequence-length max-sequence-length]} stats
        sequence (:sequence record)
        sequence-length (count sequence)]
       {:num-sequences (inc num-sequences) 
        :num-bases (+ num-bases sequence-length)
        :min-sequence-length (if min-sequence-length
                                 (min min-sequence-length sequence-length)
                                 sequence-length)
        :max-sequence-length (if max-sequence-length
                                 (max max-sequence-length sequence-length)
                                 sequence-length)}))

(defn print-results
  "Display the computed stats in pretty fashion on the standard output"
  [filename stats]
  (let [{:keys [num-sequences num-bases min-sequence-length max-sequence-length]} stats
        average (if (> num-sequences 0)

          (if min-sequence-length (str min-sequence-length) "-")
        max-sequence-length-str
          (if max-sequence-length (str max-sequence-length) "-")
        ;; Output fields are tab separated.
        output-str (str filename "\t"
                        num-sequences-str "\t"
                        num-bases-str "\t"
