plot_infer_profiles: Plot inferred methylation profiles across a region

Description Usage Arguments Value Author(s) See Also Examples

View source: R/visualization.R

Description

Function for plotting the inferred methylation profiles across a given region, and optionally the mean methylation rate together with the observed methylation data, using ggplot2.

Usage

1
2
3
4
5
6
7
8
plot_infer_profiles(
  region = 1,
  obj_prof,
  obj_mean = NULL,
  obs = NULL,
  title = "Inferred profiles",
  ...
)

Arguments

region

Genomic region number

obj_prof

Inferred profile, i.e. output from infer_profiles_vb

obj_mean

Inferred mean function, i.e. output from infer_profiles_vb

obs

a list result of create_region_object

title

Plot title

...

Additional parameters

Value

A ggplot2 object.

Author(s)

Hongen Kang geneprophet@163.com

See Also

infer_profiles_vb, create_rbf_object, create_region_object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
# Fit methylation profiles using 8 RBFs and 0 RBF
human_basis_profile <- create_rbf_object(M = 8)
human_basis_mean <- create_rbf_object(M = 0)
human_obj <- create_region_object(human_met, human_region)
human_fit_profiles <- infer_profiles_vb(X = human_obj$met, model = "binomial",
   basis = human_basis_profile, is_parallel = TRUE, vb_max_iter = 100)
human_fit_mean <- infer_profiles_vb(X = human_obj$met, model = "binomial",
   basis = human_basis_mean, is_parallel = TRUE, vb_max_iter = 100)
p <- plot_infer_profiles(region = 44, obj_prof = human_fit_profiles,obj_mean = human_fit_mean, 
   obs = human_obj, title = paste0("Gene ID ",human_obj$anno$id[44]))

## End(Not run)

geneprophet/BSDMR documentation built on March 3, 2021, 5:50 a.m.