tidyomics / plyranges

A grammar of genomic data transformation
https://tidyomics.github.io/plyranges/
137 stars 19 forks source link

[FEATURE REQUEST] mutate(across()) ? #110

Open jayoung opened 5 months ago

jayoung commented 5 months ago

Hi there,

I've been enjoying plyranges - thank you!

Would it be possible to add a mutate(across()) sort of functionality? (or maybe it already exists and I haven't found it)

I'm finding mutate(across()) very useful for mutating multiple columns of tibbles, and would love to do the same for GRanges objects. Right now I'm cheating by doing this sort of thing:

gr %>% 
  as.data.frame() %>% 
  mutate(across(starts_with("counts"), function(x) {log2(x)} )) %>% 
  as("GRanges")

Which isn't too bad really, but it might be nice to avoid going back and forth.

thanks!

Janet


Dr. Janet Young

Staff scientist, Malik lab http://research.fhcrc.org/malik/en.html

Division of Basic Sciences Fred Hutchinson Cancer Center