-
Notifications
You must be signed in to change notification settings - Fork 977
Description
Hello!
I came across a problem where I could not change the names of assays and layers after the creation of a Seurat Object. For example:
Assays(scdata) <- c("ASSAY1","ASSAY2")
Layers(scdata[["RNA"]]) <- c("LAYER1", "LAYER2")These return the following errors:
Error in Assays(scdata) <- c("RNA1", "SCT1") :
could not find function "Assays<-"
Error in Layers(scdata[["RNA"]]) <- c("counts", "scale.data") :
could not find function "Layers<-"
I realize that if a default assay has its name modified then DefaultAssay() would also have to have its name changed, but layers would not have this issue at least so it might be worth it to focus on layers hopefully.
I am trying to read in an assay stored as a named list and unfortunately the CreateAssay5Object() function prepends the string "counts." to each layer name, which I am trying to avoid. Would it be possible to allow assay or at least layer names to be modified after their creation and fix CreateAssay5Object() so that if a named list of multiple data matrices is supplied, the layer names do not have "counts." added before the name. E.g:
> CreateAssay5Object(named_list_of_data) # named_list_of_data was created with list(counts = datamat1, scale.data = datamat2) Assay (v5) data with 21703 features for 22058 cells
First 10 features:
RP11-34P13.7, FO538757.2, AP006222.2, RP4-669L17.10, RP11-206L10.9, FAM87B, LINC00115, FAM41C, RP11-54O7.1, SAMD11
Layers:
counts.counts, counts.scale.data # These should be counts, scale.data