BioMMstage1pca {BioMM} | R Documentation |
Stage-2 data reconstruction by regular or sparse constrained principal component analysis (PCA).
BioMMstage1pca(trainDataList, testDataList, typeMode = "regular", topPC = 1, innerCore = MulticoreParam(), outFileA = NULL, outFileB = NULL)
trainDataList |
The input training data list containing ordered collections of matrices. |
testDataList |
The input test data list containing ordered collections of matrices. |
typeMode |
The type of PCA prediction mode. Available options are c('regular', 'sparse'). (Default: regular) |
topPC |
The number of top PCs selected. The default is 1, i.e. the first PC. |
innerCore |
The number of cores used for computation. |
outFileA |
The file name of stage-2 training data with the '.rds' file extension. If it's provided, then the result will be saved in this file. The default is NULL. |
outFileB |
The file name of stage-2 training data with the '.rds' file extension. If it's provided, then the result will be saved in this file. The default is NULL. |
The predicted stage-2 training data and also stage-2 test data if 'testDataList' provided. If outFileA and outFileB are provided then the results will be stored in the files.
Junfang Chen
## Load data methylfile <- system.file('extdata', 'methylData.rds', package='BioMM') methylData <- readRDS(methylfile) ## Annotation files for Mapping CpGs into chromosome probeAnnoFile <- system.file('extdata', 'cpgAnno.rds', package='BioMM') probeAnno <- readRDS(file=probeAnnoFile) ## Mapping CpGs into Chromosome dataList <- omics2chrlist(data=methylData, probeAnno) length(dataList) library(BiocParallel) param <- MulticoreParam(workers = 10) stage2data <- BioMMstage1pca(trainDataList=dataList, testDataList=NULL, typeMode='regular', topPC=1, innerCore=param, outFileA=NULL, outFileB=NULL) print(dim(stage2data)) print(head(stage2data[,1:5]))