Browse code

added back docs; fixed RNG syntax

Tom Sherman authored on 31/05/2018 21:34:33
Showing40 changed files

1 1
new file mode 100644
... ...
@@ -0,0 +1,31 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/package.R
3
+\docType{package}
4
+\name{CoGAPS-package}
5
+\alias{CoGAPS-package}
6
+\title{CoGAPS: Coordinated Gene Activity in Pattern Sets}
7
+\description{
8
+CoGAPS implements a Bayesian MCMC matrix factorization algorithm,
9
+GAPS, and links it to gene set statistic methods to infer
10
+biological process activity.  It can be used to perform
11
+sparse matrix factorization on any data, and when this
12
+data represents biomolecules, to do gene set analysis.
13
+\tabular{ll}{
14
+Package: \tab CoGAPS\cr
15
+Type: \tab Package\cr
16
+Version: \tab 2.99.0\cr
17
+Date: \tab 2018-01-24\cr
18
+License: \tab LGPL\cr
19
+}
20
+}
21
+\author{
22
+Maintainer: Elana J. Fertig \email{ejfertig@jhmi.edu},
23
+            Michael F. Ochs \email{ochsm@tcnj.edu}
24
+}
25
+\references{
26
+Fertig EJ, Ding J, Favorov AV, Parmigiani G, Ochs MF.
27
+CoGAPS: an R/C++ package to identify patterns and biological
28
+process activity in transcriptomic data.
29
+Bioinformatics. 2010 Nov 1;26(21):2792-3
30
+}
31
+
0 32
new file mode 100644
... ...
@@ -0,0 +1,71 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/CoGAPS.R
3
+\name{CoGAPS}
4
+\alias{CoGAPS}
5
+\title{CoGAPS Matrix Factorization Algorithm}
6
+\usage{
7
+CoGAPS(D, S, nFactor = 7, nEquil = 1000, nSample = 1000,
8
+  nOutputs = 1000, nSnapshots = 0, alphaA = 0.01, alphaP = 0.01,
9
+  maxGibbmassA = 100, maxGibbmassP = 100, seed = -1, messages = TRUE,
10
+  singleCellRNASeq = FALSE, whichMatrixFixed = "N",
11
+  fixedPatterns = matrix(0), checkpointInterval = 0,
12
+  checkpointFile = "gaps_checkpoint.out", nCores = 1, ...)
13
+}
14
+\arguments{
15
+\item{D}{data matrix}
16
+
17
+\item{S}{uncertainty matrix (std devs for chi-squared of Log Likelihood)}
18
+
19
+\item{nFactor}{number of patterns (basis vectors, metagenes), which must be
20
+greater than or equal to the number of rows of FP}
21
+
22
+\item{nEquil}{number of iterations for burn-in}
23
+
24
+\item{nSample}{number of iterations for sampling}
25
+
26
+\item{nOutputs}{how often to print status into R by iterations}
27
+
28
+\item{nSnapshots}{the number of individual samples to capture}
29
+
30
+\item{alphaA}{sparsity parameter for A domain}
31
+
32
+\item{alphaP}{sparsity parameter for P domain}
33
+
34
+\item{maxGibbmassA}{limit truncated normal to max size}
35
+
36
+\item{maxGibbmassP}{limit truncated normal to max size}
37
+
38
+\item{seed}{a positive seed is used as-is, while any negative seed tells
39
+the algorithm to pick a seed based on the current time}
40
+
41
+\item{messages}{display progress messages}
42
+
43
+\item{singleCellRNASeq}{indicates if the data is single cell RNA-seq data}
44
+
45
+\item{whichMatrixFixed}{character to indicate whether A or P matric contains
46
+the fixed patterns}
47
+
48
+\item{fixedPatterns}{matrix of fixed values in either A or P matrix}
49
+
50
+\item{checkpointInterval}{time (in seconds) between creating a checkpoint}
51
+
52
+\item{checkpointFile}{name of the checkpoint file}
53
+
54
+\item{...}{keeps backwards compatibility with arguments from older versions}
55
+}
56
+\value{
57
+list with A and P matrix estimates
58
+}
59
+\description{
60
+CoGAPS Matrix Factorization Algorithm
61
+}
62
+\details{
63
+calls the C++ MCMC code and performs Bayesian
64
+matrix factorization returning the two matrices that reconstruct
65
+the data matrix
66
+}
67
+\examples{
68
+data(SimpSim)
69
+result <- CoGAPS(SimpSim.D, SimpSim.S, nFactor=3, nOutputs=250)
70
+}
71
+
0 72
new file mode 100644
... ...
@@ -0,0 +1,12 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/CoGAPS.R
3
+\name{CoGAPSFromFile}
4
+\alias{CoGAPSFromFile}
5
+\title{CoGAPS with file input for matrix}
6
+\usage{
7
+CoGAPSFromFile(D)
8
+}
9
+\description{
10
+CoGAPS with file input for matrix
11
+}
12
+
0 13
new file mode 100644
... ...
@@ -0,0 +1,28 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/CoGAPS.R
3
+\name{CoGapsFromCheckpoint}
4
+\alias{CoGapsFromCheckpoint}
5
+\title{Restart CoGAPS from Checkpoint File}
6
+\usage{
7
+CoGapsFromCheckpoint(D, S, path, checkpointFile = NA)
8
+}
9
+\arguments{
10
+\item{D}{data matrix}
11
+
12
+\item{S}{uncertainty matrix}
13
+
14
+\item{path}{path to checkpoint file}
15
+
16
+\item{checkpointFile}{name for future checkpooints made}
17
+}
18
+\value{
19
+list with A and P matrix estimates
20
+}
21
+\description{
22
+Restart CoGAPS from Checkpoint File
23
+}
24
+\details{
25
+loads the state of a previous CoGAPS run from a file and
26
+ continues the run from that point
27
+}
28
+
0 29
new file mode 100644
... ...
@@ -0,0 +1,48 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/GWCoGAPS.R
3
+\name{GWCoGAPS}
4
+\alias{GWCoGAPS}
5
+\title{GWCoGAPS}
6
+\usage{
7
+GWCoGAPS(simulationName, nFactor, nCores = NA, cut = NA, minNS = NA,
8
+  manualMatch = FALSE, consensusPatterns = NULL, ...)
9
+}
10
+\arguments{
11
+\item{simulationName}{name of this simulation}
12
+
13
+\item{nFactor}{number of patterns (basis vectors, metagenes), which must be
14
+greater than or equal to the number of rows of FP}
15
+
16
+\item{nCores}{number of cores for parallelization. If left to the default NA, nCores = nSets.}
17
+
18
+\item{cut}{number of branches at which to cut dendrogram used in patternMatch4Parallel}
19
+
20
+\item{minNS}{minimum of individual set contributions a cluster must contain}
21
+
22
+\item{manualMatch}{logical indicating whether or not to stop after initial phase for manual pattern matching}
23
+
24
+\item{consensusPatterns}{fixed pattern matrix to be used to ensure reciprocity of A weights accross sets}
25
+
26
+\item{...}{additional parameters to be fed into \code{gapsRun} and \code{gapsMapRun}}
27
+}
28
+\value{
29
+list of A and P estimates
30
+}
31
+\description{
32
+GWCoGAPS
33
+}
34
+\details{
35
+calls the C++ MCMC code and performs Bayesian
36
+matrix factorization returning the two matrices that reconstruct
37
+the data matrix for whole genome data;
38
+}
39
+\examples{
40
+data(SimpSim)
41
+sim_name <- "example"
42
+createGWCoGAPSSets(SimpSim.D, SimpSim.S, nSets=2, sim_name)
43
+result <- GWCoGAPS(sim_name, nFactor=3, nEquil=200, nSample=200)
44
+}
45
+\seealso{
46
+\code{\link{gapsRun}}, \code{\link{patternMatch4Parallel}}, and \code{\link{gapsMapRun}}
47
+}
48
+
0 49
new file mode 100644
... ...
@@ -0,0 +1,33 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/GWCoGAPS.R
3
+\name{GWCoGapsFromCheckpoint}
4
+\alias{GWCoGapsFromCheckpoint}
5
+\title{Restart a GWCoGaps Run from Checkpoint}
6
+\usage{
7
+GWCoGapsFromCheckpoint(simulationName, nCores, cut = NA, minNS = NA, ...)
8
+}
9
+\arguments{
10
+\item{simulationName}{name of this simulation}
11
+
12
+\item{nCores}{number of cores for parallelization. If left to the default NA, nCores = nSets.}
13
+
14
+\item{cut}{number of branches at which to cut dendrogram used in patternMatch4Parallel}
15
+
16
+\item{minNS}{minimum of individual set contributions a cluster must contain}
17
+
18
+\item{...}{additional parameters to be fed into \code{gapsRun} and \code{gapsMapRun}}
19
+}
20
+\value{
21
+list of A and P estimates
22
+}
23
+\description{
24
+Restart a GWCoGaps Run from Checkpoint
25
+}
26
+\examples{
27
+data(SimpSim)
28
+sim_name <- "example"
29
+createGWCoGAPSSets(SimpSim.D, SimpSim.S, nSets=2, sim_name)
30
+trash <- GWCoGAPS(sim_name, nFactor=3, nEquil=200, nSample=200)
31
+result <- GWCoGapsFromCheckpoint(sim_name, 2)
32
+}
33
+
0 34
new file mode 100644
... ...
@@ -0,0 +1,32 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/binaryA.R
3
+\name{binaryA}
4
+\alias{binaryA}
5
+\title{Binary Heatmap for Standardized A Matrix}
6
+\usage{
7
+binaryA(Amean, Asd, threshold = 3)
8
+}
9
+\arguments{
10
+\item{Amean}{the mean estimate for the A matrix}
11
+
12
+\item{Asd}{the standard deviations on Amean}
13
+
14
+\item{threshold}{the number of standard deviations above zero
15
+that an element of Amean must be to get a value of 1}
16
+}
17
+\value{
18
+plots a heatmap of the A Matrix
19
+}
20
+\description{
21
+Binary Heatmap for Standardized A Matrix
22
+}
23
+\details{
24
+creates a binarized heatmap of the A matrix
25
+in which the value is 1 if the value in Amean is greater than
26
+threshold * Asd and 0 otherwise
27
+}
28
+\examples{
29
+data(SimpSim)
30
+binaryA(SimpSim.result$Amean, SimpSim.result$Asd, threshold=3)
31
+}
32
+
0 33
new file mode 100644
... ...
@@ -0,0 +1,22 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/CoGAPS.R
3
+\name{buildReport}
4
+\alias{buildReport}
5
+\title{Display Information About Package Compilation}
6
+\usage{
7
+buildReport()
8
+}
9
+\value{
10
+display builds information
11
+}
12
+\description{
13
+Display Information About Package Compilation
14
+}
15
+\details{
16
+displays information about how the package was compiled, i.e. which
17
+ compiler/version was used, which compile time options were enabled, etc...
18
+}
19
+\examples{
20
+ CoGAPS::buildReport()
21
+}
22
+
0 23
new file mode 100644
... ...
@@ -0,0 +1,34 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/calcCoGAPSStat.R
3
+\name{calcCoGAPSStat}
4
+\alias{calcCoGAPSStat}
5
+\title{Calculate Gene Set Statistics}
6
+\usage{
7
+calcCoGAPSStat(Amean, Asd, GStoGenes, numPerm = 500)
8
+}
9
+\arguments{
10
+\item{Amean}{A matrix mean values}
11
+
12
+\item{Asd}{A matrix standard deviations}
13
+
14
+\item{GStoGenes}{data.frame or list with gene sets}
15
+
16
+\item{numPerm}{number of permutations for null}
17
+}
18
+\value{
19
+gene set statistics for each column of A
20
+}
21
+\description{
22
+Calculate Gene Set Statistics
23
+}
24
+\details{
25
+calculates the gene set statistics for each
26
+column of A using a Z-score from the elements of the A matrix,
27
+the input gene set, and permutation tests
28
+}
29
+\examples{
30
+data('SimpSim')
31
+calcCoGAPSStat(SimpSim.result$Amean, SimpSim.result$Asd, GStoGenes=GSets,
32
+numPerm=500)
33
+}
34
+
0 35
new file mode 100644
... ...
@@ -0,0 +1,39 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/calcGeneGSStat.R
3
+\name{calcGeneGSStat}
4
+\alias{calcGeneGSStat}
5
+\title{Probability Gene Belongs in Gene Set}
6
+\usage{
7
+calcGeneGSStat(Amean, Asd, GSGenes, numPerm, Pw = rep(1, ncol(Amean)),
8
+  nullGenes = FALSE)
9
+}
10
+\arguments{
11
+\item{Amean}{A matrix mean values}
12
+
13
+\item{Asd}{A matrix standard deviations}
14
+
15
+\item{GSGenes}{data.frame or list with gene sets}
16
+
17
+\item{numPerm}{number of permutations for null}
18
+
19
+\item{Pw}{weight on genes}
20
+
21
+\item{nullGenes}{logical indicating gene adjustment}
22
+}
23
+\value{
24
+gene similiarity statistic
25
+}
26
+\description{
27
+Probability Gene Belongs in Gene Set
28
+}
29
+\details{
30
+calculates the probability that a gene
31
+listed in a gene set behaves like other genes in the set within
32
+the given data set
33
+}
34
+\examples{
35
+data("SimpSim")
36
+calcGeneGSStat(SimpSim.result$Amean, SimpSim.result$Asd, GSGenes=GSets[[1]],
37
+numPerm=500)
38
+}
39
+
0 40
new file mode 100644
... ...
@@ -0,0 +1,28 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/calcZ.R
3
+\name{calcZ}
4
+\alias{calcZ}
5
+\title{Compute Z-Score Matrix}
6
+\usage{
7
+calcZ(meanMat, sdMat)
8
+}
9
+\arguments{
10
+\item{meanMat}{matrix of mean values}
11
+
12
+\item{sdMat}{matrix of standard deviation values}
13
+}
14
+\value{
15
+matrix of z-scores
16
+}
17
+\description{
18
+Compute Z-Score Matrix
19
+}
20
+\details{
21
+calculates the Z-score for each element based on input mean
22
+and standard deviation matrices
23
+}
24
+\examples{
25
+data(SimpSim)
26
+calcZ(SimpSim.result$Amean, SimpSim.result$Asd)
27
+}
28
+
0 29
new file mode 100644
... ...
@@ -0,0 +1,36 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/cellMatchR.R
3
+\name{cellMatchR}
4
+\alias{cellMatchR}
5
+\title{cellMatchR}
6
+\usage{
7
+cellMatchR(Atot, nSets, cnt, minNS = NA, maxNS = NA, ignore.NA = FALSE,
8
+  bySet = FALSE, plotDen = FALSE, ...)
9
+}
10
+\arguments{
11
+\item{Atot}{a matrix containing the total by set estimates of Pmean output from \code{reOrderBySet}}
12
+
13
+\item{nSets}{number of parallel sets used to generate \code{Atot}}
14
+
15
+\item{cnt}{number of branches at which to cut dendrogram}
16
+
17
+\item{minNS}{minimum of individual set contributions a cluster must contain}
18
+
19
+\item{maxNS}{maximum of individual set contributions a cluster must contain}
20
+
21
+\item{ignore.NA}{logical indicating whether or not to ignore NAs from potential over dimensionalization. Default is FALSE.}
22
+
23
+\item{bySet}{logical indicating whether to return list of matched set solutions from \code{Atot}}
24
+
25
+\item{plotDen}{plot}
26
+
27
+\item{...}{additional parameters for \code{agnes}}
28
+}
29
+\value{
30
+a matrix of concensus patterns by samples. If \code{bySet=TRUE} then a list of the set contributions to each
31
+concensus pattern is also returned.
32
+}
33
+\description{
34
+cellMatchR
35
+}
36
+
0 37
new file mode 100644
... ...
@@ -0,0 +1,42 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/calcGeneGSStat.R
3
+\name{computeGeneGSProb}
4
+\alias{computeGeneGSProb}
5
+\title{Compute Gene Probability}
6
+\usage{
7
+computeGeneGSProb(Amean, Asd, GSGenes, Pw = rep(1, ncol(Amean)),
8
+  numPerm = 500, PwNull = FALSE)
9
+}
10
+\arguments{
11
+\item{Amean}{A matrix mean values}
12
+
13
+\item{Asd}{A matrix standard deviations}
14
+
15
+\item{GSGenes}{data.frame or list with gene sets}
16
+
17
+\item{Pw}{weight on genes}
18
+
19
+\item{numPerm}{number of permutations for null}
20
+
21
+\item{PwNull}{- logical indicating gene adjustment}
22
+}
23
+\value{
24
+A vector of length GSGenes containing the p-values of set membership
25
+for each gene containined in the set specified in GSGenes.
26
+}
27
+\description{
28
+Compute Gene Probability
29
+}
30
+\details{
31
+Computes the p-value for gene set membership using the CoGAPS-based
32
+statistics developed in Fertig et al. (2012).  This statistic refines set
33
+membership for each candidate gene in a set specified in \code{GSGenes} by
34
+comparing the inferred activity of that gene to the average activity of the
35
+set.
36
+}
37
+\examples{
38
+data("SimpSim")
39
+computeGeneGSProb(SimpSim.result$Amean, SimpSim.result$Asd, GSGenes=GSets[[1]],
40
+numPerm=500)
41
+}
42
+
0 43
new file mode 100644
... ...
@@ -0,0 +1,31 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/createGWCoGAPSSets.R
3
+\name{createGWCoGAPSSets}
4
+\alias{createGWCoGAPSSets}
5
+\title{Create Gene Sets for GWCoGAPS}
6
+\usage{
7
+createGWCoGAPSSets(D, S, nSets, simulationName)
8
+}
9
+\arguments{
10
+\item{D}{data matrix}
11
+
12
+\item{S}{uncertainty matrix}
13
+
14
+\item{nSets}{number of sets to partition the data into}
15
+
16
+\item{simulationName}{name used to identify files created by this simulation}
17
+}
18
+\value{
19
+simulationName used to identify saved files
20
+}
21
+\description{
22
+Create Gene Sets for GWCoGAPS
23
+}
24
+\details{
25
+factors whole genome data into randomly generated sets for indexing
26
+}
27
+\examples{
28
+data(SimpSim)
29
+createGWCoGAPSSets(SimpSim.D, SimpSim.S, nSets=2, "example")
30
+}
31
+
0 32
new file mode 100644
... ...
@@ -0,0 +1,33 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/createscCoGAPSSets.R
3
+\name{createscCoGAPSSets}
4
+\alias{createscCoGAPSSets}
5
+\title{Create Gene Sets for scCoGAPS}
6
+\usage{
7
+createscCoGAPSSets(D, nSets, simulationName, samplingRatio = NULL,
8
+  path = "", anotionObj = NULL)
9
+}
10
+\arguments{
11
+\item{D}{data matrix}
12
+
13
+\item{nSets}{number of sets to partition the data into}
14
+
15
+\item{simulationName}{name used to identify files created by this simulation}
16
+
17
+\item{samplingRatio}{vector of relative quantities to use for sampling celltypes}
18
+
19
+\item{path}{character string indicating were to save resulting data objects. default is current working dir}
20
+
21
+\item{anotionObj}{vector of same length as number of columns of D}
22
+}
23
+\value{
24
+simulationName used to identify saved files
25
+}
26
+\description{
27
+factors whole genome data into randomly generated sets for indexing
28
+}
29
+\examples{
30
+data(SimpSim)
31
+createscCoGAPSSets(SimpSim.D, nSets=2, simulationName="example")
32
+}
33
+
0 34
new file mode 100644
... ...
@@ -0,0 +1,80 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/CoGAPS.R
3
+\name{gapsMapRun}
4
+\alias{gapsMapRun}
5
+\title{Backwards Compatibility with v2}
6
+\usage{
7
+gapsMapRun(D, S, FP, ABins = data.frame(), PBins = data.frame(),
8
+  nFactor = 5, simulation_id = "simulation", nEquil = 1000,
9
+  nSample = 1000, nOutR = 1000, output_atomic = FALSE,
10
+  fixedMatrix = "P", fixedBinProbs = FALSE, fixedDomain = "N",
11
+  sampleSnapshots = TRUE, numSnapshots = 100, alphaA = 0.01,
12
+  nMaxA = 1e+05, max_gibbmass_paraA = 100, alphaP = 0.01, nMaxP = 1e+05,
13
+  max_gibbmass_paraP = 100, seed = -1, messages = TRUE)
14
+}
15
+\arguments{
16
+\item{D}{data matrix}
17
+
18
+\item{S}{uncertainty matrix}
19
+
20
+\item{FP}{data.frame with rows giving fixed patterns for P}
21
+
22
+\item{ABins}{unused}
23
+
24
+\item{PBins}{unused}
25
+
26
+\item{nFactor}{number of patterns (basis vectors, metagenes), which must be
27
+greater than or equal to the number of rows of FP}
28
+
29
+\item{simulation_id}{unused}
30
+
31
+\item{nEquil}{number of iterations for burn-in}
32
+
33
+\item{nSample}{number of iterations for sampling}
34
+
35
+\item{nOutR}{number of output messages}
36
+
37
+\item{output_atomic}{unused}
38
+
39
+\item{fixedMatrix}{unused}
40
+
41
+\item{fixedBinProbs}{unused}
42
+
43
+\item{fixedDomain}{unused}
44
+
45
+\item{sampleSnapshots}{indicates if snapshots should be made}
46
+
47
+\item{numSnapshots}{how many snapshots to take}
48
+
49
+\item{alphaA}{sparsity parameter for A domain}
50
+
51
+\item{nMaxA}{unused}
52
+
53
+\item{max_gibbmass_paraA}{limit truncated normal to max size}
54
+
55
+\item{alphaP}{sparsity parameter for P domain}
56
+
57
+\item{nMaxP}{unused}
58
+
59
+\item{max_gibbmass_paraP}{limit truncated normal to max size}
60
+
61
+\item{seed}{a positive seed is used as-is, while any negative seed tells
62
+the algorithm to pick a seed based on the current time}
63
+
64
+\item{messages}{display progress messages}
65
+
66
+\item{...}{v2 style parameters}
67
+}
68
+\value{
69
+list with A and P matrix estimates
70
+}
71
+\description{
72
+Backwards Compatibility with v2
73
+}
74
+\examples{
75
+data(SimpSim)
76
+nC <- ncol(SimpSim.D)
77
+patterns <- matrix(1:nC/nC, nrow=1, ncol=nC)
78
+result <- gapsMapRun(SimpSim.D, SimpSim.S, FP=patterns, nFactor=3)
79
+}
80
+
0 81
new file mode 100644
... ...
@@ -0,0 +1,71 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/CoGAPS.R
3
+\name{gapsRun}
4
+\alias{gapsRun}
5
+\title{Backwards Compatibility with v2}
6
+\usage{
7
+gapsRun(D, S, ABins = data.frame(), PBins = data.frame(), nFactor = 7,
8
+  simulation_id = "simulation", nEquil = 1000, nSample = 1000,
9
+  nOutR = 1000, output_atomic = FALSE, fixedBinProbs = FALSE,
10
+  fixedDomain = "N", sampleSnapshots = TRUE, numSnapshots = 100,
11
+  alphaA = 0.01, nMaxA = 1e+05, max_gibbmass_paraA = 100, alphaP = 0.01,
12
+  nMaxP = 1e+05, max_gibbmass_paraP = 100, seed = -1, messages = TRUE)
13
+}
14
+\arguments{
15
+\item{D}{data matrix}
16
+
17
+\item{S}{uncertainty matrix}
18
+
19
+\item{ABins}{unused}
20
+
21
+\item{PBins}{unused}
22
+
23
+\item{nFactor}{number of patterns (basis vectors, metagenes), which must be
24
+greater than or equal to the number of rows of FP}
25
+
26
+\item{simulation_id}{unused}
27
+
28
+\item{nEquil}{number of iterations for burn-in}
29
+
30
+\item{nSample}{number of iterations for sampling}
31
+
32
+\item{nOutR}{number of output messages}
33
+
34
+\item{output_atomic}{unused}
35
+
36
+\item{fixedBinProbs}{unused}
37
+
38
+\item{fixedDomain}{unused}
39
+
40
+\item{sampleSnapshots}{indicates if snapshots should be made}
41
+
42
+\item{numSnapshots}{how many snapshots to take}
43
+
44
+\item{alphaA}{sparsity parameter for A domain}
45
+
46
+\item{nMaxA}{unused}
47
+
48
+\item{max_gibbmass_paraA}{limit truncated normal to max size}
49
+
50
+\item{alphaP}{sparsity parameter for P domain}
51
+
52
+\item{nMaxP}{unused}
53
+
54
+\item{max_gibbmass_paraP}{limit truncated normal to max size}
55
+
56
+\item{seed}{a positive seed is used as-is, while any negative seed tells
57
+the algorithm to pick a seed based on the current time}
58
+
59
+\item{messages}{display progress messages}
60
+}
61
+\value{
62
+list with A and P matrix estimates
63
+}
64
+\description{
65
+Backwards Compatibility with v2
66
+}
67
+\examples{
68
+data(SimpSim)
69
+result <- gapsRun(SimpSim.D, SimpSim.S, nFactor=3)
70
+}
71
+
0 72
new file mode 100644
... ...
@@ -0,0 +1,21 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/generateSeeds.R
3
+\name{generateSeeds}
4
+\alias{generateSeeds}
5
+\title{Generate Seeds for Multiple Concurrent Runs}
6
+\usage{
7
+generateSeeds(chains = 2, seed = -1)
8
+}
9
+\arguments{
10
+\item{chains}{number of seeds to generate (number of chains to run)}
11
+
12
+\item{seed}{positive values are kept, negative values will be overwritten
13
+by a seed generated from the current time}
14
+}
15
+\value{
16
+vector of randomly generated seeds
17
+}
18
+\description{
19
+Generate Seeds for Multiple Concurrent Runs
20
+}
21
+
0 22
new file mode 100644
... ...
@@ -0,0 +1,30 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/patternMarkers.R
3
+\name{patternMarkers}
4
+\alias{patternMarkers}
5
+\title{patternMarkers}
6
+\usage{
7
+patternMarkers(Amatrix = NA, scaledPmatrix = FALSE, Pmatrix = NA,
8
+  threshold = "all", lp = NA, full = FALSE)
9
+}
10
+\arguments{
11
+\item{Amatrix}{A matrix of genes by weights resulting from CoGAPS or other NMF decomposition}
12
+
13
+\item{scaledPmatrix}{logical indicating whether the corresponding pattern matrix was fixed to have max 1 during decomposition}
14
+
15
+\item{Pmatrix}{the corresponding Pmatrix (patterns X samples) for the provided Amatrix (genes x patterns). This must be supplied if scaledPmatrix is FALSE.}
16
+
17
+\item{threshold}{# the type of threshold to be used. The default "all" will distribute genes into pattern with the lowest ranking. The "cut" thresholding by the first gene to have a lower ranking, i.e. better fit to, a pattern.}
18
+
19
+\item{lp}{a vector of weights for each pattern to be used for finding markers. If NA markers for each pattern of the A matrix will be used.}
20
+
21
+\item{full}{logical indicating whether to return the ranks of each gene for each pattern}
22
+}
23
+\value{
24
+By default a non-overlapping list of genes associated with each \code{lp}. If \code{full=TRUE} a data.frame of
25
+genes rankings with a column for each \code{lp} will also be returned.
26
+}
27
+\description{
28
+patternMarkers
29
+}
30
+
0 31
new file mode 100644
... ...
@@ -0,0 +1,44 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/patternMatch4Parallel.R
3
+\name{patternMatch4Parallel}
4
+\alias{patternMatch4Parallel}
5
+\title{patternMatch4Parallel}
6
+\usage{
7
+patternMatch4Parallel(Ptot, nSets, cnt, minNS = NA, maxNS = NULL,
8
+  cluster.method = "complete", ignore.NA = FALSE, bySet = FALSE, ...)
9
+}
10
+\arguments{
11
+\item{Ptot}{a matrix containing the total by set estimates of Pmean output
12
+from \code{reOrderBySet}}
13
+
14
+\item{nSets}{number of parallel sets used to generate \code{Ptot}}
15
+
16
+\item{cnt}{number of branches at which to cut dendrogram}
17
+
18
+\item{minNS}{minimum of individual set contributions a cluster must contain}
19
+
20
+\item{maxNS}{max of individual set contributions a cluster must contain.
21
+default is nSets+minNS}
22
+
23
+\item{cluster.method}{the agglomeration method to be used for clustering}
24
+
25
+\item{ignore.NA}{logical indicating whether or not to ignore NAs from
26
+potential over dimensionalization. Default is FALSE.}
27
+
28
+\item{bySet}{logical indicating whether to return list of matched set
29
+solutions from \code{Ptot}}
30
+
31
+\item{...}{additional parameters for \code{agnes}}
32
+}
33
+\value{
34
+a matrix of concensus patterns by samples. If \code{bySet=TRUE} then
35
+a list of the set contributions to each
36
+concensus pattern is also returned.
37
+}
38
+\description{
39
+patternMatch4Parallel
40
+}
41
+\seealso{
42
+\code{\link{agnes}}
43
+}
44
+
0 45
new file mode 100644
... ...
@@ -0,0 +1,25 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/patternMatcher.R
3
+\name{patternMatcher}
4
+\alias{patternMatcher}
5
+\title{PatternMatcher Shiny Ap}
6
+\usage{
7
+patternMatcher(PBySet = NULL, out = NULL, order = NULL,
8
+  sample.color = NULL)
9
+}
10
+\arguments{
11
+\item{PBySet}{list of matched set solutions for the Pmatrix from an NMF algorithm}
12
+
13
+\item{out}{optional name for saving output}
14
+
15
+\item{order}{optional vector indicating order of samples for plotting. Default is NULL.}
16
+
17
+\item{sample.color}{optional vector of colors of same length as colnames. Default is NULL.}
18
+}
19
+\value{
20
+either an index of selected sets' contributions or the editted \code{PBySet} object
21
+}
22
+\description{
23
+PatternMatcher Shiny Ap
24
+}
25
+
0 26
new file mode 100644
... ...
@@ -0,0 +1,30 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/plotAtoms.R
3
+\name{plotAtoms}
4
+\alias{plotAtoms}
5
+\title{Plot Number of Atoms}
6
+\usage{
7
+plotAtoms(gapsRes, type = "sampA")
8
+}
9
+\arguments{
10
+\item{gapsRes}{the list resulting from applying GAPS}
11
+
12
+\item{type}{the atoms to plot, values are "sampA", "sampP" ,
13
+"equilA", or "equilP" to plot sampling or equilibration teop
14
+atom numbers}
15
+}
16
+\value{
17
+plot
18
+}
19
+\description{
20
+Plot Number of Atoms
21
+}
22
+\details{
23
+a simple plot of the number of atoms
24
+from one of the vectors returned with atom numbers
25
+}
26
+\examples{
27
+data(SimpSim)
28
+plotAtoms(SimpSim.result, type="sampA")
29
+}
30
+
0 31
new file mode 100644
... ...
@@ -0,0 +1,25 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/plotDiag.R
3
+\name{plotDiag}
4
+\alias{plotDiag}
5
+\title{Diagnostic Plots}
6
+\usage{
7
+plotDiag(gapsRes)
8
+}
9
+\arguments{
10
+\item{gapsRes}{list returned by CoGAPS}
11
+}
12
+\value{
13
+plot
14
+}
15
+\description{
16
+Diagnostic Plots
17
+}
18
+\details{
19
+plots a series of diagnostic plots
20
+}
21
+\examples{
22
+data(SimpSim)
23
+plotDiag(SimpSim.result)
24
+}
25
+
0 26
new file mode 100644
... ...
@@ -0,0 +1,31 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/plotGAPS.R
3
+\name{plotGAPS}
4
+\alias{plotGAPS}
5
+\title{Plot Decomposed A and P Matrices}
6
+\usage{
7
+plotGAPS(A, P)
8
+}
9
+\arguments{
10
+\item{A}{the mean A matrix}
11
+
12
+\item{P}{the mean P matrix}
13
+
14
+\item{outputPDF}{optional root name for PDF output, if
15
+not specified, output goes to screen}
16
+}
17
+\value{
18
+plot
19
+}
20
+\description{
21
+Plot Decomposed A and P Matrices
22
+}
23
+\details{
24
+plots the output A and P matrices as a
25
+heatmap and line plot respectively
26
+}
27
+\examples{
28
+data(SimpSim)
29
+plotGAPS(SimpSim.result$Amean, SimpSim.result$Pmean)
30
+}
31
+
0 32
new file mode 100644
... ...
@@ -0,0 +1,27 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/plotP.R
3
+\name{plotP}
4
+\alias{plotP}
5
+\title{Plot the P Matrix}
6
+\usage{
7
+plotP(Pmean, Psd = NULL)
8
+}
9
+\arguments{
10
+\item{Pmean}{matrix of mean values of P}
11
+
12
+\item{Psd}{matrix of standard deviation values of P}
13
+}
14
+\value{
15
+plot
16
+}
17
+\description{
18
+Plot the P Matrix
19
+}
20
+\details{
21
+plots the P matrix in a line plot with error bars
22
+}
23
+\examples{
24
+data(SimpSim)
25
+plotP(SimpSim.result$Pmean, SimpSim.result$Psd)
26
+}
27
+
0 28
new file mode 100644
... ...
@@ -0,0 +1,40 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/plotPatternMarkers.R
3
+\name{plotPatternMarkers}
4
+\alias{plotPatternMarkers}
5
+\title{plotPatternMarkers}
6
+\usage{
7
+plotPatternMarkers(data = NA, patternMarkers = NA, patternPalette = NA,
8
+  sampleNames = NA, samplePalette = NULL, colDenogram = TRUE, heatmapCol,
9
+  scale = "row", ...)
10
+}
11
+\arguments{
12
+\item{data}{the dataset from which the patterns where generated}
13
+
14
+\item{patternMarkers}{the list of genes generated from the patternMarkers function}
15
+
16
+\item{patternPalette}{a vector indicating what color should be used for each pattern}
17
+
18
+\item{sampleNames}{names of the samples to use for labeling}
19
+
20
+\item{samplePalette}{a vector indicating what color should be used for each sample}
21
+
22
+\item{colDenogram}{logical indicating whether to display sample denogram}
23
+
24
+\item{heatmapCol}{pallelet giving color scheme for heatmap}
25
+
26
+\item{scale}{character indicating if the values should be centered and scaled in either 
27
+the row direction or the column direction, or none. The default is "row".}
28
+
29
+\item{...}{additional graphical parameters to be passed to \code{heatmap.2}}
30
+}
31
+\value{
32
+heatmap of the \code{data} values for the \code{patternMarkers}
33
+}
34
+\description{
35
+plotPatternMarkers
36
+}
37
+\seealso{
38
+\code{\link{heatmap.2}}
39
+}
40
+
0 41
new file mode 100644
... ...
@@ -0,0 +1,46 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/plotSmoothPatterns.R
3
+\name{plotSmoothPatterns}
4
+\alias{plotSmoothPatterns}
5
+\title{Plot Smooth Patterns}
6
+\usage{
7
+plotSmoothPatterns(P, x = NULL, breaks = NULL, breakStyle = TRUE,
8
+  orderP = !all(is.null(x)), plotPTS = FALSE, pointCol = "black",
9
+  lineCol = "grey", add = FALSE, ...)
10
+}
11
+\arguments{
12
+\item{P}{the mean A matrix}
13
+
14
+\item{x}{optional variables}
15
+
16
+\item{breaks}{breaks in plots}
17
+
18
+\item{breakStyle}{style of breaks}
19
+
20
+\item{orderP}{whether to order patterns}
21
+
22
+\item{plotPTS}{whether to plot points on lines}
23
+
24
+\item{pointCol}{color of points}
25
+
26
+\item{lineCol}{color of line}
27
+
28
+\item{add}{logical specifying if bars should be added to an already existing
29
+plot; defaults to `FALSE'.}
30
+
31
+\item{...}{arguments to be passed to/from other methods.  For the default
32
+method these can include further arguments (such as `axes', `asp' and
33
+`main') and graphical parameters (see `par') which are passed to
34
+`plot.window()', `title()' and `axis'.}
35
+}
36
+\value{
37
+plot
38
+}
39
+\description{
40
+Plot Smooth Patterns
41
+}
42
+\details{
43
+plots the output A and P matrices as a heatmap and a
44
+line plot respectively
45
+}
46
+
0 47
new file mode 100644
... ...
@@ -0,0 +1,24 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/postFixed4Parallel.R
3
+\name{postFixed4Parallel}
4
+\alias{postFixed4Parallel}
5
+\title{Post Processing of Parallel Output}
6
+\usage{
7
+postFixed4Parallel(AP.fixed, setValues, setMatrix = "P")
8
+}
9
+\arguments{
10
+\item{AP.fixed}{output of parallel gapsMapRun calls with same FP}
11
+
12
+\item{setValues}{data.frame with rows giving fixed patterns for P used as input
13
+for gapsMapRun}
14
+
15
+\item{setMatrix}{which matrix, A or P}
16
+}
17
+\value{
18
+list of two data.frames containing the A matrix estimates or their
19
+corresponding standard deviations from output of parallel CoGAPS
20
+}
21
+\description{
22
+Post Processing of Parallel Output
23
+}
24
+
0 25
new file mode 100644
... ...
@@ -0,0 +1,22 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/postFixed4SC.R
3
+\name{postFixed4SC}
4
+\alias{postFixed4SC}
5
+\title{Post Processing of Parallel Output}
6
+\usage{
7
+postFixed4SC(AP.fixed, setAs)
8
+}
9
+\arguments{
10
+\item{AP.fixed}{output of parallel gapsMapRun calls with same FP}
11
+
12
+\item{setAs}{data.frame with rows giving fixed patterns for A used as input
13
+for gapsMapRun}
14
+}
15
+\value{
16
+list of two data.frames containing the A matrix estimates or their
17
+corresponding standard deviations from output of parallel CoGAPS
18
+}
19
+\description{
20
+Post Processing of Parallel Output
21
+}
22
+
0 23
new file mode 100644
... ...
@@ -0,0 +1,24 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/reOrderBySet.R
3
+\name{reOrderBySet}
4
+\alias{reOrderBySet}
5
+\title{reOrderBySet}
6
+\usage{
7
+reOrderBySet(AP, nFactor, nSets, match = "P")
8
+}
9
+\arguments{
10
+\item{AP}{output of gapsRun in parallel}
11
+
12
+\item{nFactor}{number of patterns}
13
+
14
+\item{nSets}{number of sets}
15
+
16
+\item{match}{which matrix to use for downstream matching. default is P}
17
+}
18
+\value{
19
+a list containing the \code{nSets} sets solution for Amean under "A", Pmean under "P", and Asd under "Asd"
20
+}
21
+\description{
22
+<restructures output of gapsRun into a list containing each sets solution for Amean, Pmean, and Asd>
23
+}
24
+
0 25
new file mode 100644
... ...
@@ -0,0 +1,26 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/reconstructGene.R
3
+\name{reconstructGene}
4
+\alias{reconstructGene}
5
+\title{Reconstruct Gene}
6
+\usage{
7
+reconstructGene(A, P, genes = NA)
8
+}
9
+\arguments{
10
+\item{A}{A matrix estimates}
11
+
12
+\item{P}{corresponding P matrix estimates}
13
+
14
+\item{genes}{an index of the gene or genes of interest}
15
+}
16
+\value{
17
+the D' estimate of a gene or set of genes
18
+}
19
+\description{
20
+Reconstruct Gene
21
+}
22
+\examples{
23
+data(SimpSim)
24
+reconstructGene(SimpSim.result$Amean, SimpSim.result$Pmean)
25
+}
26
+
0 27
new file mode 100644
... ...
@@ -0,0 +1,20 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/reorderByPatternMatch.R
3
+\name{reorderByPatternMatch}
4
+\alias{reorderByPatternMatch}
5
+\title{Reorder By Pattern Match}
6
+\usage{
7
+reorderByPatternMatch(P, matchTo)
8
+}
9
+\arguments{
10
+\item{P}{matrix to be matched}
11
+
12
+\item{matchTo}{matrix to match P to}
13
+}
14
+\value{
15
+matched patterns
16
+}
17
+\description{
18
+Reorder By Pattern Match
19
+}
20
+
0 21
new file mode 100644
... ...
@@ -0,0 +1,31 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/residuals.R
3
+\name{residuals}
4
+\alias{residuals}
5
+\title{Plot of Residuals}
6
+\usage{
7
+residuals(AMean_Mat, PMean_Mat, D, S)
8
+}
9
+\arguments{
10
+\item{AMean_Mat}{matrix of mean values for A from GAPS}
11
+
12
+\item{PMean_Mat}{matrix of mean values for P from GAPS}
13
+
14
+\item{D}{original data matrix run through GAPS}
15
+
16
+\item{S}{original standard deviation matrix run through GAPS}
17
+}
18
+\value{
19
+creates a residual plot
20
+}
21
+\description{
22
+Plot of Residuals
23
+}
24
+\details{
25
+calculate residuals and produce heatmap
26
+}
27
+\examples{
28
+data(SimpSim)
29
+residuals(SimpSim.result$Amean, SimpSim.result$Pmean, SimpSim.D, SimpSim.S)
30
+}
31
+
0 32
new file mode 100644
... ...
@@ -0,0 +1,39 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/scCoGAPS.R
3
+\name{scCoGAPS}
4
+\alias{scCoGAPS}
5
+\title{scCoGAPS}
6
+\usage{
7
+scCoGAPS(simulationName, nFactor, nCores = NA, cut = NA, minNS = NA,
8
+  manualMatch = FALSE, consensusAs = NULL, ...)
9
+}
10
+\arguments{
11
+\item{simulationName}{name of this simulation}
12
+
13
+\item{nFactor}{number of patterns (basis vectors, metagenes), which must be
14
+greater than or equal to the number of rows of FP}
15
+
16
+\item{nCores}{number of cores for parallelization. If left to the default NA, nCores = nSets.}
17
+
18
+\item{cut}{number of branches at which to cut dendrogram used in patternMatch4singleCell}
19
+
20
+\item{minNS}{minimum of individual set contributions a cluster must contain}
21
+
22
+\item{manualMatch}{logical indicating whether or not to stop after initial phase for manual pattern matching}
23
+
24
+\item{consensusAs}{fixed pattern matrix to be used to ensure reciprocity of A weights accross sets}
25
+
26
+\item{...}{additional parameters to be fed into \code{gapsRun} and \code{gapsMapRun}}
27
+}
28
+\value{
29
+list of A and P estimates
30
+}
31
+\description{
32
+scCoGAPS
33
+}
34
+\details{
35
+calls the C++ MCMC code and performs Bayesian
36
+matrix factorization returning the two matrices that reconstruct
37
+the data matrix for whole genome data;
38
+}
39
+
0 40
new file mode 100644
... ...
@@ -0,0 +1,26 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/scCoGAPS.R
3
+\name{scCoGapsFromCheckpoint}
4
+\alias{scCoGapsFromCheckpoint}
5
+\title{Restart a scCoGAPS run from a Checkpoint}
6
+\usage{
7
+scCoGapsFromCheckpoint(simulationName, nCores, cut = NA, minNS = NA, ...)
8
+}
9
+\arguments{
10
+\item{simulationName}{name of this simulation}
11
+
12
+\item{nCores}{number of cores for parallelization. If left to the default NA, nCores = nSets.}
13
+
14
+\item{cut}{number of branches at which to cut dendrogram used in patternMatch4Parallel}
15
+
16
+\item{minNS}{minimum of individual set contributions a cluster must contain}
17
+
18
+\item{...}{additional parameters to be fed into \code{gapsRun} and \code{gapsMapRun}}
19
+}
20
+\value{
21
+list of A and P estimates
22
+}
23
+\description{
24
+Restart a scCoGAPS run from a Checkpoint
25
+}
26
+
... ...
@@ -14,7 +14,7 @@ Atom AtomicDomain::front() const
14 14
 // O(1)
15 15
 Atom AtomicDomain::randomAtom() const
16 16
 {
17
-    uint64_t ndx = gaps::random::Generator::uniform64(0, mAtoms.size() - 1);
17
+    uint64_t ndx = gaps::random::uniform64(0, mAtoms.size() - 1);
18 18
     return mAtoms[ndx];
19 19
 }
20 20
 
... ...
@@ -24,7 +24,7 @@ uint64_t AtomicDomain::randomFreePosition() const
24 24
     uint64_t pos = 0;
25 25
     do
26 26
     {
27
-        pos = gaps::random::Generator::uniform64(0, mDomainSize);
27
+        pos = gaps::random::uniform64(0, mDomainSize);
28 28
     } while (mUsedPositions.count(pos) > 0); // hash map => count is O(l)
29 29
     return pos;
30 30
 }
... ...
@@ -21,7 +21,7 @@ mNumCores(nCores)
21 21
 {
22 22
     mASampler.sync(mPSampler);
23 23
     mPSampler.sync(mASampler);
24
-    gaps::random::Generator::setSeed(seed);
24
+    gaps::random::setSeed(seed);
25 25
 }
26 26
 
27 27
 GapsRunner::GapsRunner(const Rcpp::NumericMatrix &D, const Rcpp::NumericMatrix &S,
... ...
@@ -197,8 +197,8 @@ void GapsRunner::storeSamplerInfo(Vector &atomsA, Vector &atomsP, Vector &chi2)
197 197
     chi2[mCurrentIter] = mASampler.chi2();
198 198
     atomsA[mCurrentIter] = mASampler.nAtoms();
199 199
     atomsP[mCurrentIter] = mPSampler.nAtoms();
200
-    mIterA = gaps::random::Generator::poisson(std::max(atomsA[mCurrentIter], 10.f));
201
-    mIterP = gaps::random::Generator::poisson(std::max(atomsP[mCurrentIter], 10.f));
200
+    mIterA = gaps::random::poisson(std::max(atomsA[mCurrentIter], 10.f));
201
+    mIterP = gaps::random::poisson(std::max(atomsP[mCurrentIter], 10.f));
202 202
 }
203 203
 
204 204
 static void printTime(const std::string &message, unsigned totalSeconds)
... ...
@@ -243,7 +243,7 @@ void GibbsSampler<T, MatA, MatB>::birth(uint64_t pos, unsigned row,
243 243
 unsigned col)
244 244
 {
245 245
     float mass = impl()->canUseGibbs(row, col) ? gibbsMass(row, col, 0.f)
246
-        : gaps::random::Generator::exponential(mLambda);
246
+        : gaps::random::exponential(mLambda);
247 247
     if (mass >= gaps::algo::epsilon)
248 248
     {
249 249
         mDomain.updateMass(pos, mass);
... ...
@@ -273,7 +273,7 @@ unsigned col)
273 273
     float newMass = impl()->canUseGibbs(row, col) ? gibbsMass(row, col, -mass) : 0.f;
274 274
     mass = newMass < gaps::algo::epsilon ? mass : newMass;
275 275
     float deltaLL = impl()->computeDeltaLL(row, col, mass);
276
-    if (deltaLL * mAnnealingTemp >= std::log(gaps::random::Generator::uniform()))
276
+    if (deltaLL * mAnnealingTemp >= std::log(gaps::random::uniform()))
277 277
     {
278 278
         mDomain.updateMass(pos, mass);
279 279
         mMatrix(row, col) += mass;
... ...
@@ -295,7 +295,7 @@ unsigned r1, unsigned c1, unsigned r2, unsigned c2)
295 295
     if (r1 != r2 || c1 != c2) // automatically reject if change in same bin
296 296
     {
297 297
         float deltaLL = impl()->computeDeltaLL(r1, c1, -mass, r2, c2, mass);
298
-        if (deltaLL * mAnnealingTemp > std::log(gaps::random::Generator::uniform()))
298
+        if (deltaLL * mAnnealingTemp > std::log(gaps::random::uniform()))
299 299
         {
300 300
             removeMass(src, mass, r1, c1);
301 301
             addMass(dest, mass, r2, c2);
... ...
@@ -311,7 +311,7 @@ void GibbsSampler<T, MatA, MatB>::exchange(uint64_t p1, float m1, uint64_t p2,
311 311
 float m2, unsigned r1, unsigned c1, unsigned r2, unsigned c2)
312 312
 {
313 313
     float pUpper = gaps::random::p_gamma(m1 + m2, 2.f, 1.f / mLambda);
314
-    float newMass = gaps::random::Generator::inverseGammaSample(0.f, pUpper, 2.f, 1.f / mLambda);
314
+    float newMass = gaps::random::inverseGammaSample(0.f, pUpper, 2.f, 1.f / mLambda);
315 315
     if (r1 != r2 || c1 != c2) // automatically reject if change in same bin
316 316
     {
317 317
         if ((m1 > m2 && newMass - m1 < 0) || (m1 < m2 && m2 - newMass < 0))
... ...
@@ -347,7 +347,7 @@ float m2, unsigned r1, unsigned c1, unsigned r2, unsigned c2)
347 347
         {
348 348
             float deltaLL = impl()->computeDeltaLL(r1, c1, delta, r2, c2, -delta);
349 349
             float priorLL = (pOld == 0.f) ? 1.f : pOld / pNew;
350
-            float u = std::log(gaps::random::Generator::uniform() * priorLL);
350
+            float u = std::log(gaps::random::uniform() * priorLL);
351 351
             if (u < deltaLL * mAnnealingTemp)
352 352
             {
353 353
                 acceptExchange(p1, m1, delta, p2, m2, -delta, r1, c1, r2, c2);
... ...
@@ -418,7 +418,7 @@ float GibbsSampler<T, MatA, MatB>::gibbsMass(unsigned row, unsigned col, float m
418 418
 
419 419
         if (pLower < 1.f)
420 420
         {
421
-            float m = gaps::random::Generator::inverseNormSample(pLower, 1.f, mean, sd);
421
+            float m = gaps::random::inverseNormSample(pLower, 1.f, mean, sd);
422 422
             return std::max(std::min(m, mMaxGibbsMass), 0.f);
423 423
         }
424 424
     }
... ...
@@ -442,7 +442,7 @@ unsigned r2, unsigned c2, float m2)
442 442
 
443 443
         if (!(pLower >  0.95f || pUpper < 0.05f))
444 444
         {
445
-            float delta = gaps::random::Generator::inverseNormSample(pLower, pUpper, mean, sd);
445
+            float delta = gaps::random::inverseNormSample(pLower, pUpper, mean, sd);
446 446
             return std::min(std::max(-m1, delta), m2); // conserve mass
447 447
         }
448 448
     }
... ...
@@ -103,8 +103,8 @@ bool ProposalQueue::makeProposal(AtomicDomain &domain)
103 103
 
104 104
     float bdProb = mMaxAtoms < 2 ? 0.6667f : 0.5f;
105 105
 
106
-    mU1 = mUseCachedRng ? mU1 : gaps::random::Generator::uniform();
107
-    mU2 = mUseCachedRng ? mU2: gaps::random::Generator::uniform();
106
+    mU1 = mUseCachedRng ? mU1 : gaps::random::uniform();
107
+    mU2 = mUseCachedRng ? mU2: gaps::random::uniform();
108 108
     mUseCachedRng = false;
109 109
 
110 110
     float lowerBound = deathProb(mMinAtoms);
... ...
@@ -168,7 +168,7 @@ bool ProposalQueue::move(AtomicDomain &domain)
168 168
         return false;
169 169
     }
170 170
 
171
-    uint64_t newLocation = gaps::random::Generator::uniform64(lbound, rbound - 1);
171
+    uint64_t newLocation = gaps::random::uniform64(lbound, rbound - 1);
172 172
     if (mUsedIndices.count(a.pos / mDimensionSize) || mUsedIndices.count(newLocation / mDimensionSize))
173 173
     {
174 174
         return false; // matrix conflict - can't compute deltaLL
... ...
@@ -5,11 +5,11 @@
5 5
 
6 6
 TEST_CASE("Test Random.h - Random Number Generation")
7 7
 {
8
-    gaps::random::Generator::setSeed(0);
8
+    gaps::random::setSeed(0);
9 9
 
10 10
     SECTION("Make sure uniform01 is working")
11 11
     {
12
-        REQUIRE(gaps::random::Generator::uniform() != gaps::random::Generator::uniform());
12
+        REQUIRE(gaps::random::uniform() != gaps::random::uniform());
13 13
     }
14 14
 
15 15
     SECTION("Test uniform distribution over unit interval")
... ...
@@ -19,9 +19,9 @@ TEST_CASE("Test Random.h - Random Number Generation")
19 19
         unsigned N = 10000;
20 20
         for (unsigned i = 0; i < N; ++i)
21 21
         {
22
-            min = std::min(gaps::random::Generator::uniform(), min);
23
-            max = std::max(gaps::random::Generator::uniform(), max);
24
-            sum += gaps::random::Generator::uniform();
22
+            min = std::min(gaps::random::uniform(), min);
23
+            max = std::max(gaps::random::uniform(), max);
24
+            sum += gaps::random::uniform();
25 25
         }
26 26
         REQUIRE(sum / N == Approx(0.5f).epsilon(0.01f));
27 27
         REQUIRE(min >= 0.f);
... ...
@@ -33,14 +33,14 @@ TEST_CASE("Test Random.h - Random Number Generation")
33 33
     SECTION("Test uniform distribution over general interval")
34 34
     {
35 35
         // bounds equal
36
-        REQUIRE(gaps::random::Generator::uniform(4.3f, 4.3f) == 4.3f);
36
+        REQUIRE(gaps::random::uniform(4.3f, 4.3f) == 4.3f);
37 37
 
38 38
         // full range possible
39 39
         float min = 10., max = 0.;
40 40
         for (unsigned i = 0; i < 1000; ++i)
41 41
         {
42
-            min = std::min(gaps::random::Generator::uniform(0.f,10.f), min);
43
-            max = std::max(gaps::random::Generator::uniform(0.f,10.f), max);
42
+            min = std::min(gaps::random::uniform(0.f,10.f), min);
43
+            max = std::max(gaps::random::uniform(0.f,10.f), max);
44 44
         }
45 45
         REQUIRE(min < 0.1f);
46 46
         REQUIRE(max > 9.9f);
... ...
@@ -58,7 +58,7 @@ TEST_CASE("Test Random.h - Random Number Generation")
58 58
         float norm[1024];
59 59
         for (unsigned i = 0; i < 1024; ++i)
60 60
         {
61
-            norm[i] = gaps::random::Generator::normal(0.f, 1.f);
61
+            norm[i] = gaps::random::normal(0.f, 1.f);
62 62
             mean += norm[i];
63 63
         }
64 64
 
... ...
@@ -78,7 +78,7 @@ TEST_CASE("Test Random.h - Random Number Generation")
78 78
         float total = 0.f;
79 79
         for (unsigned i = 0; i < 10000; ++i)
80 80
         {
81
-            float num = gaps::random::Generator::poisson(4.f);
81
+            float num = gaps::random::poisson(4.f);
82 82
             total += num;
83 83
 
84 84
             REQUIRE((int)num == num); // should be integer
... ...
@@ -93,7 +93,7 @@ TEST_CASE("Test Random.h - Random Number Generation")
93 93
         float total = 0.f;
94 94
         for (unsigned i = 0; i < 10000; ++i)
95 95
         {
96
-            float num = gaps::random::Generator::exponential(1.f);
96
+            float num = gaps::random::exponential(1.f);
97 97
             total += num;
98 98
 
99 99
             REQUIRE(num >= 0.f); // should be non-negative