Skip to content

Instantly share code, notes, and snippets.

@GabrielHoffman
Created February 1, 2024 15:31
Show Gist options
  • Save GabrielHoffman/e836f70142cbe4e783e84e12f724d300 to your computer and use it in GitHub Desktop.
Save GabrielHoffman/e836f70142cbe4e783e84e12f724d300 to your computer and use it in GitHub Desktop.
Get raw counts using zellkonverter
library(zellkonverter)
library(SingleCellExperiment)
file = "240118_PsychAD_FULL_1494_subclass_EN_NF_hvg3k_umap.h5ad"
sce = readH5AD(file, use_hdf5=TRUE, verbose=TRUE, raw=TRUE)
# normalized counts
assay(sce, "X")[1:3, 1:3]
# see "alternative expression", i.e. raw counts
altExpNames(sce)
# Put raw counts into main
sce2 = swapAltExp(sce, "raw")
# raw counts
assay(a, "X")[1:3, 1:3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment