View source: R/summaryStatistics.R
compute_meanCor_i | R Documentation |
This function calculates the mean correlation of methylation states within island structures, allowing to exclude the shores.
compute_meanCor_i(
index_islands,
minN_CpG,
shore_length,
data,
sample_n,
categorized_data = FALSE
)
index_islands |
A vector containing the structural indices for islands. |
minN_CpG |
The minimum number of central CpGs required for computation. |
shore_length |
The number of CpGs at each side of an island to exclude (shores). |
data |
A list containing methylation states at tree tips for each genomic structure (island / non-island)
For a single tip: |
sample_n |
The number of tips (samples) to process. |
categorized_data |
Logical defaulted to FALSE. TRUE to skip redundant categorization when methylation states are represented as 0, 0.5, and 1. |
The function processes only islands with a minimum length equal to 2 * shore_length + minN_CpG
.
If none has minimum length, returns NA
A numeric value representing the mean correlation of methylation states in the central CpGs of islands.
# Example usage:
index_islands <- c(1, 2)
data <- list(
list(c(0, 1, 0.5, 1, 0.5, 0), c(0.5, 0.5, 1, 1, 0, 0)), # tip 1
list(c(1, 0, 1, 1, 0.5, 0), c(1, 1, 0.5, 0.5, 0, 1)) # tip 2
)
minN_CpG <- 2
shore_length <- 1
sample_n <- 2
compute_meanCor_i(index_islands, minN_CpG, shore_length, data, sample_n,
categorized_data = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.