Arcadia-Science / sourmashconsumr

Working with the outputs of sourmash in R
https://arcadia-science.github.io/sourmashconsumr/
Other
21 stars 3 forks source link

Refactor `read_gather` and `read_taxonomy_annotate` to specify col types and test `read_gather` #29

Closed taylorreiter closed 1 year ago

taylorreiter commented 1 year ago

Somehow I skipped writing tests for that function...which is not good. So now we have tests!

This PR also addresses #20 by specifying colnames and types explicitly. I think this is better because the sourmash gather (and therefore taxonomy) outputs grow more columns (but never lose columns) with new releases of sourmash sometimes, so I want to make sure we explicitly get the right data type. By default, this causes warnings when there are missing columns, so I wrote a handler that suppresses the specific warning message associated with this -- that way, the message that can be safely ignored is suppressed, but any other warning would still come through. I added lots of comments to the code about why I decided to do things this way too.

codecov-commenter commented 1 year ago

Codecov Report

Base: 80.52% // Head: 86.66% // Increases project coverage by +6.13% :tada:

Coverage data is based on head (9be8bd2) compared to base (355ccc7). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #29 +/- ## ========================================== + Coverage 80.52% 86.66% +6.13% ========================================== Files 6 6 Lines 303 375 +72 ========================================== + Hits 244 325 +81 + Misses 59 50 -9 ``` | [Impacted Files](https://codecov.io/gh/Arcadia-Science/sourmashconsumr/pull/29?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Arcadia-Science) | Coverage Δ | | |---|---|---| | [R/read\_sourmash\_outputs.R](https://codecov.io/gh/Arcadia-Science/sourmashconsumr/pull/29/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Arcadia-Science#diff-Ui9yZWFkX3NvdXJtYXNoX291dHB1dHMuUg==) | `100.00% <100.00%> (+17.64%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Arcadia-Science). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Arcadia-Science)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.