impute_test_met {Melissa} | R Documentation

## Impute/predict test methylation states

### Description

Make predictions of missing methylation states, i.e. perfrom imputation using Melissa. This requires keepin a subset of data as a held out test set during Melissa inference. If you want to impute a whole directory containing cells (files) with missing methylation levels, see `impute_met_files`.

### Usage

    impute_test_met(
      obj,
      test,
      basis = NULL,
      is_predictive = TRUE,
      return_test = FALSE
    )

### Arguments

`obj` | Output of Melissa inference object.
`test` | Test data to evaluate performance.
`basis` | Basis object, if NULL we perform imputation using Melissa, otherwise using BPRMeth.
`is_predictive` | Logical, use predictive distribution for imputation, or choose the cluster label with the highest responsibility.
`return_test` | Whether or not to return a list with the predictions.

### Value

A list containing two vectors, the true methylation state and the predicted/imputed methylation states.

### Author(s)

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

### See Also

`create_melissa_data_obj`, `melissa`, `filter_regions`, `eval_imputation_performance`, `eval_cluster_performance`

### Examples

    # Extract synthetic data
    dt <- melissa_synth_dt

    # Partition to train and test set
    dt <- partition_dataset(dt)

    # Create basis object from BPRMeth package
    basis_obj <- BPRMeth::create_rbf_object(M = 3)

    # Run Melissa
    melissa_obj <- melissa(X = dt$met, K = 2, basis = basis_obj, vb_max_iter=10,
       vb_init_nstart = 1, is_parallel = FALSE, is_verbose = FALSE)

    imputation_obj <- impute_test_met(obj = melissa_obj,
                                       test = dt$met_test)

[Package Melissa version 1.4.1 Index]