Skip to content

Instantly share code, notes, and snippets.

@vjcitn
Last active March 25, 2024 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vjcitn/1a037ddf740aef2c6a7f02d104aa53e0 to your computer and use it in GitHub Desktop.
Save vjcitn/1a037ddf740aef2c6a7f02d104aa53e0 to your computer and use it in GitHub Desktop.
use 'instrumented' do_SingleR(i)
source("inst.R", echo=TRUE)
library(Rcollectl)
library(AnVILBestPractices)
library(SingleR)
library(BiocParallel)
clid = cl_start()
Rcollectl::cl_timestamp(clid, "pre-data")
p3k = TENxPBMCData::TENxPBMCData("pbmc3k")
Rcollectl::cl_timestamp(clid, "3k loaded")
rownames(p3k) = make.names(rowData(p3k)$Symbol, unique=TRUE)
pred3k = do_SingleRi(p3k, clprocid=clid, BPPARAM=MulticoreParam(12))
table(pred3k$preds$pruned.labels)
head(pred3k$preds)
cl_stop(clid)
Sys.sleep(2)
path = Rcollectl::cl_result_path(clid)
Rcollectl::plot_usage(Rcollectl::cl_parse(path)) +
Rcollectl::cl_timestamp_layer(path) +
Rcollectl::cl_timestamp_label(path) +
ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 90, vjust = 0.5, hjust=1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment