% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/CoGAPS.R
\name{CoGAPS}
\alias{CoGAPS}
\title{CoGAPS Matrix Factorization Algorithm}
\usage{
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{
\item{data}{File name or R object (see details for supported types)}

\item{params}{CogapsParams object}

\item{nThreads}{maximum number of threads to run on}

\item{messages}{T/F for displaying output}

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

\item{uncertainty}{uncertainty matrix - either a matrix or a supported
file type}

\item{checkpointOutFile}{name of the checkpoint file to create}

\item{checkpointInterval}{number of iterations between each checkpoint (set
to 0 to disable checkpoints)}

\item{checkpointInFile}{if this is provided, CoGAPS runs from the checkpoint
contained in this file}

\item{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}

\item{BPPARAM}{BiocParallel backend}

\item{geneNames}{vector of names of genes in data}

\item{sampleNames}{vector of names of samples in data}

\item{matchedPatterns}{manually matched patterns for distributed CoGAPS}

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

\item{...}{allows for overwriting parameters in params}
}
\value{
CogapsResult object
}
\description{
calls the C++ MCMC code and performs Bayesian
matrix factorization returning the two matrices that reconstruct
the data matrix
}
\details{
The supported R types are: matrix, data.frame, SummarizedExperiment,
SingleCellExperiment. The supported file types are csv, tsv, and mtx.
}
\examples{
# Running from R object
data(GIST)
resultA <- CoGAPS(GIST.data_frame)

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

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