knitr::opts_chunk$set(echo = TRUE)

Overview

COSG is a cosine similarity-based method for more accurate and scalable marker gene identification.

The method and benchmarking results are described in Dai et al., (2021).

Installation

Install from GitHub:
# install.packages('remotes')
remotes::install_github(repo = 'genecell/COSGR')

Load the library:

library(COSG) 
library(Seurat) 

Run COSG

marker_cosg<-cosg(
  pbmc_small,
  groups='all',
  assay='RNA',
  slot='data',
  mu=1,
  n_genes_user=2000)

Check markers:

head(marker_cosg$names)

Check scores:

head(marker_cosg$scores)
top_list<-c()
for (group in colnames(marker_cosg$names)){
    top_i<-marker_cosg$names[group][1:10,1]
    top_list<-c(top_list,top_i)
}

Expression pattern:

DotPlot(pbmc_small, 
        assay = 'RNA',
        features =  unique(top_list)) + RotatedAxis()


genecell/COSGR documentation built on Jan. 3, 2023, 10:57 a.m.