-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BED reader/writer #73
Conversation
Codecov Report
@@ Coverage Diff @@
## master #73 +/- ##
==========================================
+ Coverage 82.8% 82.92% +0.12%
==========================================
Files 59 59
Lines 3774 3795 +21
Branches 410 409 -1
==========================================
+ Hits 3125 3147 +22
Misses 239 239
+ Partials 410 409 -1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Please fix a few trivial matters.
src/cljam/bed.clj
Outdated
@@ -67,6 +86,25 @@ | |||
(defn- serialize-bed | |||
"Serialize bed fields into string." | |||
[m] | |||
{:pre [(and (:chr m) (:start m) (:end m)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and
is not needed because all items in :pre
vector are combined with and
.
src/cljam/bed.clj
Outdated
(if-let [xs (:block-starts m)] (= (+ (last xs) (last (:block-sizes m))) (- (:end m) (:start m))) true) | ||
;; The final blockStart position plus the final blockSize value must equal chromEnd. | ||
(if-let [xs (:block-starts m)] (apply <= (mapcat (fn [a b] [a (+ a b)]) xs (:block-sizes m))) true) | ||
;; Blocks may not overlap. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a comment should be placed just before a related predicate.
{:pre [;; First 3 fields are required.
(:chr m) (:start m) (:end m)
;; The chromEnd base is not included in the display of the feature.
(< (:start m) (:end m))
...
]}
src/cljam/bed.clj
Outdated
(close [this] | ||
(.close ^Closeable (.writer this)))) | ||
|
||
(defn ^BEDReader reader [f] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add docstring. Also writer
.
567b21b
to
7b683d7
Compare
Thank you for the review! I've added a commit. |
Added reader/writer for BED file format.
We can now read/write BED file compressed with gzip and bzip2.