-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathREADME.Rmd
165 lines (123 loc) · 6.73 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
---
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%",
fig.align = "center"
)
```
# scDNA v1.1
<!-- badges: start -->
<!-- badges: end -->
The goal of scDNA R package is to provide a simple framework for
analyzing single cell DNA sequencing data. The current version primarily
focuses processing variant information on the Mission Bio Tapestri
platform. Functionality includes import of h5 files from Tapestri
pipeline, basic variant annotation, genotype extraction, clone
identification, and clonal trajectory inference. This package provides
wrappers for normalizing protein data for scDNA+Protein libraries for
downstream analysis.
## Installation
You can install (re-install) the current version (1.1) of scDNA below
``` r
remotes::install_github("bowmanr/scDNA",force=TRUE)
```
## Version Updates
### **v1.1**
Version 1.1 is finally here with exciting new developments:
- New sequencing panels for variant annotation introduced:
- hg38
- mm10
- New plotting functions for RL trajectories.
- new interactive plots,
- BSCITE-style implementation.
- Demultiplexing samples is introduced
- (integrated and adapted from [Robinson et
al](https://www.biorxiv.org/content/10.1101/2022.09.20.508786v1.full),
[github](https://github.com/RobinsonTroy/scMRD))
- vignette included to demonstrate how to perform it.
- Cell confidence labeling based on DNA and Protein data.
- Outlier scores introduced for cell confidence.
- Stain index introduced for cell confidence.
- Copy number variation (CNV) and Ploidy analysis introduced.
- Allele dropout assessment introduced.
### **v1.0.1**
- H5 files are now read using the rhdf5 package and stored into a [SingleCellExperiment](https://bioconductor.org/packages/release/bioc/html/SingleCellExperiment.html) container.
- Merged h5 samples are identified and sample names are stored in colData(). Variant identification is ran separately and then merged.
- Variant information is stored in rowData()
- NGT matrix, clonal abundance, and clone architecture [familiar to previous versions](https://bowmanr.github.io/scDNA_myeloid/) can be found in the metadata.
- Variant identification and annotation is performed initially before reading in all the genotyping/QC data.
- Transcript annotation matches [cannonical transcripts](https://docs.cbioportal.org/mutation-data-transcript-annotation/#transcript-assignment) used in the [cBio portal](https://www.cbioportal.org/).
- To decrease variant location identification runtime, we created a custom TxDB object for the Clonal Evolution Panel from used [here](https://www.nature.com/articles/s41586-020-2864-x). If you have a different panel you can also use the [TxDB for hg19 from UCSC.](https://bioconductor.org/packages/release/data/annotation/html/TxDb.Hsapiens.UCSC.hg19.knownGene.html) Future versions will have local data for all panels from Mission Bio, as well as a simple script for generating a TxDB object for custom panels.
- Protein data is stored as an altExp() container within the container.
- Wrappers for [DSB](https://github.com/niaid/dsb) and CLR normalization are provided. (CLR currently performed in [Seurat](https://satijalab.org/seurat/)).
- Simple import into Seurat is demonstrated.
- Export to FCS files with mutations and clone "completeness" provided as variables.
## Simple workflow
Identify all variants within a sample.
```{r,eval=F}
sample_file<- "test_file.h5"
variant_output<-variant_ID(file=sample_file,
txdb="MSK_RL", # "UCSC" can be used for other panels
GT_cutoff=0, # mimimum percent of cells where a successful genotyping call was made
VAF_cutoff=0) # mimimum variant allele frequency
```
Identify mutations in genes of interest.
```{r,eval=F}
genes_of_interest <- c("IDH2","NRAS","NPM1","TET2","FLT3","IDH1")
variants_of_interest<-variant_output%>%
dplyr::filter(Class=="Exon")%>%
dplyr::filter(VAF>0.01)%>%
dplyr::filter(genotyping_rate>85)%>%
dplyr::filter(!is.na(CONSEQUENCE)&CONSEQUENCE!="synonymous")%>%
dplyr::filter(SYMBOL%in%genes_of_interest)%>%
dplyr::arrange(desc(VAF))%>%
dplyr::slice(c(1:3)) # take the 3 most abundance mutations
```
Read in the data, enumerate clones, and compute statistics. Sample statistics mirror that seen in Figure 1 [here](https://www.nature.com/articles/s41586-020-2864-x), and are stored in the metadata.
```{r sce construction,eval=FALSE}
sce<-tapestri_h5_to_sce(file=sample_file,variant_set = variants_of_interest)
sce<-enumerate_clones(sce)
sce<-compute_clone_statistics(sce)
```
Simple function for producing a graph in the style of Figure 1D from [here](https://www.nature.com/articles/s41586-020-2864-x),
```{r,eval=F}
clonograph(sce)
```
{width="373"}
Function to perform Reinforcment Learning / MDP approach for clonal trajectory as in Figure 3 [here](https://www.nature.com/articles/s41586-020-2864-x),
```{r,eval=F}
sce<-trajectory_analysis(sce)
```
Methods for protein normalization. Both dsb and CLR normalization can be performed and stored in separate slots. We tend to have favor dsb so far.
```{r,eval=F}
droplet_metadata<- extract_droplet_size(sce)
background_droplets<-droplet_metadata%>%
dplyr::filter(Droplet_type=="Empty")%>%
dplyr::filter(dna_size<1.5&dna_size>0.15)%>%
pull(Cell)
sce<-normalize_protein_data(sce=sce,
metadata=droplet_metadata,
method=c("dsb","CLR"),
detect_IgG=TRUE,
background_droplets=background_droplets)
```
### Developments in progress:
1. Finalizing documentation and improving vignette.
2. Cohort summarization
3. Creating custom TxDB objects
4. Improve trajectory plotting
5. Sample demultiplexing (integration from [Robinson et al](https://www.biorxiv.org/content/10.1101/2022.09.20.508786v1.full), [github](https://github.com/RobinsonTroy/scMRD))
6. Evaluation of allele dropout and clonal confidence
7. Integration for copy number variation
### Ongoing investigation:
1. Improving cell identification and distinction from empty droplets.
1. Doublet and dead cell identification
2. Improve normalization for protein data.
1. Improve cell type identification based on immunophenotype
3. Improvements to the MDP and RL.