-
Notifications
You must be signed in to change notification settings - Fork 3
Quarto notebooks #78
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
Merged
Merged
Quarto notebooks #78
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,104 @@ | ||
| --- | ||
| title: "Details" | ||
| format: | ||
| html: | ||
| theme: flatly | ||
| toc: true | ||
| toc_depth: 3 | ||
| code-fold: true | ||
| embed-resources: false | ||
| number-sections: true | ||
| smooth-scroll: true | ||
| grid: | ||
| body-width: 1000px | ||
| margin-width: 300px | ||
| execute: | ||
| cache: false | ||
| warnings: false | ||
| jupyter: python3 | ||
| --- | ||
|
|
||
| Thank you for using TCRtoolkit! This report is generated from the data you provided. | ||
|
|
||
| :::{.callout-note collapse="true"} | ||
| ## Document Information | ||
| **Current Version:** 1.0-beta | ||
| **Last Updated:** March 2026 | ||
| **Maintainer:** BTC Data Science Team | ||
| **Notes:** | ||
| ::: | ||
|
|
||
| ::: {.callout-note collapse="true"} | ||
| ## Notebook Analysis Scope | ||
| This notebook a more detailed analysis of the samples being analyzed. | ||
| ::: | ||
|
|
||
| ```{python} | ||
| #| tags: [parameters] | ||
| #| include: false | ||
|
|
||
| # --------------------------------------------------------- | ||
| # BASE PARAMETERS | ||
| # --------------------------------------------------------- | ||
| workflow_cmd = '<command used to run the pipeline>' | ||
| project_name='<project_name>' | ||
| project_dir='<path/to/project_dir>' | ||
| sample_table='<path/to/sample_table.csv>' | ||
|
|
||
| timepoint_col = 'timepoint' | ||
| timepoint_order_col = 'timepoint_order' | ||
| alias_col = 'alias' | ||
| subject_col = 'subject_id' | ||
|
|
||
| ``` | ||
|
|
||
| ```{python} | ||
| #| include: false | ||
|
|
||
| # --------------------------------------------------------- | ||
| # DERIVED PATHS | ||
| # --------------------------------------------------------- | ||
|
|
||
| # Define files | ||
| project_dir=f"{project_dir}/{project_name}" | ||
|
|
||
| ``` | ||
|
|
||
| # Before You Begin | ||
|
|
||
| This pipeline can be used to analyze both **single-cell and bulk TCR data**. Please see the note below to understand some of the **implications** depending on the data type you have: | ||
|
|
||
| ::: {.callout-note title="Single-cell vs Bulk Data analysis" collapse="true"} | ||
| **<u>Definition of “counts”</u>** | ||
| - **Single-cell**: | ||
| `counts` represent the number of distinct cells carrying a specific clonotype. For example, a count of 12 indicates that 12 individual cells were encapsulated and sequenced. | ||
| - **Bulk**: | ||
| `counts` represent the abundance of sequencing reads (or UMIs) supporting a clonotype. The biological interpretation depends heavily on the starting material: | ||
|
|
||
| - **RNA (cDNA):** Counts are a composite metric of Cellular Abundance $\times$ Transcriptional Expression. Since activation status affects TCR mRNA levels, a high count could indicate a large clone or a highly active small clone. Normalization strategies can mitigate, but not eliminate, this expression bias. | ||
| - **DNA (gDNA):** Counts are a direct proxy for Cell Number (e.g., Adaptive ImmunoSEQ). Because T-cell genomic templates are constant (one productive rearrangement per cell), DNA sequencing avoids expression bias and allows for accurate estimation of clone size. | ||
|
|
||
| **<u>TCR chains</u>** | ||
| - **Single-cell**: | ||
| It's common to have paired α/β chains per cell. However we only focus on the Beta chain here. | ||
| - **Bulk**: | ||
| In bulk repertoire sequencing, you usually amplify TCRα and TCRβ chains separately. The resulting data contains lists of α clonotypes and lists of β clonotypes, but no information about which α and β belong to the same T cell. We focus only on the Beta chain. | ||
|
|
||
| **<u>Diversity & clonality metrics</u>** | ||
| - **Single-cell**: | ||
| Sensitive to sampling (10^3 – 10^5 cells typical). | ||
| Rare clonotypes may be missed, but you can study functional heterogeneity within clones. | ||
| - **Bulk**: | ||
| Captures broad repertoire diversity (10^5 – 10^6 clonotypes). | ||
| More accurate for richness, evenness, overlap across samples. | ||
|
|
||
| **<u>Downstream biological analyses</u>** | ||
| - **Single-cell**: | ||
| It is possile to link TCRs to phenotypic states (exhaustion, activation, tissue localization), which allows the study of clonotype heterogeneity. | ||
| - **Bulk**: | ||
| It focuses on population-level measures | ||
| ::: | ||
|
|
||
|
|
||
| {{< include ./template_sample.qmd >}} | ||
|
|
||
This file contains hidden or 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,106 @@ | ||||||
| --- | ||||||
| title: "Details" | ||||||
| format: | ||||||
| html: | ||||||
| theme: flatly | ||||||
| toc: true | ||||||
| toc_depth: 3 | ||||||
| code-fold: true | ||||||
| embed-resources: false | ||||||
| number-sections: true | ||||||
| smooth-scroll: true | ||||||
| grid: | ||||||
| body-width: 1000px | ||||||
| margin-width: 300px | ||||||
| execute: | ||||||
| cache: false | ||||||
| warnings: false | ||||||
| jupyter: python3 | ||||||
| --- | ||||||
|
|
||||||
| Thank you for using TCRtoolkit! This report is generated from the data you provided. | ||||||
|
|
||||||
| :::{.callout-note collapse="true"} | ||||||
| ## Document Information | ||||||
| **Current Version:** 1.0-beta | ||||||
| **Last Updated:** March 2026 | ||||||
| **Maintainer:** BTC Data Science Team | ||||||
| **Notes:** | ||||||
| ::: | ||||||
|
|
||||||
| ::: {.callout-note collapse="true"} | ||||||
| ## Notebook Analysis Scope | ||||||
| This notebook a more detailed analysis of the samples being analyzed. | ||||||
| ::: | ||||||
|
|
||||||
| ```{python} | ||||||
| #| tags: [parameters] | ||||||
| #| include: false | ||||||
|
|
||||||
| # --------------------------------------------------------- | ||||||
| # BASE PARAMETERS | ||||||
| # --------------------------------------------------------- | ||||||
| workflow_cmd = '<command used to run the pipeline>' | ||||||
| project_name='<project_name>' | ||||||
| project_dir='<path/to/project_dir>' | ||||||
| sample_table='<path/to/sample_table.csv>' | ||||||
|
|
||||||
| timepoint_col = 'timepoint' | ||||||
| timepoint_order_col = 'timepoint_order' | ||||||
| alias_col = 'alias' | ||||||
| subject_col = 'subject_id' | ||||||
|
|
||||||
| ``` | ||||||
|
|
||||||
| ```{python} | ||||||
| #| include: false | ||||||
|
|
||||||
| # --------------------------------------------------------- | ||||||
| # DERIVED PATHS | ||||||
| # --------------------------------------------------------- | ||||||
|
|
||||||
| # Define files | ||||||
| project_dir=f"{project_dir}/{project_name}" | ||||||
|
|
||||||
| ``` | ||||||
|
|
||||||
| # Before You Begin | ||||||
|
|
||||||
| This pipeline can be used to analyze both **single-cell and bulk TCR data**. Please see the note below to understand some of the **implications** depending on the data type you have: | ||||||
|
|
||||||
| ::: {.callout-note title="Single-cell vs Bulk Data analysis" collapse="true"} | ||||||
| **<u>Definition of “counts”</u>** | ||||||
| - **Single-cell**: | ||||||
| `counts` represent the number of distinct cells carrying a specific clonotype. For example, a count of 12 indicates that 12 individual cells were encapsulated and sequenced. | ||||||
| - **Bulk**: | ||||||
| `counts` represent the abundance of sequencing reads (or UMIs) supporting a clonotype. The biological interpretation depends heavily on the starting material: | ||||||
|
|
||||||
| - **RNA (cDNA):** Counts are a composite metric of Cellular Abundance $\times$ Transcriptional Expression. Since activation status affects TCR mRNA levels, a high count could indicate a large clone or a highly active small clone. Normalization strategies can mitigate, but not eliminate, this expression bias. | ||||||
| - **DNA (gDNA):** Counts are a direct proxy for Cell Number (e.g., Adaptive ImmunoSEQ). Because T-cell genomic templates are constant (one productive rearrangement per cell), DNA sequencing avoids expression bias and allows for accurate estimation of clone size. | ||||||
|
|
||||||
| **<u>TCR chains</u>** | ||||||
| - **Single-cell**: | ||||||
| It's common to have paired α/β chains per cell. However we only focus on the Beta chain here. | ||||||
| - **Bulk**: | ||||||
| In bulk repertoire sequencing, you usually amplify TCRα and TCRβ chains separately. The resulting data contains lists of α clonotypes and lists of β clonotypes, but no information about which α and β belong to the same T cell. We focus only on the Beta chain. | ||||||
|
|
||||||
| **<u>Diversity & clonality metrics</u>** | ||||||
| - **Single-cell**: | ||||||
| Sensitive to sampling (10^3 – 10^5 cells typical). | ||||||
| Rare clonotypes may be missed, but you can study functional heterogeneity within clones. | ||||||
| - **Bulk**: | ||||||
| Captures broad repertoire diversity (10^5 – 10^6 clonotypes). | ||||||
| More accurate for richness, evenness, overlap across samples. | ||||||
|
|
||||||
| **<u>Downstream biological analyses</u>** | ||||||
| - **Single-cell**: | ||||||
| It is possile to link TCRs to phenotypic states (exhaustion, activation, tissue localization), which allows the study of clonotype heterogeneity. | ||||||
|
||||||
| It is possile to link TCRs to phenotypic states (exhaustion, activation, tissue localization), which allows the study of clonotype heterogeneity. | |
| It is possible to link TCRs to phenotypic states (exhaustion, activation, tissue localization), which allows the study of clonotype heterogeneity. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: “possile” should be “possible”.