MSKCC-Epi-Bio / gnomeR

Package to wrangle and visualize genomic data in R
https://mskcc-epi-bio.github.io/gnomeR/
Other
26 stars 16 forks source link

Allow subset_by_frequency to calculate and subset by group frequency #305

Open karissawhiting opened 1 year ago

karissawhiting commented 1 year ago

Currently subset_by_frequency() will subset and only return alteration columns in your gene binary with > x% prevalence. Sometimes it's useful to calculate these frequency/inclusion cutoffs by keeping genes or alterations that are x% prevalent within a certain variable group like 5% prevalence in male OR female group instead of 5% overall.

I think the best way to include this is with a by argument:

gene_binary %>%
   subset_by_frequency(t = .1,  by = "sex")