BioMMstage1pca {BioMM} | R Documentation

## Reconstruct stage-2 data by PCA

### Description

Stage-2 data reconstruction by regular or sparse constrained principal component analysis (PCA).

### Usage

    BioMMstage1pca(trainDataList, testDataList, typeMode = "regular",
      topPC = 1, innerCore = MulticoreParam(), outFileA = NULL,
      outFileB = NULL)

### Arguments

`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.

### Value

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.

### Author(s)

Junfang Chen

### Examples

    ## 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]))

[Package BioMM version 1.0.0 Index]