celltalker icon indicating copy to clipboard operation
celltalker copied to clipboard

Using SCT as the assay

Open JasperGattiker opened this issue 8 months ago • 0 comments

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: ▆

  1. └─celltalker::celltalk(...)
  2. └─celltalker:::create_expression_matrices(...)
  3. ├─Seurat::GetAssayData(input_filtered, slot = "counts", assay = "RNA")
    
  4. └─SeuratObject:::GetAssayData.Seurat(...)
    
  5.   ├─SeuratObject::GetAssayData(object = object[[assay]], layer = layer)
    
  6.   └─SeuratObject:::GetAssayData.StdAssay(object = object[[assay]], layer = layer)
    
  7.     └─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.

JasperGattiker avatar Jun 12 '24 17:06 JasperGattiker