                                    start (as-long start)
                                    end (dec (+ start span))
                                    value (str->wiggle-track-data value)]
-                               {:format :variable-step, :chr chr, :start start, :end end, :value value})
+                               {:format :variable-step
+                                :chr chr
+                                :start start
+                                :end end
+                                :value value})
 
                              :fixed-step
                              (let [{:keys [chr pre-start span step]} current-track
                                    start (+ pre-start step)
                                    end (dec (+ start span))
                                    value (-> fields first str->wiggle-track-data)]
-                               {:format :fixed-step, :chr chr, :start start, :end end, :value value})
-
-                             (throw (IllegalArgumentException. "Invalid wiggle format")))]
+                               {:format :fixed-step
+                                :chr chr
+                                :start start
+                                :end end
+                                :value value})
+
+                             (throw
+                               (IllegalArgumentException.
+                                 "Invalid wiggle format")))]
                      (cons m (deserialize (rest lines)
-                                          (update current-track :pre-start (fn [_] (:start m)))))))))))]
-    (deserialize lines {:format nil, :chr nil, :pre-start nil, :span nil :step nil})))
+                                          (assoc current-track
+                                                 :pre-start
+                                                 (:start m))))))))))]
+    (deserialize lines {:format nil
+                        :chr nil
+                        :pre-start nil
+                        :span nil
+                        :step nil})))
 
 (defn- serialize-wigs
   "Serialize a sequence of WIG fields into a lazy sequence of string."

  {:pre [;; These fields are required.
         (map (fn [wig] (every? some? ((apply juxt wig-fields) wig))) wigs)
         ;; There are two options for formatting wiggle data.
         (map (fn [{:keys [format]} wig] (or (= format :fixed-step) (= format :variable-step))) wigs)]}
  (letfn [(same-track? [first-wig wig]
            (and (= (:format first-wig) (:format wig))
                 (= (- (:end first-wig) (:start first-wig))

  (update m :chr chr/normalize-chromosome-key))

(defn- fields->map
  "Convert vector [\"key1=value1\" \"key2=value2\" ...] to map
  {:key1 \"value1\" :key2 \"value2\" ...}."
  [fields]
  (into {}
        (map (fn [field]
