-
Notifications
You must be signed in to change notification settings - Fork 2
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
Showing
22 changed files
with
172 additions
and
49 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 |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
.Rhistory | ||
.RData | ||
.Ruserdata | ||
*.Rproj | ||
*.Rproj | ||
test/* |
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
This file was deleted.
Oops, something went wrong.
Empty file.
Empty file.
9 changes: 0 additions & 9 deletions
9
inst/rmarkdown/templates/rnaseq/skeleton/reports/QC/run_markdown.R
This file was deleted.
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
10 changes: 1 addition & 9 deletions
10
...own/templates/rnaseq/skeleton/params_de.R → ...emplates/rnaseqv2/skeleton/DE/params_de.R
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 |
---|---|---|
@@ -1,16 +1,8 @@ | ||
# info params | ||
project = "name_hbcXXXXX" | ||
PI = 'person name' | ||
experiment = 'short description' | ||
aim = 'short description' | ||
analyst = 'person in the core' | ||
|
||
# project params | ||
root = "../.." | ||
date = "YYYYMMDD" | ||
column = "sample_type" | ||
subset_column = NA | ||
coldata_fn = "https://raw.githubusercontent.com/bcbio/bcbioR-test-data/main/rnaseq/bcbio/coldata.csv" | ||
counts_fn = 'https://raw.githubusercontent.com/bcbio/bcbioR-test-data/main/rnaseq/bcbio/tximport-counts.csv' | ||
se_object=url("https://raw.githubusercontent.com/bcbio/bcbioR-test-data/main/rnaseq/bcbio/bcbio-se.rds") | ||
basedir <- 'results' | ||
basedir <- './' |
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
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
6 changes: 0 additions & 6 deletions
6
...own/templates/rnaseq/skeleton/params_qc.R → ...emplates/rnaseqv2/skeleton/QC/params_qc.R
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 |
---|---|---|
@@ -1,10 +1,4 @@ | ||
# info params | ||
project = "name_hbcXXXXX" | ||
PI = 'person name' | ||
experiment = 'short description' | ||
aim = 'short description' | ||
analyst = 'person in the core' | ||
|
||
|
||
metadata_fn='https://raw.githubusercontent.com/bcbio/bcbioR-test-data/main/rnaseq/bcbio/coldata.csv' | ||
se_object=url("https://raw.githubusercontent.com/bcbio/bcbioR-test-data/main/rnaseq/bcbio/bcbio-se.rds") |
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
inst/rmarkdown/templates/rnaseqv2/skeleton/QC/run_markdown.R
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
library(rmarkdown) | ||
|
||
rmarkdown::render("QC.Rmd", | ||
output_dir = "./", | ||
clean = TRUE, | ||
output_format = "html_document", | ||
params = list( | ||
params_file = 'params_qc.R', | ||
project_file = '../information.R') | ||
) |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Guideline for RNAseq downstream analysis | ||
|
||
# DropBox | ||
|
||
- In `reports/QC` | ||
- [ ] copy `bcbio-se.rds` and `tximport-counts.csv` | ||
- [ ] copy QC `Rmd/R/html/figures` | ||
- In `reports/DE` | ||
- [ ] Normalized counts for all genes x all samples (csv format) | ||
- In `reports/DE`, for *each analysis*: | ||
- **Note** For multiple comparisons/analysis, do a single report/template if possible in the parent folder using parameters whenever possible. | ||
- Create a folder with the comparison names in the files. Numbering by comparison (`01.1_DE_comp1`, `01.2_DE_comp2`, etc.). If you’re running multiple models for the same comparison, append `_M#`. Add the following files under each folder: | ||
- [ ] Normalized count table with the samples used in this analysis/comparison. | ||
- [ ] Full results `DESeq2` for all genes (csv format) with annotation columns appended. | ||
- [ ] Significant genes results file (subset of annotated full results by chosen p-value and LFC). Separate files will be created for each individual contrast. | ||
- [ ] Significant genes results file as described above, but additionally append columns containing normalized count values for each sample. | ||
- Make sure to append the gene symbols to these tables so the researcher can interpret the results. | ||
|
||
# GitHub | ||
|
||
- [ ] Push all `*Rmd` `*R` files used for the *QC* and *DE* analysis respecting folder structure. | ||
|
||
Please, ignore `*html/figures/csv` and any output of the code. |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# info params | ||
project = "name_hbcXXXXX" | ||
PI = 'person name' | ||
experiment = 'short description' | ||
aim = 'short description' | ||
analyst = 'person in the core' |
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
2 changes: 1 addition & 1 deletion
2
.../rmarkdown/templates/rnaseq/template.yaml → ...markdown/templates/rnaseqv2/template.yaml
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
name: bcbio RNAseq | ||
description: Standard RNAseq down-stream analyses | ||
create_dir: true | ||
create_dir: false |
61 changes: 61 additions & 0 deletions
61
inst/rmarkdown/templates/singlecell/skeleton/Integration/helpers.R
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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# some code showing integrating two seurat objects | ||
library(Seurat) | ||
library(tidyverse) | ||
library(harmony) | ||
|
||
# We assume exp1 and exp2 has a Group column with naming the sample groups | ||
# We create a batch annotation for each batch | ||
exp1=readRDS("data/exp1.rds") | ||
exp1$batch="n10" | ||
exp2=readRDS("data/exp2.rds") | ||
exp2$batch="n6" | ||
|
||
# Normalize ---- | ||
exp = SCTransform(exp, verbose = FALSE,conserve.memory=TRUE, | ||
variable.features.n = 3000) | ||
exp <- RunPCA(exp) | ||
ElbowPlot(exp,ndims=40) | ||
end_dimension=35 | ||
resolution=0.5 | ||
|
||
# Clustering for each batch ---- | ||
exp <- FindNeighbors(exp, dims = 1:end_dimension, reduction = "pca") | ||
exp <- FindClusters(exp, resolution = resolution, cluster.name = "unintegrated_clusters") | ||
exp <- RunUMAP(exp, dims = 1:end_dimension, reduction = "pca", reduction.name = "umap.unintegrated") | ||
saveRDS(exp, file="data/merged_umap.rds") | ||
|
||
## Plot by batch---- | ||
DimPlot(exp, reduction = "umap.unintegrated", split.by = c("Group"), | ||
group.by = c("batch")) | ||
|
||
# Integration ---- | ||
exp <- IntegrateLayers( | ||
object = exp, method = HarmonyIntegration, | ||
orig.reduction = "pca", new.reduction = "harmony", | ||
verbose = FALSE | ||
) | ||
exp[["RNA"]] <- JoinLayers(exp[["RNA"]]) | ||
end_dimension=35 | ||
resolution=0.5 | ||
exp <- FindNeighbors(exp, reduction = "harmony", dims = 1:end_dimension) | ||
exp <- FindClusters(exp, resolution = resolution, cluster.name = "harmony_clusters") | ||
exp <- RunUMAP(exp, reduction = "harmony", dims = 1:end_dimension, reduction.name = "umap.harmony") | ||
saveRDS(exp, file="data/integrated_harmony.rds") | ||
|
||
## Plot by Group and Cluster ---- | ||
DimPlot( | ||
exp, | ||
reduction = "umap.harmony", | ||
split.by = c("Group"), | ||
group.by = c("batch"), | ||
combine = TRUE, label.size = 2 | ||
) | ||
|
||
DimPlot( | ||
exp, | ||
reduction = "umap.harmony", | ||
split.by = c("Group"), | ||
group.by = c("ident"), | ||
combine = TRUE, label.size = 2 | ||
) | ||
|
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Tipical steps for scRNAseq downstream analysis | ||
|
||
# DropBox | ||
|
||
- In `reports/QC` | ||
- [ ] copy QC `Rmd/R/html/figures` | ||
- In `reports/Clusters` | ||
- [ ] the analysis of `SCTransform`, ,`RunPCA` ,`FindNeighbors`, ,`FindClusters`, `RunUMAP` | ||
- [ ] the analysis of `FindMarkers` and `Cell Identification` | ||
- In `reports/DE`, for *each analysis*: | ||
- TBD | ||
|
||
# GitHub | ||
|
||
- [ ] Push all `*Rmd` `*R` files used for the *QC* and *DE* analysis respecting folder structure. | ||
|
||
Please, ignore `*html/figures/csv` and any output of the code. |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# project params | ||
root = "../" | ||
date = "YYYYMMDD" | ||
column = "treatment" | ||
subset_column = 'cell' | ||
metadata_fn = "../meta/samplesheet.csv" | ||
counts_fn = '../data/tximport-counts.csv' | ||
basedir <- 'reports' |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
title: "General Project Information" | ||
author: "Harvard Chan Bioinformatics Core" | ||
date: "`r Sys.Date()`" | ||
output: | ||
html_document: | ||
code_folding: hide | ||
df_print: paged | ||
highlights: pygments | ||
number_sections: true | ||
self_contained: true | ||
theme: default | ||
toc: true | ||
toc_float: | ||
collapsed: true | ||
smooth_scroll: true | ||
editor_options: | ||
chunk_output_type: console | ||
params: | ||
params_file: information.R | ||
--- | ||
|
||
```{r echo = F} | ||
source(params$params_file) | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: bcbio scRNAseq | ||
description: Standard scRNAseq down-stream analyses | ||
create_dir: false |