Browse code

Merge pull request #310 from zhewa/master

fix no visible binding for global variable note

Zhe Wang authored on 21/10/2020 21:08:26 • GitHub committed on 21/10/2020 21:08:26
Showing 5 changed files

... ...
@@ -1,6 +1,6 @@
1 1
 Package: celda
2 2
 Title: CEllular Latent Dirichlet Allocation
3
-Version: 1.5.11
3
+Version: 1.5.12
4 4
 Authors@R: c(person("Joshua", "Campbell", email = "camp@bu.edu",
5 5
     role = c("aut", "cre")),
6 6
     person("Sean", "Corbett", email = "scorbett@bu.edu", role = c("aut")),
... ...
@@ -168,17 +168,17 @@ setMethod("celdatosce",
168 168
         SingleCellExperiment::altExp(sce, altExpName) <- sce
169 169
         xClass <- "matrix"
170 170
         model <- celdaModel@celdaGridSearchParameters$model
171
-        paramsTest <- celdaCGGridSearchRes@celdaGridSearchParameters$paramsTest
171
+        paramsTest <- celdaModel@celdaGridSearchParameters$paramsTest
172 172
         paramsFixed <-
173
-            celdaCGGridSearchRes@celdaGridSearchParameters$paramsFixed
174
-        maxIter <- celdaCGGridSearchRes@celdaGridSearchParameters$maxIter
175
-        nchains <- celdaCGGridSearchRes@celdaGridSearchParameters$nchains
176
-        cores <- celdaCGGridSearchRes@celdaGridSearchParameters$cores
177
-        bestOnly <- celdaCGGridSearchRes@celdaGridSearchParameters$bestOnly
178
-        perplexity <- celdaCGGridSearchRes@celdaGridSearchParameters$perplexity
179
-        verbose <- celdaCGGridSearchRes@celdaGridSearchParameters$verbose
173
+            celdaModel@celdaGridSearchParameters$paramsFixed
174
+        maxIter <- celdaModel@celdaGridSearchParameters$maxIter
175
+        nchains <- celdaModel@celdaGridSearchParameters$nchains
176
+        cores <- celdaModel@celdaGridSearchParameters$cores
177
+        bestOnly <- celdaModel@celdaGridSearchParameters$bestOnly
178
+        perplexity <- celdaModel@celdaGridSearchParameters$perplexity
179
+        verbose <- celdaModel@celdaGridSearchParameters$verbose
180 180
         logfilePrefix <-
181
-            celdaCGGridSearchRes@celdaGridSearchParameters$logfilePrefix
181
+            celdaModel@celdaGridSearchParameters$logfilePrefix
182 182
 
183 183
         altExp <- .createSCEceldaGridSearch(celdaList = celdaModel,
184 184
             sce = SingleCellExperiment::altExp(sce, altExpName),
... ...
@@ -807,6 +807,9 @@ setMethod("plotGridSearchPerplexityDiff",
807 807
 
808 808
 
809 809
 .plotGridSearchPerplexityDiffCG <- function(celdaList, sep, n) {
810
+    # fix check note
811
+    K <- L <- perpdiffK <- meanperpdiffK <- perpdiffL <- meanperpdiffL <- NULL
812
+
810 813
     if (!all(c("K", "L") %in% colnames(runParams(celdaList)))) {
811 814
         stop("runParams(celdaList) needs K and L columns.")
812 815
     }
... ...
@@ -905,6 +908,7 @@ setMethod("plotGridSearchPerplexityDiff",
905 908
 
906 909
 
907 910
 .plotGridSearchPerplexityDiffC <- function(celdaList, sep, n) {
911
+    K <- perpdiffK <- meanperpdiffK <- NULL # fix check note
908 912
     if (!all(c("K") %in% colnames(runParams(celdaList)))) {
909 913
         stop("runParams(celdaList) needs the column K.")
910 914
     }
... ...
@@ -959,6 +963,7 @@ setMethod("plotGridSearchPerplexityDiff",
959 963
 
960 964
 
961 965
 .plotGridSearchPerplexityDiffG <- function(celdaList, sep, n) {
966
+    L <- perpdiffL <- meanperpdiffL <- NULL # fix check note
962 967
     if (!all(c("L") %in% colnames(runParams(celdaList)))) {
963 968
         stop("runParams(celdaList) needs the column L.")
964 969
     }
... ...
@@ -160,6 +160,8 @@ plotDecontXMarkerPercentage <- function(x, markers, groupClusters = NULL,
160 160
                                         exactMatch = TRUE, by = "rownames",
161 161
                                         ncol = round(sqrt(length(markers))),
162 162
                                         labelBars = TRUE, labelSize = 3) {
163
+  cellTypeLabels <- percent <- NULL # fix check note
164
+
163 165
   legend <- "none"
164 166
   # Check that list arguments are named
165 167
   if (!is(markers, "list") || is.null(names(markers))) {
... ...
@@ -224,9 +226,9 @@ plotDecontXMarkerPercentage <- function(x, markers, groupClusters = NULL,
224 226
   df <- cbind(df, markerLabels = names(markers)[df$markers])
225 227
   df$markerLabels <- factor(df$markerLabels, levels = names(markers))
226 228
 
227
-  plt <- ggplot2::ggplot(df, ggplot2::aes(
228
-    x = cellTypeLabels,
229
-    y = percent, fill = assay
229
+  plt <- ggplot2::ggplot(df, ggplot2::aes_string(
230
+    x = "cellTypeLabels",
231
+    y = "percent", fill = "assay"
230 232
   )) +
231 233
     ggplot2::geom_bar(
232 234
       stat = "identity",
... ...
@@ -1008,7 +1008,7 @@ setMethod("plotDimReduceCluster",
1008 1008
     ) +
1009 1009
       ggrepel::geom_text_repel(
1010 1010
         data = centroid,
1011
-        mapping = ggplot2::aes(label = Cluster),
1011
+        mapping = ggplot2::aes_string(label = "Cluster"),
1012 1012
         size = labelSize
1013 1013
       )
1014 1014
   }