Created
July 22, 2011 19:57
-
-
Save michaelbarton/1100283 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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