sa-lee / plyexperiment

A fluent interface to SummarizedExperiment
7 stars 3 forks source link

Support MultiAssayExperiment #3

Closed jonocarroll closed 5 years ago

jonocarroll commented 5 years ago

This might be as simple as not relying on colnames(object) (which does something different for MAE) but rather calling rownames(colData(x)) with the same result, which does support MAE

https://github.com/sa-lee/plyexperiment/blob/f1faf9cd32e020e2a82f441ee39087832973d6e9/R/verbs.R#L40

This

mutate_col <- function(object, ...) {
  pd <- as.data.frame(colData(object))
  pd <- mutate(pd, ...)
  rownames(pd) <- rownames(colData(object))
  colData(object) <- DataFrame(pd)
  object
}

seems to work fine on an MAE as well as a SE for mutate_col and rename_col (with this change), while filter_col and arrange_col already work as-is.

A select_col would also require the same alteration, but would work nicely.

jonocarroll commented 5 years ago

I will try to make a simple PR sometime if you like.

sa-lee commented 5 years ago

That would be great, the plan was to support MAE at some point. I am working on many other things at the moment so this project has taken the back seat for quite a while. PRs and contributions are always welcome!