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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix I/O of variants with empty info/individual fields #167

Merged
merged 4 commits into from Jun 21, 2019

Conversation

alumi
Copy link
Member

@alumi alumi commented Jun 20, 2019

Summary

This PR fixes three minor bugs in VCF/BCF I/O

  1. Writing :info {} does not emit . (VCF)
    {:chr "2", :pos 2, :ref "N", :info {}}
    "2\t2\t.\tN\t.\t.\t.\t.\t.\t.\t.\n"
  2. Writing a variant map without samples will cause a NPE (VCF)
    {:chr "6", :pos 6, :ref "N", :info {:XA "6"}, :FORMAT [:XB], :SAMPLE01 {}}
    "6\t6\t.\tN\t.\t.\t.\tXA=6\tXB\t.\t.\n")))
  3. Omitted genotype fields are totally ignored (VCF/BCF)
    e.g. Reading DP:HQ 4:51,51 2 does not assoc :HQ nil to the 2nd sample.
    :FORMAT [:GT :GQ :DP :HQ],
    :NA00001 {:GT "1|2", :GQ 21, :DP 6, :HQ [23 27]},
    :NA00002 {:GT "2|1", :GQ 2, :DP 0, :HQ [18 2]},
    :NA00003 {:GT "2/2", :GQ 35, :DP 4, :HQ nil}}

Tests

  • lein check 🆗
  • lein test :all 🆗
  • lein cloverage 🆗
  • lein eastwood 🆗

@alumi alumi added the bug label Jun 20, 2019
@alumi alumi requested review from a team and removed request for a team June 20, 2019 04:53
@ghost ghost requested review from athos and r6eve and removed request for a team June 20, 2019 05:08
@codecov
Copy link

codecov bot commented Jun 20, 2019

Codecov Report

Merging #167 into master will increase coverage by 0.02%.
The diff coverage is 93.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #167      +/-   ##
==========================================
+ Coverage   86.51%   86.53%   +0.02%     
==========================================
  Files          73       73              
  Lines        5619     5624       +5     
  Branches      492      491       -1     
==========================================
+ Hits         4861     4867       +6     
  Misses        266      266              
+ Partials      492      491       -1
Impacted Files Coverage Δ
src/cljam/io/vcf/util.clj 92.85% <100%> (+0.54%) ⬆️
src/cljam/io/bcf/reader.clj 92.52% <75%> (ø) ⬆️

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 3e8dc0c...a455eac. Read the comment docs.

Copy link
Member

@athos athos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@athos athos assigned r6eve and unassigned athos Jun 20, 2019
src/cljam/io/vcf/writer.clj Outdated Show resolved Hide resolved
@alumi alumi requested a review from a team June 21, 2019 00:53
@ghost ghost requested review from r6eve and yito88 and removed request for a team June 21, 2019 00:53
@alumi alumi removed the request for review from yito88 June 21, 2019 00:54
Copy link
Contributor

@r6eve r6eve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for the consideration.

@r6eve r6eve merged commit 9e70654 into master Jun 21, 2019
@r6eve r6eve deleted the fix/empty-info-indiv branch June 21, 2019 03:02
@alumi
Copy link
Member Author

alumi commented Jun 21, 2019

Thank you for reviewing @athos @r6eve! 😃

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

3 participants