CoGAPS: CoGAPS Matrix Factorization Algorithm

Description Usage Arguments Details Value Examples

View source: R/CoGAPS.R

Description

calls the C++ MCMC code and performs Bayesian matrix factorization returning the two matrices that reconstruct the data matrix

Usage

1
2
3
4
5
6
CoGAPS(data, params = new("CogapsParams"), nThreads = 1,
  messages = TRUE, outputFrequency = 500, uncertainty = NULL,
  checkpointOutFile = "gaps_checkpoint.out", checkpointInterval = 1000,
  checkpointInFile = NULL, transposeData = FALSE, BPPARAM = NULL,
  geneNames = NULL, sampleNames = NULL, matchedPatterns = NULL,
  outputToFile = NULL, ...)

Arguments

data

File name or R object (see details for supported types)

params

CogapsParams object

nThreads

maximum number of threads to run on

messages

T/F for displaying output

outputFrequency

number of iterations between each output (set to 0 to disable status updates, other output is controlled by @code messages)

uncertainty

uncertainty matrix - either a matrix or a supported file type

checkpointOutFile

name of the checkpoint file to create

checkpointInterval

number of iterations between each checkpoint (set to 0 to disable checkpoints)

checkpointInFile

if this is provided, CoGAPS runs from the checkpoint contained in this file

transposeData

T/F for transposing data while reading it in - useful for data that is stored as samples x genes since CoGAPS requires data to be genes x samples

BPPARAM

BiocParallel backend

geneNames

vector of names of genes in data

sampleNames

vector of names of samples in data

matchedPatterns

manually matched patterns for distributed CoGAPS

outputToFile

name of a file to save the output to, will create 4 files of the form "filename_nPatterns_[Amean, Asd, Pmean, Psd].extension"

...

allows for overwriting parameters in params

Details

The supported R types are: matrix, data.frame, SummarizedExperiment, SingleCellExperiment. The supported file types are csv, tsv, and mtx.

Value

CogapsResult object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Running from R object
data(GIST)
resultA <- CoGAPS(GIST.data_frame, nIterations=250)

# Running from file name
gist_path <- system.file("extdata/GIST.mtx", package="CoGAPS")
resultB <- CoGAPS(gist_path, nIterations=250)

# Setting Parameters
params <- new("CogapsParams")
params <- setParam(params, "nPatterns", 5)
resultC <- CoGAPS(GIST.data_frame, params, nIterations=250)

CoGAPS documentation built on Nov. 4, 2018, 6:01 p.m.