-
Notifications
You must be signed in to change notification settings - Fork 991
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
Fixed .shallow to consistently retain keys and indices. #2337
Conversation
Gets a problem on foverlaps test in travis that I don't get locally. Will need to investigate. |
Codecov Report
@@ Coverage Diff @@
## master #2337 +/- ##
==========================================
+ Coverage 91.09% 91.14% +0.05%
==========================================
Files 61 61
Lines 11785 11804 +19
==========================================
+ Hits 10735 10759 +24
+ Misses 1050 1045 -5
Continue to review full report at Codecov.
|
Initially, my local tests didn't include fOverlaps since genomicRanges was not installed. Now, everything should be fixed. |
… to logic changes only (concerns shallow and keys)
Closes #2336.
Keys and indices are retained correctly by shallow if
retain.key = TRUE
andcols != NULL
.The largest possible part of an index is retained.
If the original index was on x1, x2, x3, and `cols = c("x1", "x2"),
the shallow copy gets the same index for c("x1", "x2") (if there was a native index on x1 and x2, this is kept)
Tests have been added.
A benchmark (code at end of this post) shows that there is no negative speed impact:
The improved key retainment makes it possible to clean
setattr
calls infoverlaps.R
while still passing all tests.Code for benchmark