-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
68 lines (50 loc) · 2.13 KB
/
README.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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# LigandReceptor
<!-- badges: start -->
<!-- badges: end -->
The goal of LigandReceptor is to simplify the process of identifying potential ligand-receptor pairs in scRNAseq data
## Installation
You can install LigandReceptor from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("chiblyaa/LigandReceptor")
```
## Example
To use this function, first obtain a list of genes expressed in a scRNAseq dataset using the SEURAT function FindAllMarkers().
An example of an acceptable table:
```{r testdata, echo=FALSE, results='asis'}
test_dataset <- LigandReceptor::test_dataset
test_dataset <- test_dataset[test_dataset$cluster %in% c("Acinar", "Myoepithelial", "End bud", "Stromal", "Krt19+ duct",
"Basal duct", "Macrophages"),]
knitr::kable(test_dataset[1:5,], caption = "A test scRNAseq dataset:")
LRdatabase <- LigandReceptor::LRdatabase # Load ligand-receptor pair reference database
```
Basic example code for generating a table with ligand-receptor pairs:
```{r example}
library(LigandReceptor)
## This will generate a table with ligand-receptor pair for the specified cell types in celltypelabels
LR.pairs <- LigandReceptorPairsTable(seuratDEGS = test_dataset, LRdatabase = LRdatabase)
knitr::kable(LR.pairs[1:10,], caption = "Ligand-Receptor pairs: ")
```
Chord plot to represent ligands from Myoepithelial cells to all other cells:
```{r plot}
# This will generate the chord plot associated with the table
colors = topo.colors(as.numeric(length(unique(test_dataset$cluster)))) # create vector of colors of length = ncells
names(colors) <- as.character(unique(test_dataset$cluster))
PairsPlot(cellcolors=colors, seuratDEGS = test_dataset, LRdatabase)
legend("bottomright", # location of legend
legend = names(colors), # categories or elements to render in
# the legend
fill = colors)
```