categorize_siteMethSt {MethEvolSIM} | R Documentation |
Categorize Methylation Frequencies Based on Thresholds
Description
This function categorizes the values in data[[tip]][[structure]]
into three categories:
-
0
for unmethylated sites, where values are smaller or equal tou_threshold
. -
0.5
for partially methylated sites, where values are betweenu_threshold
andm_threshold
. -
1
for methylated sites, where values are larger or equal tom_threshold
.
Usage
categorize_siteMethSt(data, u_threshold = 0.2, m_threshold = 0.8)
Arguments
data |
A list structured as |
u_threshold |
A numeric value representing the upper bound for values to be classified as unmethylated ( |
m_threshold |
A numeric value representing the lower bound for values to be classified as methylated ( |
Details
If any value in data[[tip]][[structure]]
is outside these categories, it is transformed based on the given thresholds.
Value
A transformed version of data
where each value is categorized as 0
(unmethylated), 0.5
(partially methylated),
or 1
(methylated).
Examples
data <- list(
list(c(0.1, 0.2, 0.02), c(0.05, 0.25, 0.15)), # tip 1
list(c(0.01, 0.7, 0.85), c(0.3, 0.1, 0.98)) # tip 2
)
transformed_data <- categorize_siteMethSt(data, u_threshold = 0.2, m_threshold = 0.8)