scCoGAPS: Single Cell CoGAPS

Description Usage Arguments Value Examples

View source: R/CoGAPS.R

Description

wrapper around single-cell distributed algorithm for CoGAPS

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
scCoGAPS(
  data,
  params = new("CogapsParams"),
  nThreads = 1,
  messages = TRUE,
  outputFrequency = 500,
  uncertainty = NULL,
  checkpointOutFile = "gaps_checkpoint.out",
  checkpointInterval = 1000,
  checkpointInFile = NULL,
  transposeData = FALSE,
  BPPARAM = NULL,
  workerID = 1,
  asynchronousUpdates = FALSE,
  ...
)

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

workerID

if calling CoGAPS in parallel the worker ID can be specified, only worker 1 prints output and each worker outputs when it finishes, this is not neccesary when using the default parallel methods (i.e. distributed CoGAPS) but only when the user is manually calling CoGAPS in parallel

asynchronousUpdates

enable asynchronous updating which allows for multi-threaded runs

...

allows for overwriting parameters in params

Value

CogapsResult object

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
data(GIST)
params <- new("CogapsParams")
params <- setDistributedParams(params, nSets=2)
params <- setParam(params, "nIterations", 100)
params <- setParam(params, "nPatterns", 3)
result <- scCoGAPS(t(GIST.matrix), params, BPPARAM=BiocParallel::SerialParam())

## End(Not run)

Example output

setting distributed parameters - call this again if you change nPatterns

This is CoGAPS version 3.10.0 
Running single-cell CoGAPS on data (9 genes and 1363 samples) with parameters:

-- Standard Parameters --
nPatterns            3 
nIterations          100 
seed                 230 
sparseOptimization   FALSE 
distributed          single-cell 

-- Sparsity Parameters --
alpha          0.01 
maxGibbsMass   100 

-- Distributed CoGAPS Parameters -- 
nSets          2 
cut            3 
minNS          1 
maxNS          3 

Creating subsets...
set sizes (min, mean, max): (681, 681.5, 682)
Running Across Subsets...

Data Model: Dense, Normal
Sampler Type: Sequential
Loading Data...Done! (00:00:00)
    worker 1 is starting!
-- Equilibration Phase --
-- Sampling Phase --
    worker 1 is finished! Time: 00:00:00
    worker 2 is starting!
    worker 2 is finished! Time: 00:00:00

Matching Patterns Across Subsets...
Running Final Stage...

Data Model: Dense, Normal
Sampler Type: Sequential
Loading Data...Done! (00:00:00)
    worker 1 is starting!
-- Equilibration Phase --
-- Sampling Phase --
    worker 1 is finished! Time: 00:00:00
    worker 2 is starting!
    worker 2 is finished! Time: 00:00:00
Warning messages:
1: In scCoGAPS(t(GIST.matrix), params, BPPARAM = BiocParallel::SerialParam()) :
  scCoGAPS is deprecated, use the main function CoGAPS with the argument: distributed="single-cell"
2: In checkInputs(data, uncertainty, allParams) :
  running distributed cogaps without mtx/tsv/csv/gct data

CoGAPS documentation built on Nov. 8, 2020, 5:02 p.m.