Skip to content

Commit

Permalink
Get minfi ready for the switch to virtual DataFrame
Browse files Browse the repository at this point in the history
- The switch to virtual DataFrame will happen soon in the S4Vectors package.
- Also replace all use of colGrid() with colAutoGrid() (the former is now
  defunct in the DelayedArray package).
  • Loading branch information
hpages committed Nov 2, 2021
1 parent 0cbd15b commit 77d3345
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 27 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: minfi
Version: 1.41.0
Version: 1.41.1
Title: Analyze Illumina Infinium DNA methylation arrays
Description: Tools to analyze & visualize Illumina Infinium methylation arrays.
Authors@R: c(person(c("Kasper", "Daniel"), "Hansen", role = c("cre", "aut"),
Expand Down
2 changes: 1 addition & 1 deletion R/IlluminaMethylationAnnotation-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ getAnnotation <- function(object, what = "everything", lociNames = NULL,
# what <- bestOrder[bestOrder %in% what]

out <- do.call(cbind, lapply(what, function(wh) {
.annoGet(wh, envir = annoObject@data)
updateObject(.annoGet(wh, envir = annoObject@data))
}))

if (!is.null(lociNames)) {
Expand Down
23 changes: 12 additions & 11 deletions R/IlluminaMethylationManifest-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -174,18 +174,18 @@ setMethod(

# Exported functions -----------------------------------------------------------

IlluminaMethylationManifest <- function(TypeI = new("DataFrame"),
TypeII = new("DataFrame"),
TypeControl = new("DataFrame"),
TypeSnpI = new("DataFrame"),
TypeSnpII = new("DataFrame"),
IlluminaMethylationManifest <- function(TypeI = DataFrame(),
TypeII = DataFrame(),
TypeControl = DataFrame(),
TypeSnpI = DataFrame(),
TypeSnpII = DataFrame(),
annotation = "") {
data <- new.env(parent = emptyenv())
data[["TypeI"]] <- TypeI
data[["TypeII"]] <- TypeII
data[["TypeControl"]] <- TypeControl
data[["TypeSnpI"]] <- TypeSnpI
data[["TypeSnpII"]] <- TypeSnpII
data[["TypeI"]] <- updateObject(TypeI)
data[["TypeII"]] <- updateObject(TypeII)
data[["TypeControl"]] <- updateObject(TypeControl)
data[["TypeSnpI"]] <- updateObject(TypeSnpI)
data[["TypeSnpII"]] <- updateObject(TypeSnpII)
lockEnvironment(data, bindings = TRUE)
new("IlluminaMethylationManifest",
annotation = annotation,
Expand Down Expand Up @@ -221,7 +221,7 @@ getProbeInfo <- function(object,
if (.isMethylOrRatio(object)) {
out <- out[out$Name %in% rownames(object),]
}
out
updateObject(out)
}

getManifestInfo <- function(object, type = c("nLoci", "locusNames")) {
Expand Down Expand Up @@ -256,6 +256,7 @@ getControlAddress <- function(object,

setMethod("show", "IlluminaMethylationManifest", function(object) {
cat("IlluminaMethylationManifest object\n")
object <- updateObject(object)
.show.annotation(object@annotation)
cat("Number of type I probes:", nrow(object@data[["TypeI"]]), "\n")
cat("Number of type II probes:", nrow(object@data[["TypeII"]]), "\n")
Expand Down
2 changes: 2 additions & 0 deletions R/MethylSet-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ setMethod(
getObjectSlots(object)[["phenoData"]])[["data"]],
annotation = getObjectSlots(object)[["annotation"]],
preprocessMethod = getObjectSlots(object)[["preprocessMethod"]])
} else {
object <- callNextMethod()
}
object
}
Expand Down
4 changes: 3 additions & 1 deletion R/RGChannelSet-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ setMethod(

# Set up ArrayGrid instances over `x` as well as "parallel" ArrayGrid
# instance over `sink`.
x_grid <- colGrid(x)
x_grid <- colAutoGrid(x)
sink_grid <- RegularArrayGrid(
refdim = dim(sink),
spacings = c(nrow(sink), ncol(sink) / length(x_grid)))
Expand Down Expand Up @@ -214,6 +214,8 @@ setMethod(
colData = getObjectSlots(
getObjectSlots(object)[["phenoData"]])[["data"]],
annotation = getObjectSlots(object)[["annotation"]])
} else {
object <- callNextMethod()
}
object
}
Expand Down
2 changes: 1 addition & 1 deletion R/blocks.R
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ setMethod(

# Set up ArrayGrid instances over `x` as well as "parallel" ArrayGrid
# instance over `sink`
x_grid <- colGrid(x)
x_grid <- colAutoGrid(x)
sink_grid <- RegularArrayGrid(
refdim = dim(sink),
spacings = c(nrow(sink), ncol(sink) / length(x_grid)))
Expand Down
4 changes: 2 additions & 2 deletions R/detectionP.R
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ setMethod(

# Set up ArrayGrid instances over `Red` and `Green` as well as
# "parallel" ArrayGrid instance over `detP_sink`.
Red_grid <- colGrid(Red)
Green_grid <- colGrid(Green)
Red_grid <- colAutoGrid(Red)
Green_grid <- colAutoGrid(Green)
detP_sink_grid <- RegularArrayGrid(
refdim = dim(detP_sink),
spacings = c(nrow(detP_sink), ncol(detP_sink) / length(Red_grid)))
Expand Down
4 changes: 2 additions & 2 deletions R/preprocessNoob.R
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ setMethod(
# `U_sink`. Also set up "parallel" ArrayGrid instances over `GreenOOB`
# and `RedOOB`, as well as `Red` and `Green` if performing dye
# correction.
Meth_grid <- colGrid(Meth)
Unmeth_grid <- colGrid(Unmeth)
Meth_grid <- colAutoGrid(Meth)
Unmeth_grid <- colAutoGrid(Unmeth)
M_sink_grid <- RegularArrayGrid(
refdim = dim(M_sink),
spacings = c(nrow(M_sink), ncol(M_sink) / length(Meth_grid)))
Expand Down
4 changes: 2 additions & 2 deletions R/preprocessRaw.R
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ setMethod(

# Set up ArrayGrid instances over `Red` and `Green` as well as
# "parallel" ArrayGrid instances over `M_sink` and `U_sink`.
Red_grid <- colGrid(Red)
Green_grid <- colGrid(Green)
Red_grid <- colAutoGrid(Red)
Green_grid <- colAutoGrid(Green)
M_sink_grid <- RegularArrayGrid(
refdim = dim(M_sink),
spacings = c(nrow(M_sink), Red_grid@spacings[2]))
Expand Down
2 changes: 1 addition & 1 deletion R/preprocessSwan.R
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ setMethod(

# Set up ArrayGrid instances over `x` as well as "parallel" ArrayGrid
# instances over `bg` and `sink`.
x_grid <- colGrid(x)
x_grid <- colAutoGrid(x)
bg_grid <- RegularArrayGrid(
refdim = dim(bg),
spacings = c(nrow(bg), ncol(bg) / length(x_grid)))
Expand Down
10 changes: 5 additions & 5 deletions man/IlluminaMethylationManifest-class.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
\usage{
## Constructor

IlluminaMethylationManifest(TypeI = new("DataFrame"),
TypeII = new("DataFrame"),
TypeControl = new("DataFrame"),
TypeSnpI = new("DataFrame"),
TypeSnpII = new("DataFrame"),
IlluminaMethylationManifest(TypeI = DataFrame(),
TypeII = DataFrame(),
TypeControl = DataFrame(),
TypeSnpI = DataFrame(),
TypeSnpII = DataFrame(),
annotation = "")

## Data extraction
Expand Down

0 comments on commit 77d3345

Please sign in to comment.