get_meanMeth_islands: Compute the Mean Methylation of CpG Islands

View source: R/summaryStatistics.R

get_meanMeth_islandsR Documentation

Compute the Mean Methylation of CpG Islands

Description

This function calculates the mean methylation level for CpG islands across all tree tips.

Usage

get_meanMeth_islands(index_islands, data)

Arguments

index_islands

A numeric vector specifying the indices of genomic structures corresponding to islands.

data

A list containing methylation states at tree tips for each genomic structure (e.g., island/non-island). The data should be structured as data[[tip]][[structure]], where each tip has the same number of structures, and each structure has the same number of sites across tips.

Value

A list where each element corresponds to a tree tip and contains a numeric vector representing the mean methylation levels for the indexed CpG islands.

Examples

# Example data setup

data <- list(
  # Tip 1
  list(rep(1,10), rep(0,5), rep(1,8)),
  # Tip 2
  list(rep(1,10), rep(0.5,5), rep(0,8))
)

index_islands <- c(1,3)

get_meanMeth_islands(index_islands, data)


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