Get n top region from result of find_DMR function.

get_top(data, n, stats)

Arguments

data

dataframe from output of find_DMR function with given method

n

number of regions to return

stats

data.frame with basic statisics about region. This is result of running get_stats function

Value

data.frame with n top region with their basic statistics

Examples

data('schizophrenia') control <- schizophrenia %>% filter(category == 'control') %>% dplyr::select(-category) disease <- schizophrenia %>% filter(category == 'disease') %>% dplyr::select(-category) data <- preprocessing(control, disease) data.tiles <- create_tiles_max_gap(data, gaps.length = 100) data.tiles.small <- data.tiles %>% filter(tiles < 30) stats <- get_stats(data.tiles.small) dmr <- find_DMR(data.tiles.small, c('Wilcoxon', 'Ttest', 'KS', 'Reg.Log', 'Reg.Mixed', 'Reg.Corr.Mixed'))
#> [1] "Started: Finding DMR by Wilcoxon test" #> [1] "Started: Finding DMR by t-test" #> [1] "Started: Finding DMR by KS test" #> [1] "Started: Finding DMR by Logistic Regression" #> [1] "Started: Finding DMR by Logistic Regression with Mixed Effects" #> [1] "Started: Finding DMR by Logistic Regression with Mixed Effects with Correlation Matrix" #> |====================== | 41% ~3 s remaining |======================== | 45% ~3 s remaining |========================== | 48% ~3 s remaining |=============================== | 59% ~2 s remaining |===================================== | 69% ~1 s remaining |======================================= | 72% ~1 s remaining |======================================== | 76% ~1 s remaining |============================================ | 83% ~1 s remaining |============================================== | 86% ~1 s remaining |================================================ | 90% ~0 s remaining |======================================================|100% ~0 s remaining
get_top(find_DMR$Wilcoxon, 3, stats)
#> Error in find_DMR$Wilcoxon: object of type 'closure' is not subsettable
get_top(find_DMR$Reg.Log, 3, stats)
#> Error in find_DMR$Reg.Log: object of type 'closure' is not subsettable