-
Notifications
You must be signed in to change notification settings - Fork 10
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
propagate mcols() through setOps where possible #12
Comments
Unfortunately this idea doesn't apply to
This is because the ranges in the input object are conceptually reduced before the intersection is computed i.e. everything happens as if This idea doesn't apply to |
Ah, good point. Could/should there be a separate method for NormalRanges that does this propagation? If I'm understanding correctly, the funny business arises only in situations where the inputs aren't normal? |
If the maintainers believe this is a good idea, I'll be happy to take a stab at it. |
Sounds good to me. Just to clarify, we want to propagate the metadata columns from the left input object ( |
You're very welcome -- the IRanges package has been extremely useful to me. |
One more thing, and this is just to put as much things as possible on the table, I should mention that |
Just an idea -- where possible, propagate mcols().
For example,
mcols(c(a,b)) = rbind(mcols(a), mcols(b))
(IRanges already does this)
mcols(intersect(a,b))[i, ] = cbind(mcols(a)[j, ], mcols(b)[k, ])
where j is the row in a that gave rise to row i in the intersect and k is the same for b.
mcols(setdiff(a, b))[i, ] = mcols(a)[j, ]
where j is the row in a that gave rise to row i in the setdiff.
I don't think this idea applies to union, since a single output row doesn't necessarily map back to a single row in each input IRanges.
I think similar logic could apply to findOverlaps methods.
The text was updated successfully, but these errors were encountered: