-
Notifications
You must be signed in to change notification settings - Fork 9
/
quick_start.Rmd
80 lines (61 loc) · 1.71 KB
/
quick_start.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
title: "Quick start to COSG"
author: "Min Dai"
date: "2021/6/18"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Quick start to COSG}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Overview
COSG is a cosine similarity-based method for more accurate and scalable marker gene identification.
* COSG is a general method for cell marker gene identification across different data modalities, e.g., scRNA-seq, scATAC-seq and spatially resolved transcriptome data.
* Marker genes or genomic regions identified by COSG are more indicative and with greater cell-type specificity.
* COSG is ultrafast for large-scale datasets, and is capable of identifying marker genes for one million cells in less than two minutes.
The method and benchmarking results are described in [Dai et al., (2021)](https://www.biorxiv.org/content/10.1101/2021.06.15.448484v1).
### Installation
##### Install from [GitHub](https://github.com/genecell/COSGR):
```
# install.packages('remotes')
remotes::install_github(repo = 'genecell/COSGR')
```
Load the library:
```{r}
library(COSG)
library(Seurat)
```
### Run COSG
```{r}
marker_cosg<-cosg(
pbmc_small,
groups='all',
assay='RNA',
slot='data',
mu=1,
n_genes_user=2000)
```
Check markers:
```{r}
head(marker_cosg$names)
```
Check scores:
```{r}
head(marker_cosg$scores)
```
```{r}
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:
```{r fig.height=5, fig.width=16}
DotPlot(pbmc_small,
assay = 'RNA',
features = unique(top_list)) + RotatedAxis()
```