Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing SAM header values containing ':'. #123

Merged
merged 1 commit into from Dec 7, 2017
Merged

Conversation

alumi
Copy link
Member

@alumi alumi commented Dec 6, 2017

Summary

Don't discard substring after second : when parsing SAM header.

Problem

Complex SAM headers can be modified unexpectedly.

input sam
@SQ	SN:A:B;100-200;++;chr1:100-200	LN:400
output sam
@SQ	SN:A	LN:400

Cause

(clojure.string/split "SN:A:B;100-200;++;chr1:100-200" #":")
; => ["SN" "A" "B;100-200;++;chr1" "100-200"]

clojure.string/split with 2 args splits given string at all ocurrence of the regex.

Changes

Pass 2 as 3rd arg (limit) of clojure.string/split.

Affects

SAM/BAM I/O

Tests

  • lein test :all 馃啑

@alumi alumi added the bug label Dec 6, 2017
@alumi alumi requested a review from totakke December 6, 2017 10:00
@codecov
Copy link

codecov bot commented Dec 6, 2017

Codecov Report

Merging #123 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #123   +/-   ##
=======================================
  Coverage   84.81%   84.81%           
=======================================
  Files          62       62           
  Lines        4196     4196           
  Branches      415      415           
=======================================
  Hits         3559     3559           
  Misses        222      222           
  Partials      415      415
Impacted Files Coverage 螖
src/cljam/io/sam/util.clj 89.58% <100%> (酶) 猬嗭笍

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update 8549f46...1b81476. Read the comment docs.

@totakke totakke merged commit 649204b into master Dec 7, 2017
@totakke totakke deleted the fix/sam-header branch December 7, 2017 08:03
@totakke
Copy link
Member

totakke commented Dec 7, 2017

Thank you 馃槃

@alumi
Copy link
Member Author

alumi commented Dec 7, 2017

Thank you for reviewing! 馃樃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants