Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge main into feature/ropenscpca #769

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
48ae7d0
Add clustering exploration
maud-p Sep 4, 2024
a79e243
commit renv.lock
maud-p Sep 5, 2024
d804a26
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 5, 2024
6e1d08c
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 5, 2024
91ef982
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 5, 2024
b49d44b
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 5, 2024
d172246
Update analyses/cell-type-wilms-tumor-06/00_run_workflow.R
maud-p Sep 5, 2024
a26a351
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 5, 2024
9ce209a
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 5, 2024
b0e215f
Add to PR #750
maud-p Sep 5, 2024
3138336
Update README.md
maud-p Sep 5, 2024
dd84652
Add download option to script
jashapiro Sep 7, 2024
a211491
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 10, 2024
bfaef24
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 10, 2024
b57eab3
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 10, 2024
b02c340
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 10, 2024
03be050
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 10, 2024
c933ca6
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 10, 2024
7807d95
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 10, 2024
bf533f5
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 10, 2024
d09b863
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 10, 2024
1080e0a
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 10, 2024
80c791c
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 10, 2024
60d935c
add to PR #750
maud-p Sep 12, 2024
b1c97fb
Update analyses/cell-type-wilms-tumor-06/notebook/README.md
maud-p Sep 12, 2024
1c649f9
Update analyses/cell-type-wilms-tumor-06/notebook/README.md
maud-p Sep 12, 2024
411c3e1
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 12, 2024
d13c9a0
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 12, 2024
394874c
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 12, 2024
1afdddc
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 12, 2024
e451be2
change to PR#750
maud-p Sep 12, 2024
88f82c3
Add notebook 03- to PR#750
maud-p Sep 13, 2024
9e13d14
init module skeleton
JingxuanChen7 Sep 13, 2024
8c2ca67
setup conda env for analysis
JingxuanChen7 Sep 13, 2024
9ab1b6d
Merge pull request #751 from jashapiro/jashapiro/sync-down
jashapiro Sep 13, 2024
6399fca
flip source/destination order
sjspielman Sep 16, 2024
0fad3bc
check in preprocessing scripts and test
JingxuanChen7 Sep 16, 2024
fbf0d60
Merge pull request #763 from sjspielman/sjspielman/update-sync-script…
sjspielman Sep 16, 2024
847bf5a
update doc so far
JingxuanChen7 Sep 16, 2024
30c0c5e
Merge branch 'AlexsLemonade:main' into JingxuanChen7/wilms14_pr
JingxuanChen7 Sep 16, 2024
9c69a26
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 16, 2024
61753ea
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 16, 2024
f2c289b
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 16, 2024
e9e26c6
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 16, 2024
517d478
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 16, 2024
1294215
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 16, 2024
f0fdc0e
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 16, 2024
a77bbbc
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 16, 2024
eda0dac
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 16, 2024
fe01572
Add SCPCS000197 report
maud-p Sep 17, 2024
487d6e9
rm unnecessary & update readme
JingxuanChen7 Sep 17, 2024
6c4b012
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 17, 2024
8e69621
updates on renv, remove conda
JingxuanChen7 Sep 17, 2024
67d9c47
Update analyses/cell-type-wilms-tumor-06/notebook_template/03_cluster…
maud-p Sep 17, 2024
99e11ba
update reports
maud-p Sep 18, 2024
9be5d74
code review
JingxuanChen7 Sep 18, 2024
1731730
resolve comments
JingxuanChen7 Sep 18, 2024
75deae2
Merge pull request #764 from JingxuanChen7/JingxuanChen7/wilms14_pr
jashapiro Sep 18, 2024
8dedcd5
Merge branch 'main' into 03_Look_into_clustering
sjspielman Sep 19, 2024
a0b76ba
Merge pull request #750 from maud-p/03_Look_into_clustering
sjspielman Sep 19, 2024
2908630
Merge branch 'main' into sjspielman/main-into-ropenscpca_2024-09-19
sjspielman Sep 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/docker_cell-type-wilms-tumor-14.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# This is a workflow to build the docker image for the cell-type-wilms-tumor-14 module
#
# Docker modules are run on pull requests when code for files that affect the Docker image have changed.
# If other files are used during the Docker build, they should be added to `paths`
#
# At module initialization, this workflow is inactive, and needs to be activated manually

name: Build docker image for cell-type-wilms-tumor-14

concurrency:
# only one run per branch at a time
group: "docker_cell-type-wilms-tumor-14_${{ github.ref }}"
cancel-in-progress: true

on:
# pull_request:
# branches:
# - main
# paths:
# - "analyses/cell-type-wilms-tumor-14/Dockerfile"
# - "analyses/cell-type-wilms-tumor-14/.dockerignore"
# - "analyses/cell-type-wilms-tumor-14/renv.lock"
# - "analyses/cell-type-wilms-tumor-14/conda-lock.yml"
# push:
# branches:
# - main
# paths:
# - "analyses/cell-type-wilms-tumor-14/Dockerfile"
# - "analyses/cell-type-wilms-tumor-14/.dockerignore"
# - "analyses/cell-type-wilms-tumor-14/renv.lock"
# - "analyses/cell-type-wilms-tumor-14/conda-lock.yml"
workflow_dispatch:
inputs:
push-ecr:
description: "Push to AWS ECR"
type: boolean
required: true

jobs:
test-build:
name: Test Build Docker Image
if: github.event_name == 'pull_request' || (contains(github.event_name, 'workflow_') && !inputs.push-ecr)
runs-on: ubuntu-latest

steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build image
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:analyses/cell-type-wilms-tumor-14"
push: false
cache-from: type=gha
cache-to: type=gha,mode=max

build-push:
name: Build and Push Docker Image
if: github.repository_owner == 'AlexsLemonade' && (github.event_name == 'push' || inputs.push-ecr)
uses: ./.github/workflows/build-push-docker-module.yml
with:
module: "cell-type-wilms-tumor-14"
push-ecr: true
62 changes: 62 additions & 0 deletions .github/workflows/run_cell-type-wilms-tumor-14.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This is a workflow to run the cell-type-wilms-tumor-14 module
#
# Analysis modules are run based on three triggers:
# - Manual trigger
# - On pull requests where code in the module has changed
# - As a reusable workflow called from a separate workflow which periodically runs all modules
#
# At initialization, only the manual trigger is active

name: Run cell-type-wilms-tumor-14 analysis module
env:
MODULE_PATH: analyses/cell-type-wilms-tumor-14
AWS_DEFAULT_REGION: us-east-2

concurrency:
# only one run per branch at a time
group: "run_cell-type-wilms-tumor-14_${{ github.ref }}"
cancel-in-progress: true

on:
workflow_dispatch:
# workflow_call:
# pull_request:
# branches:
# - main
# paths:
# - analyses/cell-type-wilms-tumor-14/**
# - "!analyses/cell-type-wilms-tumor-14/Dockerfile"
# - "!analyses/cell-type-wilms-tumor-14/.dockerignore"
# - .github/workflows/run_cell-type-wilms-tumor-14.yml

jobs:
run-module:
if: github.repository_owner == 'AlexsLemonade'
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: 4.4.0
use-public-rspm: true

- name: Set up pandoc
uses: r-lib/actions/setup-pandoc@v2

- name: Set up renv
uses: r-lib/actions/setup-renv@v2
with:
working-directory: ${{ env.MODULE_PATH }}

# Update this step as needed to download the desired data
- name: Download test data
run: ./download-data.py --test-data --format SCE

- name: Run analysis module
run: |
cd ${MODULE_PATH}
# run module script(s) here
10 changes: 9 additions & 1 deletion analyses/cell-type-wilms-tumor-06/00_run_workflow.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ for (sample_id in metadata$scpca_sample_id) {
# create a directory to save the notebooks
dir.create(file.path(module_base, "notebook", sample_id), showWarnings = FALSE)


# Pre-process the data - `Seurat` workflow
rmarkdown::render(input = file.path(notebook_template_dir, "01_seurat-processing.Rmd"),
params = list(scpca_project_id = project_id, sample_id = sample_id),
Expand All @@ -81,9 +80,18 @@ for (sample_id in metadata$scpca_sample_id) {
output_format = "html_document",
output_file = paste0("02b_fetal_kidney_reference_Stewart_", sample_id, ".html"),
output_dir = file.path(notebook_output_dir, sample_id))

# Cluster exploration
rmarkdown::render(input = file.path(notebook_template_dir, "03_clustering_exploration.Rmd"),
params = list(scpca_project_id = project_id, sample_id = sample_id),
output_format = "html_document",
output_file = paste0("03_clustering_exploration_", sample_id, ".html"),
output_dir = file.path(notebook_output_dir, sample_id))

}
}





14 changes: 11 additions & 3 deletions analyses/cell-type-wilms-tumor-06/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,16 @@ The `00_run_workflow.R` contains the following steps:

- loop for each samples:

-- `Seurat workflow`, nornalization and clustering: `01_seurat-processing.Rmd` in `notebook_template`
-- `Azimuth` label transfer from the fetal full reference (Cao et al.) in `notebook_template`
-- `Azimuth` label transfer from the fetal kidney reference (Stewart et al.) in `notebook_template`
- `Seurat workflow`, normalization and clustering: `01_seurat-processing.Rmd` in `notebook_template`

- `Azimuth` label transfer from the fetal full reference (Cao et al.): `02a_label-transfer_fetal_full_reference_Cao.Rmd` in `notebook_template`

- `Azimuth` label transfer from the fetal kidney reference (Stewart et al.): `02b_label-transfer_fetal_kidney_reference_Stewart.Rmd` in `notebook_template`

- Exploration of clustering, label transfers, marker genes and pathways: `03_clustering_exploration.Rmd` in `notebook_template`


For each sample and each of the step, an html report is generated and accessible in the directory `notebook`.

### Justification

Expand Down Expand Up @@ -185,6 +192,7 @@ Here we will use `Azimuth` to transfer labels from the reference.
We start with the `_process.Rds` data to run `01_seurat-processing.Rmd`.
The output of `01_seurat-processing.Rmd` is saved in `results` in a subfolder for each sample and is the input of the second step `02a_label-transfer_fetal_full_reference_Cao.Rmd`.
The output of `02a_label-transfer_fetal_full_reference_Cao.Rmd` is then the input of `02b_label-transfer_fetal_kidney_reference_Stewart.Rmd`.
Following the same approach, the output of `02b_label-transfer_fetal_kidney_reference_Stewart.Rmd` is the input of `03_clustering_exploration.Rmd`.

At the end of the workflow, we have a `Seurat`object that contains:
- normalization and clustering, dimensional reductions
Expand Down
29 changes: 29 additions & 0 deletions analyses/cell-type-wilms-tumor-06/notebook/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Notebook directory instructions

The notebook directory holds subdirectory for each of the sample in the Wilms tumor dataset SCPCP000006 and the fetal kidney reference that we used for label transfer.

## Azimuth compatible fetal kidney reference

To perform label transfer using Azimuth and the fetal kidney atlas, a reference is built via [`scripts/download-and-create-fetal-kidney-ref.R`](../scripts/download-and-create-fetal-kidney-ref.R) using the fetal_full.Rds object download from:
"https://datasets.cellxgene.cziscience.com/40ebb8e4-1a25-4a33-b8ff-02d1156e4e9b.rds"

As part of the `00b_characterize_fetal_kidney_reference_Stewart.Rmd` notebook template, we characterized the fetal kidney reference and generated lists of marker genes for the compartment and cell types composing the reference.


## Analysis per sample

Each of the sample of the Wilms tumor dataset SCPCP000006 as been pre-processed and characterized as the following.
Reports for each of the steps are found in the notebook/{sample_id} directory:

- `01_seurat_processing_{sample-id}.html` is the output of the [`01_seurat-processing.Rmd`](../notebook_template/01_seurat-processing.Rmd) notebook template.
In brief, the `_processed.rds` `sce object` is converted to `Seurat` and normalized using `SCTransform`.
Dimensionality reduction (`RunPCA` and `RunUMAP`) and clustering (`FindNeighbors` and `FindClusters`) are performed before saving the `Seurat` object.

- `02a_fetal_full_label-transfer_{sample-id}.html` is the output of the [`02a_label-transfer_fetal_full_reference_Cao.Rmd`](../notebook_template/02a_label-transfer_fetal_full_reference_Cao.Rmd) notebook template.
In brief, we used `Azimuth` to transfer labels from the `Azimuth` fetal full reference (Cao et al.)

- `02b_fetal_kidney_label-transfer_{sample-id}.html` is the output of the [`02b_label-transfer_fetal_kidney_reference_Stewart.Rmd`](../notebook_template/02b_label-transfer_fetal_kidney_reference_Stewart.Rmd) notebook template.
In brief, we used `Azimuth` to transfer labels from the fetal kidney reference (Stewart et al.)

- `03_clustering_exploration_{sample-id}.html` is the output of the [`03_clustering_exploration.Rmd`](../notebook_template/03_clustering_exploration.Rmd) notebook template.
In brief, we explore the clustering results, we look into some marker genes, pathways enrichment and label transfer.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading