This function calculates predicted values based on the provided methyl_surro object. If any probes (rows) are completely missing, their values are set to zero, and a count of these probes is stored. Columns (samples) with any missing values are removed, and a count of these is also recorded. The function aligns and multiplies the weights with the methylation matrix, adds the intercept if specified, and applies the specified transformation to the results.
Usage
surro_calc(methyl_surro, transform = c("linear", "count", "probability"))
Value
A named vector of predicted values with names corresponding to the sample names in the methylation matrix.
Examples
# Load \code{methyl_surro} Object
data(beta_matrix_comp, package = "MethylSurroGetR")
# Generating Surrogate Estimates from Linear Model Weights
pred_lin <- surro_calc(methyl_surro = methyl_surro_comp,
transform = "linear")
print(pred_lin)
#> samp1 samp2 samp3 samp4 samp5
#> 1.197718 1.200473 1.206967 1.199796 1.198156