bpr_cluster_wrap {BPRMeth} | R Documentation

## (DEPRECATED) Cluster methylation profiles

### Description

(DEPRECATED) `bpr_cluster_wrap` is a wrapper function that clusters methylation profiles using the EM algorithm. Initially, it performs parameter checking, and initializes main parameters, such as mixing proportions, basis function coefficients, then the EM algorithm is applied and finally model selection metrics are calculated, such as BIC and AIC.

### Usage

    bpr_cluster_wrap(x, K = 3, pi_k = NULL, w = NULL, basis = NULL,
      em_max_iter = 100, epsilon_conv = 1e-04, lambda = 1/2,
      opt_method = "CG", opt_itnmax = 100, init_opt_itnmax = 100,
      is_parallel = TRUE, no_cores = NULL, is_verbose = FALSE)

### Arguments

`x` | The binomial distributed observations, which has to be a list of elements of length N, where each element is an L x 3 matrix of observations, where 1st column contains the locations. The 2nd and 3rd columns contain the total trials and number of successes at the corresponding locations, repsectively. See `process_haib_caltech_wrap` on a possible way to get this data structure.
`K` | Integer denoting the number of clusters K.
`pi_k` | Mixing proportions.
`w` | A MxK matrix, where each column consists of the basis function coefficients for each corresponding cluster.
`basis` | A 'basis' object. E.g. see `create_rbf_object`.
`em_max_iter` | Integer denoting the maximum number of EM iterations.
`epsilon_conv` | Numeric denoting the convergence parameter for EM.
`lambda` | The complexity penalty coefficient for ridge regression.
`opt_method` | The optimization method to be used. See `optim` for possible methods. Default is "CG".
`opt_itnmax` | Optional argument giving the maximum number of iterations for the corresponding method. See `optim` for details.
`init_opt_itnmax` | Optimization iterations for obtaining the initial EM parameter values.
`is_parallel` | Logical, indicating if code should be run in parallel.
`no_cores` | Number of cores to be used, default is max_no_cores - 2.
`is_verbose` | Logical, print results during EM iterations.

### Value

A 'bpr_cluster' object which, in addition to the input parameters, consists of the following variables:

- `pi_k`: Fitted mixing proportions.

- `w`: A MxK matrix with the fitted coefficients of the basis functions for each cluster k.

- `NLL`: The Negative Log Likelihood after the EM algorithm has finished.

- `r_nk`: Posterior probabilities of each promoter region belonging to each cluster.

- `labels`: Hard clustering assignments of each observation/promoter region.

- `BIC`: Bayesian Information Criterion metric.

- `AIC`: Akaike Information Criterion metric.

- `ICL`: Integrated Complete Likelihood criterion metric.

### Author(s)

C.A.Kapourani C.A.Kapourani@ed.ac.uk

### Examples

    ex_data <- meth_data
    data_clust <- bpr_cluster_wrap(x = ex_data, em_max_iter = 3, opt_itnmax = 3,
                                   init_opt_itnmax = 5, is_parallel = FALSE)

[Package BPRMeth version 1.12.0 Index]