Learn R Programming

metamorphr (version 0.2.0)

impute_lls: Impute missing values using Local Least Squares (LLS)

Description

Basically a wrapper around pcaMethods::llsImpute. For a detailed discussion, see the vignette("pcaMethods") and vignette("missingValues", "pcaMethods") as well as the References section.

Important Note impute_lls() depends on the pcaMethods package from Bioconductor. If metamorphr was installed via install.packages(), dependencies from Bioconductor were not automatically installed. When impute_svd() is called without the pcaMethods package installed, you should be asked if you want to install pak and pcaMethods. If you want to use impute_lls() you have to install those. In case you run into trouble with the automatic installation, please install pcaMethods manually. See pcaMethods – a Bioconductor package providing PCA methods for incomplete data for instructions on manual installation.

Usage

impute_lls(
  data,
  correlation = "pearson",
  complete_genes = FALSE,
  center = FALSE,
  cluster_size = 10
)

Value

A tibble with imputed missing values.

Arguments

data

A tidy tibble created by read_featuretable.

correlation

The method used to calculate correlations between features. One of "pearson", "spearman" or "kendall". See cor.

complete_genes

If TRUE only complete features will be used for regression, if FALSE, all will be used.

center

Should data be mean centered? See prep for details.

cluster_size

The number of similar features used for regression.

References

  • H. R. Wolfram Stacklies, 2017, DOI 10.18129/B9.BIOC.PCAMETHODS.

  • W. Stacklies, H. Redestig, M. Scholz, D. Walther, J. Selbig, Bioinformatics 2007, 23, 1164–1167, DOI 10.1093/bioinformatics/btm069.

Examples

Run this code
# The cluster size must be reduced because
# the data set is too small for the default (10)

toy_metaboscape %>%
  impute_lls(complete_genes = TRUE, cluster_size = 5)

Run the code above in your browser using DataLab