Browse code

passing checks

Tom Sherman authored on 05/06/2018 22:04:02
Showing 24 changed files

... ...
@@ -9,17 +9,27 @@
9 9
 ^inst/profiling/
10 10
 ^inst/vignettes/
11 11
 
12
-^src/Algorithms.o
13
-^src/AtomicSupport.o
12
+^src/AtomicDomain.o
14 13
 ^src/Cogaps.o
14
+^src/GapsRunner.o
15
+^src/GapsStatistics.o
15 16
 ^src/GibbsSampler.o
16
-^src/Matrix.o
17
-^src/Random.o
17
+^src/ProposalQueue.o
18 18
 ^src/RcppExports.o
19 19
 ^src/test-runner.o
20
+^src/data_structures/Matrix.o
21
+^src/data_structures/Vector.o
22
+^src/file_parser/CsvParser.o
23
+^src/file_parser/TsvParser.o
24
+^src/file_parser/MtxParser.o
25
+^src/math/Algorithms.o
26
+^src/math/Random.o
20 27
 ^src/cpp_tests/testAlgorithms.o
21
-^src/cpp_tests/testAtomicSupport.o
28
+^src/cpp_tests/testAtomicDomain.o
29
+^src/cpp_tests/testEfficientSets.o
30
+^src/cpp_tests/testFileParsers.o
31
+^src/cpp_tests/testGapsRunner.o
22 32
 ^src/cpp_tests/testGibbsSampler.o
23 33
 ^src/cpp_tests/testMatrix.o
24
-^src/cpp_tests/testRandom.o
25
-^src/cpp_tests/testSerialization.o
26 34
\ No newline at end of file
35
+^src/cpp_tests/testProposalQueue.o
36
+^src/cpp_tests/testRandom.o
27 37
\ No newline at end of file
... ...
@@ -14,7 +14,7 @@ Description: Coordinated Gene Activity in Pattern Sets (CoGAPS)
14 14
 Maintainer: Elana J. Fertig <ejfertig@jhmi.edu>,
15 15
     Thomas D. Sherman <tomsherman159@gmail.com>
16 16
 Depends:
17
-    R (>= 3.3.0),
17
+    R (>= 3.4.0),
18 18
     Rcpp (>= 0.11.0)
19 19
 Imports:
20 20
     RColorBrewer (>= 1.0.5),
... ...
@@ -34,6 +34,7 @@
34 34
 #' @param fixedPatterns matrix of fixed values in either A or P matrix
35 35
 #' @param checkpointInterval time (in seconds) between creating a checkpoint
36 36
 #' @param checkpointFile name of the checkpoint file
37
+#' @param nCores number of cpu cores to run in parallel over
37 38
 #' @param ... keeps backwards compatibility with arguments from older versions
38 39
 #' @return list with A and P matrix estimates
39 40
 #' @importFrom methods new
... ...
@@ -130,6 +131,12 @@ CoGapsFromCheckpoint <- function(D, S, path, checkpointFile=NA)
130 131
 
131 132
 #' CoGAPS with file input for matrix
132 133
 #' @export
134
+#'
135
+#' @param D file path for data matrix
136
+#' @return list with A and P matrix estimates
137
+#' @examples
138
+#'  file <- system.file("extdata/GIST.mtx", package="CoGAPS")
139
+#'  CoGAPSFromFile(file)
133 140
 CoGAPSFromFile <- function(D)
134 141
 {
135 142
     cogapsFromFile_cpp(D)
... ...
@@ -38,3 +38,69 @@
38 38
 #' @import ggplot2
39 39
 #' @useDynLib CoGAPS
40 40
 NULL
41
+
42
+#' Simulated data
43
+#' @docType data
44
+#' @name SimpSim.D
45
+#' @usage SimpSim.D
46
+NULL
47
+
48
+#' Simulated data
49
+#' @docType data
50
+#' @name SimpSim.S
51
+#' @usage SimpSim.S
52
+NULL
53
+
54
+#' Simulated data
55
+#' @docType data
56
+#' @name SimpSim.A
57
+#' @usage SimpSim.A
58
+NULL
59
+
60
+#' Simulated data
61
+#' @docType data
62
+#' @name SimpSim.P
63
+#' @usage SimpSim.P
64
+NULL
65
+
66
+#' CoGAPS result from running on simulated data
67
+#' @docType data
68
+#' @name SimpSim.result
69
+#' @usage SimpSim.result
70
+NULL
71
+
72
+#' Sample GIST gene expression data from Ochs et al. (2009)
73
+#' @docType data
74
+#' @name GIST.D
75
+#' @usage GIST.D
76
+NULL
77
+
78
+#' Sample GIST gene expression data from Ochs et al. (2009)
79
+#' @docType data
80
+#' @name GIST.S
81
+#' @usage GIST.S
82
+NULL
83
+
84
+#' Simulated dataset to quantify gene set membership in the GIST dataset 
85
+#' @docType data
86
+#' @name GIST.GeneSets
87
+#' @usage GIST.GeneSets
88
+NULL
89
+
90
+#' CoGAPS result from running on GIST dataset
91
+#' @docType data
92
+#' @name GIST.result
93
+#' @usage GIST.result
94
+NULL
95
+
96
+#' Simulated dataset to quantify gene set membership.
97
+#' @docType data
98
+#' @name GSets
99
+#' @usage GSets
100
+NULL
101
+
102
+#' Gene sets defined by transcription factors defined from TRANSFAC.
103
+#' @docType data
104
+#' @name tf2ugFC
105
+#' @usage tf2ugFC
106
+NULL
41 107
\ No newline at end of file
... ...
@@ -11,22 +11,39 @@
11 11
 #' data(SimpSim)
12 12
 #' plotGAPS(SimpSim.result$Amean, SimpSim.result$Pmean)
13 13
 #' @export
14
-plotGAPS <- function(A, P, filename=NULL)
14
+plotGAPS <- function(A, P, outputPDF="")
15 15
 {
16
-    if (!is.null(pdf))
16
+    if (outputPDF != "")
17 17
     {
18
-        pdf(file=paste(filename, "-Patterns", ".pdf", sep=""))
18
+        pdf(file=paste(outputPDF, "-Patterns", ".pdf", sep=""))
19
+    }
20
+    else
21
+    {
22
+        dev.new()
19 23
     }
20
-    plotP(P)
21 24
 
22
-    if (!is.null(pdf))
25
+    arrayIdx <- 1:ncol(P)
26
+    maxP <- max(P)
27
+    nPatt <- dim(P)[1]
28
+    matplot(arrayIdx, t(P), type='l', lwd=3, xlim=c(1,ncol(P)), ylim=c(0,maxP),
29
+        xlab='Samples',ylab='Relative Strength',col=rainbow(nPatt))
30
+    title(main='Inferred Patterns')
31
+    legend("topright", paste("Pattern", 1:nPatt, sep = ""), pch = 1:nPatt,
32
+        lty=1,cex=0.8,col=rainbow(nPatt),bty="y",ncol=5)
33
+
34
+    if (outputPDF == "")
23 35
     {
24
-        pdf(file=paste(filename, "-Amplitude", ".pdf", sep=""))
36
+        dev.new()
37
+    }
38
+    else
39
+    {
40
+        dev.off()
41
+        pdf(file=paste(outputPDF, "-Amplitude", ".pdf", sep=""))
25 42
     }
26
-    heatmap(A, Rowv=NA, Colv=NA)
27 43
 
28
-    if (!is.null(pdf))
44
+    heatmap(A, Rowv=NA, Colv=NA)
45
+    if (outputPDF != "")
29 46
     {
30 47
         dev.off()
31 48
     }
32
-}
49
+}
33 50
\ No newline at end of file
34 51
similarity index 100%
35 52
rename from data/GIST.csv
36 53
rename to inst/extdata/GIST.csv
37 54
similarity index 100%
38 55
rename from data/GIST.mtx
39 56
rename to inst/extdata/GIST.mtx
40 57
similarity index 100%
41 58
rename from data/GIST.tsv
42 59
rename to inst/extdata/GIST.tsv
... ...
@@ -51,6 +51,8 @@ the fixed patterns}
51 51
 
52 52
 \item{checkpointFile}{name of the checkpoint file}
53 53
 
54
+\item{nCores}{number of cpu cores to run in parallel over}
55
+
54 56
 \item{...}{keeps backwards compatibility with arguments from older versions}
55 57
 }
56 58
 \value{
... ...
@@ -6,7 +6,17 @@
6 6
 \usage{
7 7
 CoGAPSFromFile(D)
8 8
 }
9
+\arguments{
10
+\item{D}{file path for data matrix}
11
+}
12
+\value{
13
+list with A and P matrix estimates
14
+}
9 15
 \description{
10 16
 CoGAPS with file input for matrix
11 17
 }
18
+\examples{
19
+ file <- system.file("extdata/GIST.mtx", package="CoGAPS")
20
+ CoGAPSFromFile(file)
21
+}
12 22
 
13 23
new file mode 100644
... ...
@@ -0,0 +1,13 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/package.R
3
+\docType{data}
4
+\name{GIST.D}
5
+\alias{GIST.D}
6
+\title{Sample GIST gene expression data from Ochs et al. (2009)}
7
+\usage{
8
+GIST.D
9
+}
10
+\description{
11
+Sample GIST gene expression data from Ochs et al. (2009)
12
+}
13
+
0 14
new file mode 100644
... ...
@@ -0,0 +1,13 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/package.R
3
+\docType{data}
4
+\name{GIST.GeneSets}
5
+\alias{GIST.GeneSets}
6
+\title{Simulated dataset to quantify gene set membership in the GIST dataset}
7
+\usage{
8
+GIST.GeneSets
9
+}
10
+\description{
11
+Simulated dataset to quantify gene set membership in the GIST dataset
12
+}
13
+
0 14
new file mode 100644
... ...
@@ -0,0 +1,13 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/package.R
3
+\docType{data}
4
+\name{GIST.S}
5
+\alias{GIST.S}
6
+\title{Sample GIST gene expression data from Ochs et al. (2009)}
7
+\usage{
8
+GIST.S
9
+}
10
+\description{
11
+Sample GIST gene expression data from Ochs et al. (2009)
12
+}
13
+
0 14
new file mode 100644
... ...
@@ -0,0 +1,13 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/package.R
3
+\docType{data}
4
+\name{GIST.result}
5
+\alias{GIST.result}
6
+\title{CoGAPS result from running on GIST dataset}
7
+\usage{
8
+GIST.result
9
+}
10
+\description{
11
+CoGAPS result from running on GIST dataset
12
+}
13
+
0 14
new file mode 100644
... ...
@@ -0,0 +1,13 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/package.R
3
+\docType{data}
4
+\name{GSets}
5
+\alias{GSets}
6
+\title{Simulated dataset to quantify gene set membership.}
7
+\usage{
8
+GSets
9
+}
10
+\description{
11
+Simulated dataset to quantify gene set membership.
12
+}
13
+
0 14
new file mode 100644
... ...
@@ -0,0 +1,13 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/package.R
3
+\docType{data}
4
+\name{SimpSim.A}
5
+\alias{SimpSim.A}
6
+\title{Simulated data}
7
+\usage{
8
+SimpSim.A
9
+}
10
+\description{
11
+Simulated data
12
+}
13
+
0 14
new file mode 100644
... ...
@@ -0,0 +1,13 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/package.R
3
+\docType{data}
4
+\name{SimpSim.D}
5
+\alias{SimpSim.D}
6
+\title{Simulated data}
7
+\usage{
8
+SimpSim.D
9
+}
10
+\description{
11
+Simulated data
12
+}
13
+
0 14
new file mode 100644
... ...
@@ -0,0 +1,13 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/package.R
3
+\docType{data}
4
+\name{SimpSim.P}
5
+\alias{SimpSim.P}
6
+\title{Simulated data}
7
+\usage{
8
+SimpSim.P
9
+}
10
+\description{
11
+Simulated data
12
+}
13
+
0 14
new file mode 100644
... ...
@@ -0,0 +1,13 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/package.R
3
+\docType{data}
4
+\name{SimpSim.S}
5
+\alias{SimpSim.S}
6
+\title{Simulated data}
7
+\usage{
8
+SimpSim.S
9
+}
10
+\description{
11
+Simulated data
12
+}
13
+
0 14
new file mode 100644
... ...
@@ -0,0 +1,13 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/package.R
3
+\docType{data}
4
+\name{SimpSim.result}
5
+\alias{SimpSim.result}
6
+\title{CoGAPS result from running on simulated data}
7
+\usage{
8
+SimpSim.result
9
+}
10
+\description{
11
+CoGAPS result from running on simulated data
12
+}
13
+
... ...
@@ -4,7 +4,7 @@
4 4
 \alias{plotGAPS}
5 5
 \title{Plot Decomposed A and P Matrices}
6 6
 \usage{
7
-plotGAPS(A, P, filename = NULL)
7
+plotGAPS(A, P, outputPDF = "")
8 8
 }
9 9
 \arguments{
10 10
 \item{A}{the mean A matrix}
11 11
new file mode 100644
... ...
@@ -0,0 +1,13 @@
1
+% Generated by roxygen2: do not edit by hand
2
+% Please edit documentation in R/package.R
3
+\docType{data}
4
+\name{tf2ugFC}
5
+\alias{tf2ugFC}
6
+\title{Gene sets defined by transcription factors defined from TRANSFAC.}
7
+\usage{
8
+tf2ugFC
9
+}
10
+\description{
11
+Gene sets defined by transcription factors defined from TRANSFAC.
12
+}
13
+
... ...
@@ -26,7 +26,7 @@ TEST_CASE("Test Parsers")
26 26
         
27 27
         std::string line(mtxPath);
28 28
         //std::getline(is, line);
29
-        std::cout << "\n" <<  line << "\nTHIS IS TEST OUTPUT\n";
29
+        Rcpp::Rcout << "\n" <<  line << "\nTHIS IS TEST OUTPUT\n";
30 30
         //is.close();
31 31
     }
32 32
 }
33 33
\ No newline at end of file
... ...
@@ -356,4 +356,4 @@ for (tf in TFs) {
356 356
 \bibliographystyle{plain}
357 357
 \bibliography{AppNote}
358 358
 
359
-\end{document}
359
+\end{document}
360 360
\ No newline at end of file