-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathosteo_atlas.qmd
More file actions
191 lines (148 loc) · 4.63 KB
/
osteo_atlas.qmd
File metadata and controls
191 lines (148 loc) · 4.63 KB
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
---
title: "Osteosarcoma scAtlas"
author: "Yogesh Budhathoki and Matt Cannon"
date: "`r format(Sys.time(), '%m/%d/%Y')`"
format:
html:
toc: true
toc_float: true
toc_depth: 5
number_sections: false
code-fold: true
code-link: true
df-print: kable
embed-resources: true
execute:
cache: true
knitr:
opts_chunk:
cache.lazy: false
cache.vars: ""
warning: false
message: false
lightbox: true
---
```{r setup_main}
#| include: FALSE
library(monocle3)
library(rrrSingleCellUtils)
library(rrrSnvs)
library(Seurat)
library(ggrepel)
library(tidyverse)
library(harmony)
library(cowplot)
library(clustree)
library(data.table)
library(hdf5r)
library(Rmagic)
library(knitr)
library(scATOMIC)
library(copykat)
library(SCENIC)
library(stashPlot)
library(ggalluvial)
library(RColorBrewer)
library(gridExtra)
library(CellChat)
library(patchwork)
library(circlize)
library(NMF)
knitr::purl("child_qmds/helper_functions.qmd", "helpers.R")
source("helpers.R")
# # list of files in order to keep track of the files order
# read_raw_data.qmd
# helper_functions.qmd
# variants.qmd
# annotate_celltypes.qmd
# annot_cancer_scevan_scatomic.qmd
# annot_cancer_celltype.qmd
# split_tumor_stromal.qmd
# degs_gseaplots.qmd
# regulon.qmd
# helper_functions_correlation.qmd
# groupwise_expr_correlations.qmd
# patient_reanalysis.qmd
# stroma_reclustering.qmd
# main_figures.qmd
# TAMs_analysis.qmd
```
# Load in functions
{{< include child_qmds/helper_functions.qmd >}}
# Set up directory structure
```{bash mkdirs}
for directoryName in \
output \
output/figures \
output/figures/gsea \
output/seurat_objects/final_combined_sobjs \
output/figures/tumor_vs_stroma/clustree \
output/figures/stromal_species_correlations \
output/figures/tumor_subtypes_correlations \
output/figures/spatial/spacexr \
output/figures/spatial/lees \
output/counts \
output/metadata \
output/seurat_objects/sobj_preprocess \
output/seurat_objects/comb_sobjs \
output/seurat_objects/harmony_sobjs \
output/seurat_objects/harmony_sobjs_annot \
output/seurat_objects/sobj_preprocess_ \
output/seurat_objects/tumor_vs_stroma \
output/id_tumor/scATOMIC \
output/id_tumor/SCEVAN \
output/id_tumor/snv_calling \
output/id_tumor/snvs/plots \
output/id_tumor/celltype \
output/stromal_species_correlations \
output/tumor_subtypes_correlations \
output/spacexr/granular_references/ \
output/spacexr/granular_references/lee_perms
do
if [ ! -d ${directoryName} ]
then
mkdir -p ${directoryName}
fi
done
```
# Read in raw data and process to Seurat objects
The metadata for all samples is stored in misc/all_samples.txt.
This reads in the raw data from the hdf5 files and processes them to Seurat objects.
The individual objects are saved to `output/seurat_objects/sobj_preprocess/`
Merged data for each group (as defined in the metadata) are saved to `output/seurat_objects/comb_sobjs/`
Harmonized datasets are saved to `output/seurat_objects/sobj_preprocess_merged/`
{{< include child_qmds/read_raw_data.qmd >}}
# Use SingleR and reference datasets to annotate cell types
The output of this is written to `output/seurat_objects/harmony_sobjs_annot/`
{{< include child_qmds/annotate_celltypes.qmd >}}
<!-- # Use SNV calling to try to ID tumor cells
Run Matts SNV calling pipeline to try to ID tumor cells
{{< include child_qmds/variants.qmd >}} -->
# Use SCEVAN and scATOMIC to try to identify tumor cells
This will help in splitting the cancer cells from the stroma cells.
{{< include child_qmds/annot_cancer_scevan_scatomic.qmd >}}
# Use SingleR cell annotations to try to ID cancer cells
{{< include child_qmds/annot_cancer_celltype.qmd >}}
# Split cancer vs the stroma
{{< include child_qmds/split_tumor_stromal.qmd >}}
# DEGS and GSEA
Run the differential expression and GSEA
{{< include child_qmds/degs_gseaplots.qmd >}}
<!-- # Investigate the expression correlation between subgroups of the data
{{< include child_qmds/helper_functions_correlation.qmd >}}
{{< include child_qmds/groupwise_expr_correlations.qmd >}}
# Regulon Analysis
Perform the regulon analysis using the SCENIC package. The regulon analysis is
{{< include child_qmds/regulon.qmd >}}
# Stromal Reclustering
Recluster the stromal cells
{{< include child_qmds/stromal_reclustering.qmd >}}
# Patient Reanalysis
Reanalyze the patient samples for validation such as harmony integration validation
{{< include child_qmds/patient_reanalysis.qmd >}}
# render to make figures html
{{< include child_qmds/render_figs.qmd >}} --> -->
# Session info
```{r}
sessionInfo()
```