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

Easy access to inner metadata of a GRangesList #6

Open
LTLA opened this issue Mar 9, 2018 · 7 comments
Open

Easy access to inner metadata of a GRangesList #6

LTLA opened this issue Mar 9, 2018 · 7 comments

Comments

@LTLA
Copy link

LTLA commented Mar 9, 2018

I was playing around with the grl GRangesList object from example(GRangesList), and it wasn't clear to me how to access the inner metadata. The best I could find was:

relist(unlist(grl)$score, grl)

... which does what I want (extracting the metadata while it is still grouped by the grl) but was not particularly obvious to me. I'm surprised that there is no inner.mcols function, or an inner=TRUE argument to mcols, or something more convenient, given that accessing inner metadata seems like a fairly common operation. Of course, it's entirely possible that I've just missed it.

@lawremi
Copy link
Contributor

lawremi commented Mar 9, 2018

You did miss it:

mcols(grl, level="within")

I guess the real issue is that it's so hard to find...

@LTLA
Copy link
Author

LTLA commented Mar 9, 2018

Thanks Mike, mcols(grl, level="within")[,"score"] gets me what I want.

That was... very well hidden, ?GRangesList doesn't give any hint about it.

@hpages
Copy link
Contributor

hpages commented Mar 9, 2018

Is this actually documented somewhere? Can't find it (except by looking at the code in R/GRangesList-class.R. I think this has been around for at least 8 years or more. BTW the names chosen to refer to the outer and inner mcols ("between" and "within", respectively) are not intuitive. Also there is no reason why only GRangesList and GAlignmentsList objects would support this. So I'm going to revisit this a little bit.

@lawremi
Copy link
Contributor

lawremi commented Mar 9, 2018

@hpages OK, I thought it was your thing. I guess it was Patrick's. I found it by accident a couple years ago.

@hpages
Copy link
Contributor

hpages commented Mar 9, 2018

@lawremi Since we got your attention here, can you please take a look at Bioconductor/S4Vectors#10 ? Thanks!

@mtmorgan
Copy link
Contributor

Is this issue ready to be closed?

@lshep lshep closed this as completed Apr 13, 2018
@hpages
Copy link
Contributor

hpages commented Oct 22, 2019

Not sure why this was closed.

@hpages hpages reopened this Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants