celltalker
celltalker copied to clipboard
Using SCT as the assay
Hello! I attempted to run CellTalker on an integrated object and encountered an error, which I resolved. I'll say what my problem was at the bottom for posterity, in case anyone else runs into the issue.
While troubleshooting I noticed that CellTalker defaults to using the RNA assay, with no option to change which assay to use. My normalized/scaled data is in the SCT assay, and my RNA assay is still raw counts. Is there any existing way to specify that I want to use the SCT assay, or do I need to scale/center the RNA assay to work with this method?
<error/ You can run 'object <- JoinLayers(object = object, layers = layer)'.>
Error in GetAssayData()
:
! GetAssayData doesn't work for multiple layers in v5 assay.
Backtrace: ▆
- └─celltalker::celltalk(...)
- └─celltalker:::create_expression_matrices(...)
-
├─Seurat::GetAssayData(input_filtered, slot = "counts", assay = "RNA")
-
└─SeuratObject:::GetAssayData.Seurat(...)
-
├─SeuratObject::GetAssayData(object = object[[assay]], layer = layer)
-
└─SeuratObject:::GetAssayData.StdAssay(object = object[[assay]], layer = layer)
-
└─rlang::abort(...)
To fix the original issue, I couldn't figure out how to join my SCT assay layers (JoinLayers does not like working with SCT assay objects), until I realized I forgot to join the RNA layers after the initial integration. I changed the default assay back to RNA (which contained my raw counts), joined the RNA assay layers, then re-ran SCTransform. Thank you for the built-in JoinLayers suggestion. I absolutely would not have figure out where to start troubleshooting otherwise.