Closed lianos closed 3 years ago
It's not too hard to rename collections by manipulating the internal data.tables, let's do that.
This code snippet renames a "C7" collection to "ImmuneSigDb" in a GeneSetDb gdb object:
"C7"
"ImmuneSigDb"
gdb
gdb@db[collection == "C7", collection := "ImmuneSigDb"] setkeyv(gdb@db, c("collection", "name", "feature_id")) gdb@table[collection == "C7", collection := "ImmuneSigDb"] setkeyv(gdb@table, c("collection", "name")) gdb@collectionMetadata[collection == "C7", collection := "ImmuneSigDb"] setkeyv(gdb@collectionMetadata, c("collection", "name"))
The function signature might look like:
renameCollection <- function(gdb, rename, ...) { }
with rename being a named character vector with names() being the current name of the collection, and its values are the new collection names you want to rename them to.
rename
names()
It's not too hard to rename collections by manipulating the internal data.tables, let's do that.
This code snippet renames a
"C7"
collection to"ImmuneSigDb"
in a GeneSetDbgdb
object:Ideas
The function signature might look like:
with
rename
being a named character vector withnames()
being the current name of the collection, and its values are the new collection names you want to rename them to.