... | ... |
@@ -1,10 +1,28 @@ |
1 | 1 |
#' CoGAPS Matrix Factorization Algorithm |
2 | 2 |
#' |
3 | 3 |
#' @details calls the C++ MCMC code and performs Bayesian |
4 |
-#'matrix factorization returning the two matrices that reconstruct |
|
5 |
-#'the data matrix |
|
4 |
+#' matrix factorization returning the two matrices that reconstruct |
|
5 |
+#' the data matrix |
|
6 | 6 |
#' @param D data matrix |
7 | 7 |
#' @param S uncertainty matrix (std devs for chi-squared of Log Likelihood) |
8 |
+#' @param nFactor number of patterns (basis vectors, metagenes), which must be |
|
9 |
+#' greater than or equal to the number of rows of FP |
|
10 |
+#' @param nEquil number of iterations for burn-in |
|
11 |
+#' @param nSample number of iterations for sampling |
|
12 |
+#' @param nOutputs how often to print status into R by iterations |
|
13 |
+#' @param nSnapshots the number of individual samples to capture |
|
14 |
+#' @param alphaA sparsity parameter for A domain |
|
15 |
+#' @param alphaP sparsity parameter for P domain |
|
16 |
+#' @param maxGibbmassA limit truncated normal to max size |
|
17 |
+#' @param maxGibbmassP limit truncated normal to max size |
|
18 |
+#' @param seed a positive seed is used as-is, while any negative seed tells |
|
19 |
+#' the algorithm to pick a seed based on the current time |
|
20 |
+#' @param messages display progress messages |
|
21 |
+#' @param singleCellRNASeq indicates if the data is single cell RNA-seq data |
|
22 |
+#' @param whichMatrixFixed character to indicate whether A or P matric contains |
|
23 |
+#' the fixed patterns |
|
24 |
+#' @param fixedPatterns matrix of fixed values in either A or P matrix |
|
25 |
+#' @param checkpointInterval time (in seconds) between creating a checkpoint |
|
8 | 26 |
#' @return list with A and P matrix estimates |
9 | 27 |
#' @importFrom methods new |
10 | 28 |
#' @export |
... | ... |
@@ -63,6 +81,9 @@ CoGapsFromCheckpoint <- function(D, S, path) |
63 | 81 |
} |
64 | 82 |
|
65 | 83 |
#' Display Information About Package Compilation |
84 |
+#' |
|
85 |
+#' @details displays information about how the package was compiled, i.e. which |
|
86 |
+#' compiler/version was used, which compile time options were enabled, etc... |
|
66 | 87 |
#' @export |
67 | 88 |
displayBuildReport <- function() |
68 | 89 |
{ |
... | ... |
@@ -1,8 +1,8 @@ |
1 | 1 |
#' Plot of Residuals |
2 | 2 |
#' |
3 | 3 |
#' @details calculate residuals and produce heatmap |
4 |
-#' @param Amean matrix of mean values for A from GAPS |
|
5 |
-#' @param Pmean matrix of mean values for P from GAPS |
|
4 |
+#' @param AMean_Mat matrix of mean values for A from GAPS |
|
5 |
+#' @param PMean_Mat matrix of mean values for P from GAPS |
|
6 | 6 |
#' @param D original data matrix run through GAPS |
7 | 7 |
#' @param S original standard deviation matrix run through GAPS |
8 | 8 |
#' @export |
... | ... |
@@ -14,6 +14,39 @@ CoGAPS(D, S, nFactor = 7, nEquil = 1000, nSample = 1000, |
14 | 14 |
\item{D}{data matrix} |
15 | 15 |
|
16 | 16 |
\item{S}{uncertainty matrix (std devs for chi-squared of Log Likelihood)} |
17 |
+ |
|
18 |
+\item{nFactor}{number of patterns (basis vectors, metagenes), which must be |
|
19 |
+greater than or equal to the number of rows of FP} |
|
20 |
+ |
|
21 |
+\item{nEquil}{number of iterations for burn-in} |
|
22 |
+ |
|
23 |
+\item{nSample}{number of iterations for sampling} |
|
24 |
+ |
|
25 |
+\item{nOutputs}{how often to print status into R by iterations} |
|
26 |
+ |
|
27 |
+\item{nSnapshots}{the number of individual samples to capture} |
|
28 |
+ |
|
29 |
+\item{alphaA}{sparsity parameter for A domain} |
|
30 |
+ |
|
31 |
+\item{alphaP}{sparsity parameter for P domain} |
|
32 |
+ |
|
33 |
+\item{maxGibbmassA}{limit truncated normal to max size} |
|
34 |
+ |
|
35 |
+\item{maxGibbmassP}{limit truncated normal to max size} |
|
36 |
+ |
|
37 |
+\item{seed}{a positive seed is used as-is, while any negative seed tells |
|
38 |
+the algorithm to pick a seed based on the current time} |
|
39 |
+ |
|
40 |
+\item{messages}{display progress messages} |
|
41 |
+ |
|
42 |
+\item{singleCellRNASeq}{indicates if the data is single cell RNA-seq data} |
|
43 |
+ |
|
44 |
+\item{whichMatrixFixed}{character to indicate whether A or P matric contains |
|
45 |
+the fixed patterns} |
|
46 |
+ |
|
47 |
+\item{fixedPatterns}{matrix of fixed values in either A or P matrix} |
|
48 |
+ |
|
49 |
+\item{checkpointInterval}{time (in seconds) between creating a checkpoint} |
|
17 | 50 |
} |
18 | 51 |
\value{ |
19 | 52 |
list with A and P matrix estimates |
... | ... |
@@ -23,7 +56,7 @@ CoGAPS Matrix Factorization Algorithm |
23 | 56 |
} |
24 | 57 |
\details{ |
25 | 58 |
calls the C++ MCMC code and performs Bayesian |
26 |
-matrix factorization returning the two matrices that reconstruct |
|
27 |
-the data matrix |
|
59 |
+ matrix factorization returning the two matrices that reconstruct |
|
60 |
+ the data matrix |
|
28 | 61 |
} |
29 | 62 |
|
... | ... |
@@ -9,4 +9,8 @@ displayBuildReport() |
9 | 9 |
\description{ |
10 | 10 |
Display Information About Package Compilation |
11 | 11 |
} |
12 |
+\details{ |
|
13 |
+displays information about how the package was compiled, i.e. which |
|
14 |
+ compiler/version was used, which compile time options were enabled, etc... |
|
15 |
+} |
|
12 | 16 |
|
... | ... |
@@ -7,13 +7,13 @@ |
7 | 7 |
residuals(AMean_Mat, PMean_Mat, D, S) |
8 | 8 |
} |
9 | 9 |
\arguments{ |
10 |
-\item{D}{original data matrix run through GAPS} |
|
10 |
+\item{AMean_Mat}{matrix of mean values for A from GAPS} |
|
11 | 11 |
|
12 |
-\item{S}{original standard deviation matrix run through GAPS} |
|
12 |
+\item{PMean_Mat}{matrix of mean values for P from GAPS} |
|
13 | 13 |
|
14 |
-\item{Amean}{matrix of mean values for A from GAPS} |
|
14 |
+\item{D}{original data matrix run through GAPS} |
|
15 | 15 |
|
16 |
-\item{Pmean}{matrix of mean values for P from GAPS} |
|
16 |
+\item{S}{original standard deviation matrix run through GAPS} |
|
17 | 17 |
} |
18 | 18 |
\description{ |
19 | 19 |
Plot of Residuals |
... | ... |
@@ -198,11 +198,11 @@ static Rcpp::List runCogaps(GapsInternalState &state) |
198 | 198 |
|
199 | 199 |
// [[Rcpp::export]] |
200 | 200 |
Rcpp::List cogaps_cpp(const Rcpp::NumericMatrix &D, |
201 |
-const Rcpp::NumericMatrix &S, unsigned nFactor, unsigned nEquil, unsigned nEquilCool, |
|
202 |
-unsigned nSample, unsigned nOutputs, unsigned nSnapshots, float alphaA, |
|
203 |
-float alphaP, float maxGibbmassA, float maxGibbmassP, int seed, bool messages, |
|
204 |
-bool singleCellRNASeq, char whichMatrixFixed, const Rcpp::NumericMatrix &FP, |
|
205 |
-unsigned checkpointInterval) |
|
201 |
+const Rcpp::NumericMatrix &S, unsigned nFactor, unsigned nEquil, |
|
202 |
+unsigned nEquilCool, unsigned nSample, unsigned nOutputs, unsigned nSnapshots, |
|
203 |
+float alphaA, float alphaP, float maxGibbmassA, float maxGibbmassP, int seed, |
|
204 |
+bool messages, bool singleCellRNASeq, char whichMatrixFixed, |
|
205 |
+const Rcpp::NumericMatrix &FP, unsigned checkpointInterval) |
|
206 | 206 |
{ |
207 | 207 |
// set seed |
208 | 208 |
uint32_t seedUsed = static_cast<uint32_t>(seed); |
... | ... |
@@ -215,9 +215,9 @@ unsigned checkpointInterval) |
215 | 215 |
gaps::random::setSeed(seedUsed); |
216 | 216 |
|
217 | 217 |
// create internal state from parameters and run from there |
218 |
- GapsInternalState state(D, S, nFactor, nEquil, nEquilCool, nSample, nOutputs, nSnapshots, |
|
219 |
- alphaA, alphaP, maxGibbmassA, maxGibbmassP, seed, messages, |
|
220 |
- singleCellRNASeq, whichMatrixFixed, FP, checkpointInterval); |
|
218 |
+ GapsInternalState state(D, S, nFactor, nEquil, nEquilCool, nSample, |
|
219 |
+ nOutputs, nSnapshots, alphaA, alphaP, maxGibbmassA, maxGibbmassP, seed, |
|
220 |
+ messages, singleCellRNASeq, whichMatrixFixed, FP, checkpointInterval); |
|
221 | 221 |
return runCogaps(state); |
222 | 222 |
} |
223 | 223 |
|