This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Rename of assays for SingleCellExperiment object in R

Hi, I would like to ask a question related to the renaming of assays for the SingleCellExperiment object in R. My data as below:

cortex_sc
class: SingleCellExperiment 
dim: 30535 6460 
metadata(9): Integrated_colors category2_colors ... pca umap
assays(2): **X** logcounts
rownames(30535): MIR1302-2HG OR4F5 ... AC213203.1 FAM231C
rowData names(7): gene_ids mt ... total_counts n_cells
....

In assays, I want to change "X" to "counts". Could anyone suggest to me how to fix it? I have tried someway, but unfortunately, I have not been success.

Thank you!

singlecellexperiment r

1 answer

A possible solution is names(assays(sce))=c("counts","logcounts") (sce is your singleCellExperiment object)

Thank you so much! It works!!!

Log in to answer this question.