get_variable_regions {ALPS} | R Documentation |
given a data.frame of genomic regions enrichments, the function returns the number of
variable regions across all samples. The resulting matrix can be directly used with PCAtools
or ComplexHeatmap
for further downstream explorative analysis e.g. unsupervised clustering
get_variable_regions(enrichments_df, log_transform = TRUE, scale = TRUE, num_regions = 500)
enrichments_df |
a data.frame o enrichments at genomic regions. Output of
|
log_transform |
logical, whether to log2 transform the counts, default |
scale |
logical, whether to |
num_regions |
number of variable regions to return, default |
a data.frame of scaled variable regions
mat <- matrix(sample.int(15, 9*100, TRUE), 9, 100) %>% as.data.frame() mat <- mat %>% tibble::rowid_to_column(var = 'start') %>% dplyr::mutate(end = start + 1000) %>% dplyr::mutate(chr = 'chr1') %>% dplyr::select(chr, start, end, dplyr::everything()) get_variable_regions(enrichments_df = mat, num_regions = 50)