generated from RajLabMSSM/echoverseTemplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ashley Richardson
committed
Feb 29, 2024
1 parent
1ecf810
commit 0401943
Showing
6 changed files
with
2,688 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,8 +15,9 @@ knitr::opts_chunk$set(echo = TRUE) | |
.libPaths(c("/hpc/packages/minerva-centos7/rpackages/4.2.0/site-library", "/hpc/packages/minerva-centos7/rpackages/bioconductor/3.15", .libPaths())) | ||
library(Seurat) | ||
library(patchwork, lib.loc = "/hpc/packages/minerva-centos7/rpackages/4.2.0/site-library") | ||
library(sctransform, lib.loc = "/hpc/users/richaa21/.Rlib") | ||
library(Seurat, lib.loc = "/hpc/users/richaa21/.Rlib") | ||
library(patchwork) | ||
library(dplyr) | ||
``` | ||
|
||
|
@@ -170,6 +171,8 @@ head([email protected]) | |
# find markers for every cluster compared to all remaining cells, report only the positive | ||
# ones | ||
markers_f <- FindAllMarkers(pbmc.f, only.pos = TRUE) | ||
cluster5.markers <- FindMarkers(pbmc.f, ident.1 = 5, logfc.threshold = 0.25, test.use = "roc", only.pos = TRUE) | ||
``` | ||
|
||
|
||
|
@@ -197,7 +200,7 @@ FeaturePlot(pbmc.f, features = c("MS4A1", "GNLY", "CD3E", "CD14", "FCER1A", "FCG | |
```{r} | ||
.libPaths(c("/hpc/packages/minerva-centos7/rpackages/4.2.0/site-library", "/hpc/packages/minerva-centos7/rpackages/bioconductor/3.15", .libPaths())) | ||
library(patchwork, lib.loc = "/hpc/packages/minerva-centos7/rpackages/4.3.0/site-library") | ||
library(patchwork) | ||
library(tidyr) | ||
f_demuxlet = read.delim("/sc/arion/projects/ad-omics/ashley/data/aF.best", header = T, stringsAsFactors = F, check.names = F) | ||
head(f_demuxlet) | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ knitr::opts_chunk$set(echo = TRUE) | |
.libPaths(c("/hpc/packages/minerva-centos7/rpackages/4.2.0/site-library", "/hpc/packages/minerva-centos7/rpackages/bioconductor/3.15", .libPaths())) | ||
library(Seurat) | ||
library(patchwork, lib.loc = "/hpc/packages/minerva-centos7/rpackages/4.2.0/site-library") | ||
library(patchwork) | ||
library(dplyr) | ||
``` | ||
|
||
|
@@ -197,7 +197,7 @@ FeaturePlot(pbmc.m, features = c("MS4A1", "GNLY", "CD3E", "CD14", "FCER1A", "FCG | |
```{r} | ||
.libPaths(c("/hpc/packages/minerva-centos7/rpackages/4.2.0/site-library", "/hpc/packages/minerva-centos7/rpackages/bioconductor/3.15", .libPaths())) | ||
library(patchwork, lib.loc = "/hpc/packages/minerva-centos7/rpackages/4.3.0/site-library") | ||
library(patchwork) | ||
library(tidyr) | ||
m_demuxlet = read.delim("/sc/arion/projects/ad-omics/ashley/data/aM.best", header = T, stringsAsFactors = F, check.names = F) | ||
head(m_demuxlet) | ||
|
@@ -271,36 +271,6 @@ names([email protected])[names([email protected]) == "m_demuxlet_edit.subset$BARCO | |
head([email protected]) | ||
``` | ||
|
||
|
||
## Remove douplets. | ||
Note - It is a good idea to compare doublet determination by dumuxlet and another resource (i.e. DoupletFinder or scDblFinder). However, these packages do not work with SeuratV5, which is what I used to create my SeuratObject. | ||
For now, I am just removing doublets defined by demuxlet. | ||
|
||
```{r} | ||
#Idents(pbmc.m) <- pbmc.m$DMX_classification.global | ||
#pbmc.m_sing <- subset(x = pbmc.m, idents = c("SNG"), invert = F) | ||
## confirm that there are no doublets left | ||
#table(pbmc.m_sing$DMX_classification.global) | ||
``` | ||
|
||
# Add metadata information. | ||
```{r} | ||
# Add patient data to Seurat object meta data. | ||
#pt_data <- data.frame(DMX_maxID = c("NYUMD0289", "NYUMD0315", "NYUMD0327", "NYUMD0334"), | ||
#DX = c("PD", "PD", "CO", "CO"), | ||
# Sex = c("Male", "Male", "Male", "Male"), | ||
#Age = c(68, 65, 65, 60)) | ||
#merged_df <- merge([email protected], pt_data, by = "DMX_maxID") | ||
#[email protected] <- merged_df | ||
#head([email protected]) | ||
``` | ||
|
||
|
||
```{r Save as .finalRDS file} | ||
saveRDS(pbmc.m, file = "/sc/arion/projects/ad-omics/ashley/PD_Stim/pbmc.monomer.final.RDS") | ||
``` | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,8 +15,9 @@ knitr::opts_chunk$set(echo = TRUE) | |
.libPaths(c("/hpc/packages/minerva-centos7/rpackages/4.2.0/site-library", "/hpc/packages/minerva-centos7/rpackages/bioconductor/3.15", .libPaths())) | ||
library(Seurat) | ||
library(patchwork, lib.loc = "/hpc/packages/minerva-centos7/rpackages/4.2.0/site-library") | ||
library(sctransform, lib.loc = "/hpc/users/richaa21/.Rlib") | ||
library(Seurat, lib.loc = "/hpc/users/richaa21/.Rlib") | ||
library(patchwork) | ||
library(dplyr) | ||
``` | ||
|
||
|
@@ -107,7 +108,7 @@ VizDimLoadings(pbmc.unstim, dims = 1:2, reduction = "pca") | |
``` | ||
|
||
```{r PC2 vs PC1 scatter plot, warning=FALSE} | ||
DimPlot(pbmc.unstim, reduction = "pca") + NoLegend() | ||
DimPlot(pbmc.unstim, reduction = "pca") | ||
``` | ||
|
||
```{r Heatmap of PC1, warning=FALSE} | ||
|
@@ -196,7 +197,6 @@ FeaturePlot(pbmc.unstim, features = c("MS4A1", "GNLY", "CD3E", "CD14", "FCER1A", | |
```{r} | ||
.libPaths(c("/hpc/packages/minerva-centos7/rpackages/4.2.0/site-library", "/hpc/packages/minerva-centos7/rpackages/bioconductor/3.15", .libPaths())) | ||
library(patchwork, lib.loc = "/hpc/packages/minerva-centos7/rpackages/4.3.0/site-library") | ||
library(tidyr) | ||
u_demuxlet = read.delim("/sc/arion/projects/ad-omics/ashley/data/Unstim.best", header = T, stringsAsFactors = F, check.names = F) | ||
head(u_demuxlet) | ||
|
@@ -270,36 +270,6 @@ names([email protected])[names([email protected]) == "u_demuxlet_edit.su | |
head([email protected]) | ||
``` | ||
|
||
|
||
## Remove douplets. | ||
Note - It is a good idea to compare doublet determination by dumuxlet and another resource (i.e. DoupletFinder or scDblFinder). However, these packages do not work with SeuratV5, which is what I used to create my SeuratObject. | ||
For now, I am just removing doublets defined by demuxlet. | ||
|
||
```{r} | ||
#Idents(pbmc.unstim) <- pbmc.unstim$DMX_classification.global | ||
#pbmc.unstim_sing <- subset(x = pbmc.unstim, idents = c("SNG"), invert = F) | ||
## confirm that there are no doublets left | ||
#table(pbmc.unstim_sing$DMX_classification.global) | ||
``` | ||
|
||
# Add metadata information. | ||
```{r} | ||
# Add patient data to Seurat object meta data. | ||
#pt_data <- data.frame(DMX_maxID = c("NYUMD0289", "NYUMD0315", "NYUMD0327", "NYUMD0334"), | ||
#DX = c("PD", "PD", "CO", "CO"), | ||
# Sex = c("Male", "Male", "Male", "Male"), | ||
#Age = c(68, 65, 65, 60)) | ||
#merged_df <- merge([email protected], pt_data, by = "DMX_maxID") | ||
#[email protected] <- merged_df | ||
#head([email protected]) | ||
``` | ||
|
||
|
||
```{r Save as .finalRDS file} | ||
saveRDS(pbmc.unstim, file = "/sc/arion/projects/ad-omics/ashley/PD_Stim/pbmc.unstim.final.RDS") | ||
``` | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.