-
Notifications
You must be signed in to change notification settings - Fork 0
/
Readme.Rmd
110 lines (80 loc) · 4.72 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
---
title: "Dendritic Enrichment"
author: "Nathan Gerald Skene"
date: "`r Sys.Date()`"
output:
github_document:
toc: true
toc_depth: 3
vignette: >
%\VignetteIndexEntry{Vignette Title}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
<!-- Readme.md is generated from Readme.Rmd. Please edit that file -->
## Introduction
This R package contains code used for testing for differences in dendritic depletion between single cell/nuclei datasets. It's primary purpose is to demonstrate that nuclei datasets are systematically depleted of neuronally relevant transcripts. It also acts as a quality metric for comparing datasets. The method was described in our 2018 Nature Genetics paper, *"Genetic identification of brain cell types underlying schizophrenia"*.
## Installation
This package depends on a couple of other R packages also available through github.
```
install.packages("devtools")
library(devtools)
install_github("nathanskene/ewce")
install_github("nathanskene/MAGMA_Celltyping")
install_github("nathanskene/DendriticEnrichmentPackage")
```
If you have got any issues using the package then please do file an issue on github (and email me if I don't respond promptly).
# Now load required packages
```{r setup, include=FALSE}
library(dplyr)
library(ggplot2)
library(cowplot)
library(MAGMA.Celltyping)
library(DendriticEnrichmentPackage)
```
```
library(dplyr)
library(ggplot2)
library(cowplot)
library(MAGMA.Celltyping)
library(DendriticEnrichmentPackage)
```
# Basic use of the compare.dataset function
The package depends on being able to compare a set of cells that are common across datasets. I generally use astrocytes, interneurons, microglia, oligodendrocytes, pyramidal neurons and OPCs. The specificity metric is then calculated for just these cell types. The specificity values for dendritic enriched transcripts () are then compared.
The code below
```{r }
# LOAD KI MOUSE (using pyramidal SS)
keepCells = c("astrocytes_ependymal","interneurons","microglia","Oligodendrocytes","pyramidal SS","Oligodendrocyte Precursor")
mouseSS_dist = prepare_specificity_comparison_across_datasets(MAGMA.Celltyping::ctd_allKI,keepCells,species="mouse",datasetName="KI",useCell="pyramidal SS",sharedName="Pyramidal Neuron",datasetGroup="Cell")
# LOAD TASIC
keepCells = c("Astrocytes","Interneurons","Microglia","Oligodendrocytes","Pyramidal Neurons","Oligodendrocyte Precursor Cell")
tasic_mouse_dist = prepare_specificity_comparison_across_datasets(MAGMA.Celltyping::ctd_Tasic,keepCells,species="mouse",datasetName="Tasic",useCell="Pyramidal Neurons",sharedName="Pyramidal Neuron",datasetGroup="Cell")
# LOAD DRONCSEQ-Mouse
keepCells = c("ASC","exCA","GABA","MG","OPC","ODC")
dronc_mouse_dist = prepare_specificity_comparison_across_datasets(MAGMA.Celltyping::ctd_DRONC_mouse,keepCells,species="mouse",datasetName="Dronc Mouse",useCell="exCA",sharedName="Pyramidal Neuron",datasetGroup="Nuclei")
# LOAD DRONCSEQ-Human
keepCells = c("ASC","exCA","GABA","MG","OPC","ODC")
dronc_human_dist = prepare_specificity_comparison_across_datasets(MAGMA.Celltyping::ctd_DRONC_human,keepCells,species="human",datasetName="Dronc Human",useCell="exCA",sharedName="Pyramidal Neuron",datasetGroup="Nuclei")
# LOAD DIVSEQ
keepCells = c("Astrocytes","Hippocampal Interneuron","Microglia","Oligodendrocytes","Hippocampal CA1 Pyramidal Neuron","Oligodendrocyte Precursor")
divseq_dist = prepare_specificity_comparison_across_datasets(MAGMA.Celltyping::ctd_DivSeq,keepCells,species="mouse",datasetName="Habib",useCell="Hippocampal CA1 Pyramidal Neuron",sharedName="Pyramidal Neuron",datasetGroup="Nuclei")
```
A basic comparison between two datasets is done as follows:
```{r }
a = compare_datasets(dataset1=mouseSS_dist,dataset2=dronc_human_dist, geneListHGNC=dendriticGenesHGNC,orthologs=orthologs,sharedName="Pyramidal Neuron")
plot_grid(a$hist_plot, a$comb_hist_plot, a$boot_plot, labels = c("A", "B", "C"), align = "h")
```
# Generate the standard dendritic enrichment plot used in publications
```{r }
allDataSets = list(mouseSS_dist,tasic_mouse_dist,dronc_mouse_dist,dronc_human_dist,divseq_dist)
res = test_all_comparisons(allDataSets,orthologs,sharedName="Pyramidal Neuron")
thePlot = generate_publication_plot_for_single_list(res)
print(thePlot)
```
# Citation
If you use this software then please cite
[Skene, et al. Genetic identification of brain cell types underlying schizophrenia.
Nature Genetics, 2018.](https://www.nature.com/articles/s41588-018-0129-5)
The package uses the dendritic enriched transcripts from the following paper, which should also be cited:
[Cajigas, et al. The Local Transcriptome in the Synaptic Neuropil Revealed by Deep Sequencing and High-Resolution Imaging.
Neuron, 2012.](https://www.sciencedirect.com/science/article/pii/S0896627312002863)