Ribosomal DNA (rDNA) consists of repetitive genomic sequences that encode ribosomal RNA (rRNA), an essential structural and functional component of ribosomes. The organisation, copy number and epigenetic regulation of rDNA are important determinants of ribosome biogenesis and cellular protein synthesis.
Variation in rDNA copy number and DNA methylation has been investigated in the context of ageing, cellular differentiation, disease and changes in cellular metabolic activity. However, the repetitive organisation of rDNA presents substantial challenges for conventional sequencing and bioinformatics approaches, particularly when estimating copy number or analysing DNA methylation.
myoRDNA is an R package developed by MuscleOmicsLab to
facilitate the analysis of rDNA copy number and DNA methylation using
high-throughput sequencing data.
The package provides a collection of functions for extracting rDNA-specific data, estimating copy number, calculating methylation levels and identifying differential methylation between experimental conditions.
myoRDNA provides tools for four principal analytical
tasks:
rDNA data extraction and preprocessing: Identifying rDNA-associated sequencing data, extracting genomic regions of interest and adjusting genomic coordinates.
rDNA copy-number estimation: Estimating relative and absolute rDNA copy number using sequencing coverage.
DNA methylation analysis: Quantifying methylation levels at individual CpG sites and across predefined rDNA regions.
Differential methylation analysis: Comparing methylation between experimental conditions using statistical models, including binomial and beta-binomial regression.
These functions are designed to support reproducible analyses and
integrate with established R and Bioconductor packages, including
methylKit and GenomicRanges.
The development version of myoRDNA is available from
GitHub and can be installed using the remotes package.
install.packages("remotes")
remotes::install_github(
"MuscleOmicsLab/myoRDNA",
dependencies = TRUE
)Load the package using:
A typical analysis begins with aligned sequencing data that have undergone appropriate quality control and preprocessing. For how to construct the adapted genomes to extract methylation data for rDNA please visit the paper by Vaughan et al.
For DNA methylation analysis, methylated and unmethylated read counts
can be imported into R using methylKit. The resulting
objects provide the basis for downstream analyses implemented in
myoRDNA. The exact preprocessing requirements depend on the
sequencing technology, reference genome and experimental design.
This section demonstrates how to import and prepare DNA methylation
data for analysis using myoRDNA.
We use an example mouse whole-genome bisulfite sequencing (WGBS)
dataset comprising ten samples from two experimental groups: six old
mice (OLD) and four young mice (YOUNG). For additional information about
the original dataset and experimental methodology, see the original
publication. In this document we make no conclusions about the data,
it is simply being used to demonstrate myoRDNA and the
dataset has been reduced as a result.
The example data are distributed with myoRDNA in the
inst/extdata directory.
We use system.file() to retrieve the location of the
dataset within the installed package. This approach ensures that the
example works regardless of where the package is installed.
library(myoRDNA)
library(methylKit)
#> Loading required package: GenomicRanges
#> Loading required package: stats4
#> Loading required package: BiocGenerics
#> Loading required package: generics
#>
#> Attaching package: 'generics'
#> The following objects are masked from 'package:base':
#>
#> as.difftime, as.factor, as.ordered, intersect, is.element, setdiff,
#> setequal, union
#>
#> Attaching package: 'BiocGenerics'
#> The following objects are masked from 'package:stats':
#>
#> IQR, mad, sd, var, xtabs
#> The following object is masked from 'package:utils':
#>
#> data
#> The following objects are masked from 'package:base':
#>
#> anyDuplicated, aperm, append, as.data.frame, basename, cbind,
#> colnames, dirname, do.call, duplicated, eval, evalq, Filter, Find,
#> get, grep, grepl, is.unsorted, lapply, Map, mapply, match, mget,
#> order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
#> rbind, Reduce, rownames, sapply, saveRDS, scale, sequence, table,
#> tapply, transform, unique, unsplit, which.max, which.min
#> Loading required package: S4Vectors
#>
#> Attaching package: 'S4Vectors'
#> The following object is masked from 'package:utils':
#>
#> findMatches
#> The following objects are masked from 'package:base':
#>
#> expand.grid, I, unname
#> Loading required package: IRanges
#> Loading required package: Seqinfo
file_path <- system.file(
"extdata",
"filtered_meth_raw_chr1_chrRDNAm_small.rds",
package = "myoRDNA",
mustWork = TRUE
)
loaded_data <- readRDS(file_path)The RDS file contains previously processed methylation data from
chromosome 1 and the rDNA chromosome (chrRDNAm). The
underlying data retain information about methylation coverage,
methylated read counts, unmethylated read counts and genomic
positions.
As the data have already been processed and saved, users do not need to repeat the original sequencing alignment and methylation extraction procedures to follow this tutorial.
The dataset contains six OLD samples and four YOUNG samples. We define a binary treatment vector to distinguish these experimental groups:
0: OLD1: YOUNGThe order of the treatment assignments must correspond exactly to the
order of the samples in loaded_data.
This is a necessary component required for interacting with
methylKit and this can be simply carried over for use in
myoRDNA. The number of samples needs to be a numeric value
and should be either the number of samples in the whole dataset or
across two different conditions. We also define a named list containing
the sequencing accession numbers associated with each condition.
samples <- list(
'OLD' = c(
"SRR28431752", "SRR28431753", "SRR28431754", "SRR28431755",
"SRR28431756", "SRR28431757"
),
'YOUNG' = c(
"SRR28431748", "SRR28431749", "SRR28431750", "SRR28431751"
)
)This is an important structure and needs to be of the same format as
shown above for tracking samples when comparing rDNA metrics (such as
copy number and aggregate methylation proportion) in the later steps.
Please ensure that the sample ids match the sample ids for the
corresponding data in methylKit, otherwise output will be
NULL.
This step is only necessary for following along and using the
rds data from the myoRDNA, if the user is
using these features directly interfacing with the
methylKit object than this isn’t needed.
We construct a methylRawList object by combining the
individual sample objects with their treatment assignments.
stopifnot(length(loaded_data) == length(treatment))
loaded_data <- methods::new(
"methylRawList",
loaded_data,
treatment = treatment
)A methylRawList stores the methylation measurements from
multiple samples alongside their experimental group assignments. This
structure allows methylation data to be processed consistently across
samples and enables subsequent comparisons between experimental
conditions.
The example dataset includes methylation measurements from chromosome 1 and the rDNA chromosome.
We use get_rDNA_data() to extract only the measurements
associated with the rDNA chromosome.
The rDNA_chr_name argument specifies the chromosome
identifier used in the adapted reference genome.
In this example, the mouse rDNA chromosome is named
chrRDNAm. This identifier must match the chromosome name in
the original methylation data.
The resulting meth_rDNA object contains the
rDNA-associated methylation measurements for all ten samples, preserving
the information required for downstream analysis. If the name of the
chromosome associated with rDNA is not known (in this case
chrRDNAm) the user can make use of the identify unique
chromosomes.
This returns an array with the unique chromosome names that are included, additionally it performs a check to verify that all samples have consistent chromosome names.
Depending on how the adapted reference genome was constructed, rDNA genomic coordinates may require adjustment to correspond to the reference sequence used for downstream analysis.
The shifting() function applies a common coordinate
transformation to the selected rDNA data.
First, we specify the coordinate cutoff:
We then apply the coordinate shift:
The function identifies the maximum genomic start position across the input samples and calculates the shift as
\[ s = x_{\max} - c, \] where \(x_{\max}\) denotes the maximum genomic start position and \(c\) is the user-defined cutoff. The transformed genomic coordinates are
\[
x_{\mathrm{shifted}} = x_{\mathrm{original}} - s.
\] The same transformation is applied to the start and end
positions of every retained methylation record. Records falling outside
the permitted coordinate range are removed, and the transformed data are
returned as a methylRawList containing the original
treatment assignments.
The cutoff of 35,000 is specific to the adapted reference used in this example. Users analysing data generated with a different reference should select an appropriate cutoff based on their reference sequence and coordinate convention. The shifting is specific to the human and mouse genome, not enough is known about rDNA contig in the rat for this shifting.
The need for shifting is obvious when plotting the numCs
against genomic position. The activity will start just after genomic
position at the point \(s\). The
shifting is vital for regional analysis of the 18S for differential
methylation. However, functions surrounding the rDNA copy number will
produce an interpretative result without shifting.
Ribosomal DNA (rDNA) is organised into tandemly repeated units, and the number of these repeats can vary between individuals and experimental conditions. Estimating rDNA copy number provides a means of investigating variation in rDNA abundance across biological samples.
myoRDNA provides two functions for estimating rDNA copy
number:
relative_rDNA_CN(): Estimates relative rDNA copy number
using sequencing coverage.absolute_rDNA_CN(): Estimates absolute rDNA copy number
by normalising rDNA coverage against genomic coverage and accounting for
genome ploidy.These estimators have different sequencing requirements.
| Sequencing method | Relative copy number | Absolute copy number |
|---|---|---|
| Whole-genome bisulfite sequencing (WGBS) | Yes | Yes |
| Reduced-representation bisulfite sequencing (RRBS) | Yes | No |
Absolute copy-number estimation is restricted to WGBS in
myoRDNA, as it requires a genome-wide coverage reference.
RRBS enriches selected genomic fragments, which makes its sequencing
coverage unsuitable for directly estimating absolute genomic copy
number.
Relative copy-number estimates can be obtained from either WGBS or RRBS, although comparisons should be restricted to samples generated using compatible sequencing and preprocessing protocols.
The absolute rDNA copy-number estimator uses the ratio of rDNA sequencing coverage to reference genomic coverage.
For a diploid genome, the estimator is defined as
\[ \boxed{ CN_{\mathrm{absolute}} = 2 \times \frac{\overline{C}_{\mathrm{rDNA}}} {\overline{C}_{\mathrm{genome}}} } \]
where:
For a haploid genome, the estimator becomes
\[ CN_{\mathrm{absolute}} = \frac{\overline{C}_{\mathrm{rDNA}}} {\overline{C}_{\mathrm{genome}}}. \]
More generally, for a genome with reference ploidy \(P\),
\[ CN_{\mathrm{absolute}} = P \times \frac{\overline{C}_{\mathrm{rDNA}}} {\overline{C}_{\mathrm{genome}}}. \]
The current implementation supports diploid (\(P=2\)) and non-diploid (\(P=1\)) calculations.
We use the previously loaded mouse WGBS dataset to demonstrate absolute rDNA copy-number estimation.
absolute_CN <- absolute_rDNA_CN(
Meth_object = loaded_data,
num_samples = num_samples,
autosomes = TRUE,
rDNA_chr = "chrRDNAm",
diploid = TRUE
)The function accepts the following arguments:
Meth_object: The methylation dataset containing both
rDNA and genomic reference coverage.num_samples: The number of samples to analyse.autosomes: Specifies whether autosomal coverage should
be used as the genomic reference.rDNA_chr: The chromosome identifier corresponding to
the rDNA reference sequence.diploid: Specifies whether to multiply the coverage
ratio by two.For this example, diploid = TRUE accounts for the
diploid mouse genome, and rDNA_chr = "chrRDNAm" identifies
the rDNA reference in the adapted genome.
The resulting copy-number estimates can be inspected using:
absolute_CN
#> Sample_ID Genome_Depth rDNA_Depth Absolute_rDNA_CN
#> 1 SRR28431752 3.3421 27.04982 16.18732
#> 2 SRR28431753 2.8245 28.40987 20.11675
#> 3 SRR28431754 5.8205 68.65034 23.58916
#> 4 SRR28431755 4.4878 57.31855 25.54416
#> 5 SRR28431756 3.6623 26.87927 14.67890
#> 6 SRR28431757 3.8956 38.12884 19.57534
#> 7 SRR28431748 3.7810 38.35561 20.28860
#> 8 SRR28431749 3.3540 56.07577 33.43815
#> 9 SRR28431750 4.0604 62.75377 30.91014
#> 10 SRR28431751 3.9073 65.39894 33.47526Additionally a readout should appear with results for inspection. These estimates should be interpreted with consideration of reference-genome composition, sequencing coverage, alignment ambiguity and potential biases associated with mapping reads to repetitive rDNA sequences.
Relative rDNA copy number provides a normalised measure of rDNA
abundance that can be used to compare samples processed using compatible
sequencing protocols. Unlike absolute copy-number estimation, relative
estimation is supported for both WGBS and RRBS data in
myoRDNA.
The relative estimator is calculated using the ratio of summed rDNA coverage to summed genomic reference coverage:
\[ \boxed{ CN_{\mathrm{relative}} = \frac{\displaystyle\sum_{i=1}^{N_r} C_{\mathrm{rDNA},i}} {\displaystyle\sum_{j=1}^{N_g} C_{\mathrm{genome},j}} } \]
where:
The numerator and denominator therefore represent the total coverage across the rDNA and genomic reference positions used by the estimator. Unlike the absolute estimator, the relative estimator does not apply a diploidy correction in the current implementation.
The following example calculates relative rDNA copy number for the previously loaded mouse WGBS dataset.
relative_CN <- relative_rDNA_CN(
Meth_object = loaded_data,
num_samples = num_samples,
autosomes = TRUE,
rDNA_chr = "chrRDNAm",
diploid = TRUE
)The arguments are analogous to those used for
absolute_rDNA_CN(). Although diploid = TRUE is
accepted, the current implementation calculates the same relative
coverage ratio regardless of this argument. The resulting estimates can
be inspected using:
relative_CN
#> Sample_ID Total_Number_of_Reads Number_of_Reads_rDNA Relative_rDNA_CN
#> 1 SRR28431752 33421 91753 2.745370
#> 2 SRR28431753 28245 97247 3.442981
#> 3 SRR28431754 58205 250917 4.310918
#> 4 SRR28431755 44878 205487 4.578791
#> 5 SRR28431756 36623 88836 2.425689
#> 6 SRR28431757 38956 134061 3.441344
#> 7 SRR28431748 37810 133746 3.537318
#> 8 SRR28431749 33540 202041 6.023882
#> 9 SRR28431750 40604 224533 5.529825
#> 10 SRR28431751 39073 234586 6.003788The same function can also be applied to appropriately prepared RRBS methylation data. However, because RRBS preferentially captures particular genomic fragments, its relative estimates depend on the targeted regions and their representation in the sequencing data. Consequently, relative copy-number estimates from RRBS and WGBS should not be assumed to be directly interchangeable.
Several factors should be considered when interpreting rDNA copy-number estimates. First, the repetitive nature of rDNA introduces potential alignment ambiguity. Reads derived from different rDNA repeat units will align to the same reference sequence.
Second, sufficient sequencing coverage is required to obtain stable estimates. In particular, absolute copy-number estimation depends on having a suitable genomic reference against which rDNA coverage can be normalised. This can become particularly difficult with PBAT which typically provides lower alignment rates.
Finally, the adapted reference genome and chromosome identifiers must be consistent with those used during sequencing alignment and methylation extraction. For reproducible analyses, users should document the reference genome, coverage-filtering thresholds, sequencing methodology and genomic regions used for normalisation.
The ribosomal DNA (rDNA) repeat contains several distinct functional regions, including the sequences encoding ribosomal RNA and the internal and external transcribed spacers.
DNA methylation may vary across these regions. Consequently, analysing methylation across the entire rDNA repeat may obscure region-specific variation.
myoRDNA provides functions to partition rDNA methylation
data into predefined genomic regions and calculate aggregate methylation
metrics for individual samples and experimental conditions.
The sort_by_rDNA_region() function separates methylation
measurements into their corresponding rDNA regions using predefined
genomic coordinates.
The package supports the following reference assemblies:
| Species | Reference assembly |
|---|---|
| Mouse | mm39 |
| Rat | rno7 |
| Human | hg38 |
For the example mouse WGBS dataset, we use the mm39
reference assembly.
region_res <- sort_by_rDNA_region(
meth_rDNA,
num_samples,
species = "mm39",
min_cov = 10
)
#> Species selected: mm39The species argument specifies the reference assembly
used to identify the rDNA regions. Users analysing rat or human data
should specify rno7 or hg38, respectively.
The min_cov argument defines the minimum sequencing
coverage required for a CpG position to be retained. In this example,
CpG positions with fewer than ten sequencing reads are excluded.
The resulting region_res object organises methylation
measurements by sample and rDNA region, allowing downstream calculations
to be performed independently for each region. ### rDNA regions
Depending on the reference assembly, rDNA measurements can be assigned to the following annotated regions:
These regions can be analysed individually to investigate spatial
variation in rDNA methylation. It is important to note that the human
and mouse have all regions in the list above. However, the rate is
limited to the 18S, 28S, and
5.8S.
Following regional partitioning, the
calculate_aggregate_meth() function can be used to
summarise methylation measurements within each rDNA region.
For this example, we calculate aggregate methylation for the 18S region.
region <- "18S"
aggregate_18S <- calculate_aggregate_meth(
region_res,
region,
conditions = samples,
med = FALSE
)The region argument specifies the rDNA region to
analyse, while conditions associates samples with their
experimental groups.
The med argument controls the choice of summary
statistic. In the mean-based calculation shown here, it is set to
FALSE.
The resulting object contains aggregate methylation measurements for the selected region, organised according to the supplied experimental conditions.
Let \(N_{C,i}\) and \(N_{T,i}\) denote the methylated and unmethylated read counts, respectively, at CpG position \(i\) within a selected rDNA region.
The sequencing coverage at that position is
\[ C_i = N_{C,i} + N_{T,i}. \]
The methylation proportion at each retained CpG position is defined as
\[ p_i = \frac{N_{C,i}} {N_{C,i}+N_{T,i}}. \]
Only CpG positions satisfying the specified minimum coverage threshold are included in the aggregation.
The arithmetic mean methylation proportion across a region is
\[ \boxed{ \overline{p}_R = \frac{1}{N_R} \sum_{i=1}^{N_R}p_i } \] where \(N_R\) denotes the number of retained CpG positions in region \(R\).
This metric assigns equal weight to every retained CpG position,
regardless of its individual sequencing coverage. Currently there is no
coverage weighted calculation for the methylation proportion in
myoRDNA, if the user needs such a metric this has to be
inputted manually.
An alternative summary statistic is the median methylation proportion:
\[ \boxed{ \widetilde{p}_R = \operatorname{median} \left(p_1,p_2,\ldots,p_{N_R}\right) } \] The median describes the central tendency of the CpG methylation proportions and is less sensitive to extreme values than the arithmetic mean. However, a sensible approach is to review both and determine if there is a significant difference.
Regional methylation measurements can subsequently be compared between experimental conditions to investigate differences in the epigenetic regulation of rDNA.
The repetitive organisation of ribosomal DNA (rDNA) presents several challenges for differential methylation analysis. Individual rDNA repeat units can exhibit heterogeneous methylation patterns, while sequence similarity between repeats can introduce ambiguity during read alignment.
Consequently, methylation measurements may exhibit greater variability than predicted by conventional binomial models. This phenomenon, known as overdispersion, can lead to underestimated standard errors and potentially inflated statistical significance if it is not appropriately considered.
To accommodate different levels of variability, myoRDNA
supports three statistical approaches:
glm().glm().glmmTMB.These models can be applied at two levels:
All three approaches use the same logistic regression formulation, but differ in their assumptions about the variance of methylation measurements.
This form of regression follows the same methodology as outlined by
methylKit and therefore, allows users to use the widely
reported and tested form of logistic regression. We recommend that any
user of myoRDNA implements the binomial method first and
move to quasi-binomial or beta-binomial once
they suspect that the \(p\)-values are
inflated.
Binomial logistic regression models the probability of methylation as a function of experimental condition. Let \(Y_i\) denote the number of methylated reads observed for sample \(i\), with sequencing coverage \(n_i\). The model assumes
\[ Y_i \sim \operatorname{Binomial}(n_i,p_i), \] where \(p_i\) is the underlying methylation probability. For two experimental conditions, the model is
\[ \operatorname{logit}(p_i) = \log\left(\frac{p_i}{1-p_i}\right) = \beta_0+\beta_1 T_i. \] Here, \(T_i=0\) represents the CONTROL condition and \(T_i=1\) represents the CONDITION_1 condition. Multiple condition differential methylation analysis has not been implemented yet.
The intercept \(\beta_0\) describes the log-odds of methylation in OLD samples, while \(\beta_1\) describes the difference in log-odds between YOUNG and OLD samples. The model assumes that the variance of the methylated read count is
\[ \operatorname{Var}(Y_i) = n_i p_i(1-p_i). \]
A limitation of the conventional binomial model is its assumption that the variance is completely determined by the methylation probability and sequencing coverage.
In biological datasets, additional variability may arise from differences between individuals, technical variation or heterogeneous methylation across rDNA repeats.
Quasi-binomial logistic regression accommodates this additional variation by introducing a dispersion parameter, \(\phi\).
The expected number of methylated reads remains
\[ \operatorname{E}(Y_i)=n_i p_i, \]
but the variance becomes
\[ \boxed{ \operatorname{Var}(Y_i) = \phi n_i p_i(1-p_i) } \] where \(\phi\) is the dispersion parameter.
The interpretation of \(\phi\) is as follows:
The dispersion parameter can be estimated using the Pearson’s chi-squared statistic:
\[ \widehat{\phi} = \frac{\chi^{2}}{n-p} \] The estimated dispersion parameter is used to adjust the variance-covariance matrix of the regression coefficients. For overdispersed data, this generally increases the standard errors and reduces the apparent statistical significance of treatment effects.
In myoRDNA, this model is implemented using the
quasibinomial() family within R’s glm()
function.
Important: Reliable dispersion estimation requires
sufficient residual degrees of freedom. Sites observed in very few
samples, particularly those with missing coverage, may not contain
enough information to estimate the dispersion parameter reliably. This
problem is more obvious in the beta-binomial logistic covered in the
next section. Currently, in myoRDNA when using the
quasi-binomial method there is no means of detecting how
successful the estimation for \(\hat{\phi}\) is.
Beta-binomial regression provides an alternative method for modelling overdispersed methylation data.
Rather than assuming that each sample has a fixed underlying methylation probability, the beta-binomial model allows this probability to vary according to a beta distribution.
For sample \(i\), let the underlying methylation probability be \(\theta_i\), such that
\[ \theta_i \sim \operatorname{Beta}(\alpha_i,\gamma_i). \]
Conditional on this probability, the number of methylated reads follows a binomial distribution:
\[ Y_i \sim \operatorname{BetaBinomial} (n_i,\alpha_i,\beta_i). \] The expected number of methylated reads is
\[
\operatorname{E}(Y_i)=n_i p_i,
\] In myoRDNA, the beta-binomial model is fitted
using the betabinomial(link = "logit") family provided by
glmmTMB.
Unlike quasi-binomial regression, beta-binomial regression specifies a complete likelihood, allowing maximum-likelihood estimation and likelihood-based statistical comparisons.
However, estimating both treatment effects and dispersion can be difficult when the number of biological replicates is small or methylation proportions exhibit little variation.
Site-level differential methylation identifies individual CpG positions that exhibit differences in methylation between experimental conditions.
For each genomic position, myoRDNA fits a separate
regression model using the methylated and unmethylated read counts
across samples.
Here, we analyse the 18S region of the previously prepared mouse WGBS dataset.
site_results <- diff_meth(
meth_data = meth_rDNA_shifted,
samples = samples,
species = "mm39",
num_samples = num_samples,
min_cov = 10,
region = "18S",
model_type = "binomial",
p_adjust_method = "BH",
site = TRUE
)
#> Species selected: mm39Setting site = TRUE performs the differential
methylation analysis independently at each retained CpG position.
The min_cov = 10 argument excludes measurements with
fewer than ten sequencing reads.
To use either of the alternative regression models, change the
model_type argument: binomial,
quasi-binomial, and beta-binomial.
Beta-binomial regression can be computationally more demanding, particularly when thousands of CpG positions are analysed independently. As a result of the algorithm requiring the use of optimisation to estimate parameters in the model.
Region-level differential methylation investigates differences across an entire annotated rDNA region, rather than fitting independent models at each CpG position.
For a selected region, the methylated and unmethylated read counts can be aggregated within each sample:
\[ M_{i,R} = \sum_{j \in R} N_{C,ij}, \]
\[ U_{i,R} = \sum_{j \in R} N_{T,ij}, \]
where \(R\) denotes the selected region. The aggregated counts are then used to estimate the association between methylation probability and experimental condition.
The following example performs region-level differential methylation for 18S.
region_results <- diff_meth(
meth_data = meth_rDNA_shifted,
samples = samples,
species = "mm39",
num_samples = num_samples,
min_cov = 10,
region = "18S",
model_type = "binomial",
p_adjust_method = "BH",
site = FALSE
)
#> Species selected: mm39Setting site = FALSE performs the analysis at the
regional level. As with site-level analysis, the regression method can
be changed using model_type.
Region-level aggregation provides a summary of methylation differences across the selected region. However, this approach can obscure opposing methylation changes at individual CpG positions and should therefore be considered complementary to site-level analysis.
For the binary treatment coding between CONTROL and CONDITION 1 used in this example, the estimated methylation probabilities are
\[ \widehat{p}_{\mathrm{CONTROL}} = \frac{1}{1+\exp(-\widehat{\beta}_0)} \] and
\[ \widehat{p}_{\mathrm{CONDITION \ 1}} = \frac{1}{ 1+\exp[-(\widehat{\beta}_0+\widehat{\beta}_1)] }. \] An odds ratio greater than one indicates higher fitted methylation odds in CONDITION 1 samples, whereas an odds ratio below one indicates lower fitted methylation odds.
The estimated methylation difference, expressed in percentage points, is
\[ \boxed{ \Delta_{\mathrm{meth}} = 100 \left( \widehat{p}_{\mathrm{CONDITION \ 1}} - \widehat{p}_{\mathrm{CONTROL}} \right) } \] A positive value therefore indicates higher estimated methylation in CONDITION 1 samples relative to OLD samples. Statistical evidence for a treatment effect is assessed through the corresponding regression coefficient and its associated hypothesis test.
Site-level differential methylation involves testing multiple CpG positions, increasing the probability of obtaining false-positive results.
To account for multiple comparisons, myoRDNA supports
p-value adjustment using the Benjamini–Hochberg (BH) as a default
procedure. However, if the user wishes to use a less or more
conservative method this can be adjusted through the
p_adjust_method to none for no adjustment or
bonferroni or holm to name a few.
The BH method controls the false discovery rate (FDR), defined as the expected proportion of false discoveries among rejected hypotheses, under its applicable dependence assumptions.
The adjusted p-values are then returned to their original genomic positions.
For example, an FDR threshold of 0.05 can be used to identify CpG positions with BH-adjusted p-values below 0.05.
The scope of the correction depends on the set of tests included. When different rDNA regions are analysed separately, region-specific adjustments do not automatically control the FDR across all regions.
Beta-binomial regression estimates the regression coefficients and dispersion parameter by maximising the likelihood of the observed methylation counts.
Because the beta-binomial likelihood can be difficult to optimise, particularly with limited biological replication or extreme methylation proportions, numerical convergence should be assessed before interpreting the fitted coefficients and p-values.
The glmmTMB package uses the nlminb
optimiser by default.
Alternative optimisation strategies include:
nlminb: A nonlinear optimisation algorithm supporting gradient-based optimisation and parameter bounds. Its iteration and function evaluation limits can be increased when additional optimisation steps are required.
BFGS: A quasi-Newton method available through
R’s optim() function. It approximates the inverse Hessian
and can provide an alternative when the default optimiser encounters
convergence difficulties.
Nelder–Mead: A derivative-free simplex method
available through optim(). It can be considered when
gradient-based optimisation is problematic, although it may be slower or
less reliable for some beta-binomial models.
These algorithms are alternatives for fitting the same statistical model; changing the optimiser does not change the model’s underlying probability distribution.
Users should inspect convergence diagnostics before interpreting results from beta-binomial regression.
Potential problems include failure to reach convergence, a non-positive-definite Hessian matrix, unusually large regression coefficients and poorly identified dispersion parameters.
These problems may arise when there is insufficient information to estimate the model parameters or when methylation measurements exhibit complete or near-complete separation.
For a fitted glmmTMB object, the following diagnostics
are available:
# Inspect fitted model
summary(fit)
# Check convergence code
fit$fit$convergence
# Check whether the Hessian is positive definite
fit$sdr$pdHess
# Run additional diagnostics
glmmTMB::diagnose(fit)If convergence problems arise, alternative optimisation settings may be considered. However, changing the optimiser or increasing iteration limits does not necessarily resolve parameter identifiability problems.
Results from models with unresolved convergence problems should not be interpreted as reliable evidence of differential methylation.
sessionInfo()
#> R version 4.6.1 (2026-06-24)
#> Platform: x86_64-pc-linux-gnu
#> Running under: Ubuntu 26.04.1 LTS
#>
#> Matrix products: default
#> BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
#> LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.32.so; LAPACK version 3.12.0
#>
#> locale:
#> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
#> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
#> [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
#> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
#> [9] LC_ADDRESS=C LC_TELEPHONE=C
#> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
#>
#> time zone: Etc/UTC
#> tzcode source: system (glibc)
#>
#> attached base packages:
#> [1] stats4 stats graphics grDevices utils datasets methods
#> [8] base
#>
#> other attached packages:
#> [1] methylKit_1.39.0 GenomicRanges_1.65.4 Seqinfo_1.3.2
#> [4] IRanges_2.47.5 S4Vectors_0.51.10 BiocGenerics_0.59.12
#> [7] generics_0.1.4 myoRDNA_0.99.0 rmarkdown_2.32
#>
#> loaded via a namespace (and not attached):
#> [1] tidyselect_1.2.1 dplyr_1.2.1 farver_2.1.2
#> [4] R.utils_2.13.0 Biostrings_2.81.9 S7_0.2.2
#> [7] bitops_1.1-0 fastmap_1.2.0 RCurl_1.98-1.20
#> [10] GenomicAlignments_1.49.2 XML_3.99-0.25 digest_0.6.39
#> [13] lifecycle_1.0.5 statmod_1.5.2 magrittr_2.0.5
#> [16] compiler_4.6.1 rlang_1.3.0 sass_0.4.10
#> [19] tools_4.6.1 yaml_2.3.12 data.table_1.18.6.1
#> [22] rtracklayer_1.73.0 knitr_1.52 mclust_6.1.3
#> [25] curl_8.0.0 plyr_1.8.9 RColorBrewer_1.1-3
#> [28] BiocParallel_1.47.0 numDeriv_2016.8-1.1 sys_3.4.3
#> [31] R.oo_1.27.1 grid_4.6.1 ggplot2_4.0.3
#> [34] scales_1.4.0 gtools_3.9.5 MASS_7.3-66
#> [37] bbmle_1.0.26 cli_3.6.6 mvtnorm_1.4-2
#> [40] crayon_1.5.3 otel_0.2.0 httr_1.4.9
#> [43] reshape2_1.4.5 rjson_0.2.23 BiocBaseUtils_1.15.1
#> [46] bdsmatrix_1.3-7 qvalue_2.45.0 cachem_1.1.0
#> [49] stringr_1.6.0 splines_4.6.1 parallel_4.6.1
#> [52] XVector_0.53.0 restfulr_0.0.17 vctrs_0.7.3
#> [55] Matrix_1.7-6 jsonlite_2.0.0 fastseg_1.59.0
#> [58] maketools_1.3.2 limma_3.99.0 jquerylib_0.1.4
#> [61] glue_1.8.1 emdbook_1.3.14 codetools_0.2-20
#> [64] stringi_1.8.9 gtable_0.3.6 BiocIO_1.23.3
#> [67] tibble_3.3.1 pillar_1.11.1 htmltools_0.5.9
#> [70] R6_2.6.1 evaluate_1.0.5 lattice_0.23-1
#> [73] Biobase_2.73.2 R.methodsS3_1.8.2 Rsamtools_2.29.0
#> [76] cigarillo_1.3.1 bslib_0.12.0 Rcpp_1.1.2
#> [79] coda_0.19-4.1 xfun_0.61 buildtools_1.0.0
#> [82] pkgconfig_2.0.3