predict_expr {BPRMeth} | R Documentation

## Predict gene expression from methylation profiles

### Description

`bpr_predict_wrap` is a function that wraps all the necessary subroutines for performing prediction on gene expression levels. Initially, it optimizes the parameters of the basis functions so as to learn the methylation profiles. Then, uses the learned parameters / coefficients of the basis functions as input features for performing regression in order to predict the corresponding gene expression levels.

### Usage

    predict_expr(
      formula = NULL,
      prof_obj,
      expr,
      anno,
      model_name = "lm",
      train_ind = NULL,
      train_perc = 0.7,
      fit_feature = "RMSE",
      cov_feature = TRUE,
      is_summary = TRUE
    )

### Arguments

`formula` | An object of class `formula`, e.g. see `lm` function. If NULL, the simple linear regression model is used.
`prof_obj` | Inferred profiles object. This in general will be the output of 'infer_profiles_'(inference_meth) function.
`expr` | Gene expression data with two columns in `data.frame` or `data.table` format. 1st column will have gene IDs and should have column name "id", 2nd column will have expression levels.
`anno` | Annotation data as a `GRanges` object.
`model_name` | A string denoting the regression model. Currently, available models are: `"svm"`, `"randomForest"`, `"rlm"`, `"mars"`, `"gp"`, and `"lm"`.
`train_ind` | Optional vector containing the indices for the train set.
`train_perc` | Optional parameter for defining the percentage of the dataset to be used for training set, the remaining will be the test set.
`fit_feature` | Use additional feature of how well the profile fits the methylation data. Either NULL for ignoring this feature or one of the following: 1) "RMSE" or 2) "NLL" which will be used as input features for predicting expression.
`cov_feature` | Logical, whether to use coverage as input feature for predictions.
`is_summary` | Logical, print the summary statistics.

### Value

A 'predict_expr' object which consists of the following variables:

- train: The training data.

- test: The test data.

- `model`: The fitted regression model.

- `train_pred` The predicted values for the training data.

- `test_pred` The predicted values for the test data.

- `train_errors`: The training error metrics.

- `test_errors`: The test error metrics.

### Author(s)

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

### See Also

`infer_profiles_mle`, `infer_profiles_vb`, `infer_profiles_gibbs`, `create_basis`,

### Examples

    # Fit methylation profiles using 5 RBFs
    basis <- create_rbf_object(M = 5)
    prof <- infer_profiles_vb(X = encode_met$met, model = "binomial",
        basis = basis, is_parallel = FALSE, vb_max_iter = 5)
    # Predict expression
    pred_obj <- predict_expr(prof_obj = prof, expr = encode_expr,
      anno = encode_met$anno, model_name = "lm", is_summary = FALSE)

[Package BPRMeth version 1.20.0 Index]