RunWPCA: Run Weighted Principal Component Analysis

View source: R/main.R

RunWPCAR Documentation

Run Weighted Principal Component Analysis

Description

Run a weighted PCA dimensionality reduction

Usage

  RunWPCA(object, q=15)
  ### S3 method for class "Seurat"
  ## RunWPCA(object, q=15)
  
  ### S3 method for class "matrix"
  ## RunWPCA(object, q=15)
  
  ### S3 method for class "dgCMatrix"
  ## RunWPCA(object, q=15)

Arguments

object

an object named "Seurat", "maxtrix" or "dgCMatrix". The object of class "Seurat" must include slot "scale.data".

q

an optional positive integer, specify the number of features to be extracted.

Details

Nothing

Value

For Seurat object, return a Seurat object. For objcet "matrix" and "dgCMatrix", return a object "matrix" with rownames same as the colnames of X, and colnames "WPCA1" to "WPCAq".

Note

nothing

Author(s)

Wei Liu

References

Bai, J. and Liao, Y. (2017). Inferences in panel data with interactive effects using large covariance matrices. Journal of Econometrics, 200(1):59–78.

See Also

None

Examples

## Not run: 
  library(Seurat)
  seu <- gendata_RNAExp(height=20, width=20,p=100, K=4)
  ## log-normalization
  seu <- NormalizeData(seu)
  ##
  seu <- FindVariableFeatures(seu, nfeatures=80)
  ## Scale
  seu <- ScaleData(seu)
  ## Run WPCA
  seu <- RunWPCA(seu)
  seu
  ## Run tSNE based on wpca
  seu <- RunTSNE(seu, reduction='wpca')
  seu
  ## Find SVGs
  seu <- FindSVGs(seu, nfeatures=80)
  (genes <- topSVGs(seu, ntop=10))
  Idents(seu) <- factor(paste0("cluster", seu$true_clusters), levels=paste0("cluster",1:4))
  RidgePlot(seu, features = genes[1:2], ncol = 2)
  FeaturePlot(seu, features = genes[1:2], reduction = 'tsne' ,ncol=2)
  
## End(Not run)

feiyoung/DR.SC documentation built on March 23, 2024, 6:31 p.m.