tidyomics / genomics-todos

0 stars 0 forks source link

`plyranges`: facilitate adding metadata columns via `join_mcols_*` #10

Open mikelove opened 1 year ago

mikelove commented 1 year ago

Currently, for GRanges x, to add metadata to mcols(x) one must do:

mcols(x) <- mcols(x) |>
  as_tibble() |>
  left_join(extra_info)

This could be turned into a plyranges convenience function, join_mcols_*, with * being left or inner.

nahid18 commented 1 year ago

@mikelove this looks simple enough (I could be very wrong). I will explore the source code and if I can do it, I will assign myself

mikelove commented 1 year ago

I think it should be simple. You can make a PR by forking plyranges and working on a new feature branch, and then we can ping Stuart to see if he likes it.

isongjosiah commented 1 year ago

Hi, @nahid18 still working on this?

mikelove commented 1 year ago

There is a related work from tidySE to allow joins on DataFrames. See the project list, I think it’s @lambdamoses

isongjosiah commented 1 year ago

Thanks for the pointer, @mikelove - the issue seems to be completed. Did you mean the mcols support for GRange?

mikelove commented 1 year ago

Sorry — from phone — but I thought it would allow for join onto DataFrame such as rowData.

stemangiola commented 1 year ago

I believe we developed left join from DataFrama in tidy transcriptomics. Should be one of the challenges.

As a note: could left_join be the method extended here rather than creating a new method?