Skip to content

Instantly share code, notes, and snippets.

@soh-i
Created February 17, 2022 19:08
Show Gist options
  • Save soh-i/f03b5277d05f12d1342158a50df7621a to your computer and use it in GitHub Desktop.
Save soh-i/f03b5277d05f12d1342158a50df7621a to your computer and use it in GitHub Desktop.
Get single cell expression from GatingSet object
...
sample.names <- sampleNames(gs.trans)
gs.exp.df <- data.table()
for (sample in sample.names) {
message(sprintf("Processing: %s", sample))
df <- gs_get_singlecell_expression(gs.trans, c("P1"),
threshold = FALSE, marginal = FALSE, inverse.transform = TRUE,
other.markers = c("SSC-A", "FL1-A", "FL5-A")
)[[sample]] %>%
data.table() %>%
mutate(sample = sample)
gs.exp.df <- rbindlist(list(gs.exp.df, df))
}
sample.meta <- cyto_details(gs.trans)
exp.df <- merge(gs.exp.df, sample.meta, by.x = "sample", by.y = "name")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment