knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
klippy::klippy(tooltip_message = 'Click to copy', tooltip_success = 'Done', position = c('bottom', 'right'))

Perfoming ScType annotation

scType is an automated cell type identification method using a panel of markers. Here we should you how to perform this on your IBRAP data and object.

library(IBRAP)
library(tidyverse)

obj <- readRDS("/Users/knight05/work/Results/scRNA-seq/IBRAP_tutorials/scType_tutorial/scType_tutorial.rds")

Preparing your IBRAP object

library(IBRAP)
library(tidyverse)

system('curl -LJO https://raw.githubusercontent.com/connorhknight/IBRAP/main/data/celseq2.rds')

celseq2 <- readRDS('celseq2.rds')

obj <- createIBRAPobject(counts = celseq2$counts, original.project = 'celseq2', meta.data = celseq2$metadata) 

obj <- perform.sct(object = obj)
obj <- perform.pca(object = obj, assay = 'SCT')
obj <- perform.nn(object = obj, assay = 'SCT', reduction = 'PCA', dims.use = list(20))
obj <- perform.graph.cluster(object = obj, assay = 'SCT', neighbours = 'PCA_NN')
obj <- perform.umap(object = obj, assay = 'SCT', reduction = 'PCA', dims.use = list(20))

We next next need to gather gene sets:

There are a couple of ways to do this: (1) get the gene sets from the escape package or (2) define your own.

obj <- perform.sctype(object = obj, assay = 'SCT', tissue = 'Pancreas', clust.method = 'PCA_NN:LOUVAIN', column = 'res_0.8', slot = 'norm.scaled')
plot.reduced.dim(object = obj, reduction = 'PCA_UMAP', assay = 'SCT', clust.method = 'metadata', column = 'scType_SCT_norm.scaled')


connorhknight/IBRAP documentation built on March 9, 2023, 7:01 p.m.