categorize_siteMethSt: Categorize Methylation Frequencies Based on Thresholds

View source: R/summaryStatistics.R

categorize_siteMethStR 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 to u_threshold.

  • 0.5 for partially methylated sites, where values are between u_threshold and m_threshold.

  • 1 for methylated sites, where values are larger or equal to m_threshold.

Usage

categorize_siteMethSt(data, u_threshold = 0.2, m_threshold = 0.8)

Arguments

data

A list structured as data[[tip]][[structure]], where tip corresponds to tree tips, and structure corresponds to each genomic structure (e.g., island/non-island).

u_threshold

A numeric value representing the upper bound for values to be classified as unmethylated (0). Default 0.2.

m_threshold

A numeric value representing the lower bound for values to be classified as methylated (1). Default 0.8.

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)

MethEvolSIM documentation built on April 12, 2025, 1:30 a.m.