@@ -343,8 +343,11 @@ setMethod("mergeReplicates", "ANY",
343343 return (object )
344344})
345345
346- .matchAddColData <- function (reshaped , colData , colDataCols ) {
347- extraColumns <- as.data.frame(colData [, colDataCols , drop = FALSE ])
346+ .matchAddColData <- function (reshaped , colData , colDataCols , check.names ) {
347+ optional <- ! check.names
348+ extraColumns <- as.data.frame(
349+ colData [, colDataCols , drop = FALSE ], optional = optional
350+ )
348351 rowNameValues <- rownames(extraColumns )
349352 rownames(extraColumns ) <- NULL
350353 matchIdx <- match(reshaped [[" primary" ]], rowNameValues )
@@ -588,7 +591,9 @@ wideFormat <- function(object, colDataCols = NULL, check.names = TRUE,
588591
589592 wideData <- lapply(wideData , function (flox ) {
590593 flox <- tidyr :: pivot_wider(flox , names_from = key )
591- .matchAddColData(flox , colData(object ), colDataCols )
594+ .matchAddColData(
595+ flox , colData(object ), colDataCols , check.names = check.names
596+ )
592597 })
593598 wideDF <- Reduce(function (x , y )
594599 merge(x , y , by = intersect(names(x ), names(y )), all = TRUE ), wideData )
0 commit comments