impute_test_met: Impute/predict test methylation states

Description Usage Arguments Value Author(s) See Also Examples

View source: R/utils.R

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

1
2
3
4
5
6
7
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# 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)

Melissa documentation built on Nov. 8, 2020, 5:37 p.m.