Skip to content

Instantly share code, notes, and snippets.

@michaelbarton
Created July 22, 2011 19:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save michaelbarton/1100283 to your computer and use it in GitHub Desktop.
Save michaelbarton/1100283 to your computer and use it in GitHub Desktop.
(use '[clojure.java.io :only [reader]])
(use '[clojure.string :only [split]])
(defrecord Read
[id status
pos-contig pos-position pos-strand
neg-contig neg-position neg-strand])
(defn split-line [x]
(split x #"\t")
)
(defn record [x]
(Read. ~@(split-line x))
)
(println
(take 3
(map record
(rest ; Ignore the header line
(line-seq
(reader "data/read_status.tab")
)
)
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment