projectNMF: Function to estimate sample embeddings for one dataset from a...

View source: R/projectNMF.R

projectNMFR Documentation

Function to estimate sample embeddings for one dataset from a gene loading matrix derived from an NMF decomposition of another dataset.

Description

projectNMF estimates the embeddings for samples in a new dataset when given a gene loading matrix from an NMF decomposition of another single matrix, or set of matrices (e.g. the "list_component" from a jointNMF output object)

Usage

projectNMF(
  proj_dataset,
  proj_group,
  list_component,
  max_ite = 1000,
  max_err = 1e-04,
  enable_normalization = TRUE,
  column_sum_normalization = FALSE
)

Arguments

proj_dataset

The dataset(s) to be projected on.

proj_group

A logical vector indicating which groupings, i. e. which elements of list_component should be used for each projected dataset. The length of proj_group should match the length of list_component.

list_component

a single matrix of gene loadings as a list element, or a list_component produced from a jointNMF() decomposition.

max_ite

The maximum number of iterations for the jointNMF algorithms to run, default value is set to 1000

max_err

The maximum error of loss between two iterations, or the program will terminate and return, default value is set to be 0.0001

enable_normalization

An argument to decide whether to use normalizaiton or not, default is TRUE

column_sum_normalization

An argument to decide whether to use column sum normalization or not, default it FALSE

Value

A list that contains the 1] projected scores of each dataset on every component. and 2] the log of errors as the NMF was iterated.

Examples

proj_dataset = list(matrix(runif(5000, 1, 2), nrow = 100, ncol = 50))
proj_group = c(TRUE, TRUE) # which groupings in the joint decomposition you want to project on.
list_component = jointNMF$linked_component_list # from jointNMF result
res_projNMF = projectNMF(
proj_dataset = proj_dataset,
proj_group = proj_group,
list_component = list_component)

PLEASE MAKE SURE YOUR proj_dataset AND list_component ELEMENTS HAVE MEANINGFUL ROW(GENE) NAMES - they are matched across matrices for the projection. 
#'

CHuanSite/SJD documentation built on Nov. 29, 2024, 5:52 a.m.