Entering edit mode
Hello,
When I try to use the swap_rownames
argument in scater::plotHeatmap()
I get an error.
Here is a minimal example:
library(scuttle)
library(scater)
example_sce <- mockSCE()
example_sce <- logNormCounts(example_sce)
# add mock rowData columns
rowData(example_sce) <- DataFrame(id = rownames(example_sce), gene_name = paste0("ABC", sample(1000)))
rowData(example_sce)
DataFrame with 2000 rows and 2 columns
id gene_name
<character> <character>
Gene_0001 Gene_0001 ABC916
Gene_0002 Gene_0002 ABC794
Gene_0003 Gene_0003 ABC466
Gene_0004 Gene_0004 ABC989
Gene_0005 Gene_0005 ABC827
... ... ...
Gene_1996 Gene_1996 ABC934
Gene_1997 Gene_1997 ABC120
Gene_1998 Gene_1998 ABC197
Gene_1999 Gene_1999 ABC26
Gene_2000 Gene_2000 ABC921
# this works
plotHeatmap(example_sce, features=rownames(example_sce)[1:10])
# this doesn't
plotHeatmap(example_sce, features=rownames(example_sce)[1:10], swap_rownames = "gene_name")
Error in assay(object, exprs_values)[feats, , drop = FALSE] :
subscript out of bounds
Actually, the real error I'm getting with my data is:
Error in intI(i, n = x@Dim[1], dn[[1]], give.dn = FALSE) :
invalid character indexing
But I can't quite reproduce it with a minimal example, and hopefully understanding/fixing the error in the minimal example will help me fix the error in the real data.
Thank you!
Tagging Alan and Aaron for visibility: alan.ocallaghan Aaron Lun