Browse code

more environment fix

kasperdanielhansen authored on 23/03/2021 08:07:57
Showing4 changed files

... ...
@@ -1,5 +1,5 @@
1 1
 Package: bsseq
2
-Version: 1.27.2
2
+Version: 1.27.3
3 3
 Encoding: UTF-8
4 4
 Title: Analyze, manage and store bisulfite sequencing data
5 5
 Description: A collection of tools for analyzing and visualizing bisulfite
... ...
@@ -83,7 +83,7 @@ BSseq <- function(M = NULL, Cov = NULL, coef = NULL, se.coef = NULL,
83 83
     }
84 84
     # Process 'trans' and 'parameters'.
85 85
     if (is.null(trans)) {
86
-        trans <- function(q) NULL
86
+        trans <- function() NULL
87 87
         environment(trans) <- emptyenv()
88 88
     }
89 89
     if (is.null(parameters)) {
... ...
@@ -136,8 +136,10 @@ collapseBSseq <- function(BSseq, group, BPPARAM = bpparam(),
136 136
     # TODO: Is there a way to use the internal constructor with `check = FALSE`?
137 137
     #       Don't need to check M and Cov because this has already happened
138 138
     #       when files were parsed.
139
-    # .BSseq(se, trans = function(x) NULL, parameters = list())
140 139
     bsseq <- new2("BSseq", se, check = FALSE)
140
+    trans <- function() NULL
141
+    environment(trans) <- emptyenv()
142
+    bsseq@trans <- trans
141 143
     if (identical(BACKEND, "HDF5Array")) {
142 144
         # NOTE: Save BSseq object; mimicing
143 145
         #       HDF5Array::saveHDF5SummarizedExperiment().
... ...
@@ -153,6 +153,7 @@ combineList <- function(x, ..., BACKEND = NULL) {
153 153
         ans_coef <- NULL
154 154
         ans_se.coef <- NULL
155 155
         ans_trans <- function() NULL
156
+        environment(ans_trans) <- emptyenv()
156 157
         ans_parameters <- list()
157 158
     }
158 159