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

Adjust tutorials #35

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
105 changes: 10 additions & 95 deletions ehrapy_introduction.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion mimic_2_causal_inference.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# MIMIC-II Causal Inference"
"# MIMIC-II IAC Causal Inference"
]
},
{
Expand Down
16 changes: 8 additions & 8 deletions mimic_2_fate.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"id": "70954479-ed2d-4bdb-90ca-5d607019e5b9",
Copy link
Contributor Author

@eroell eroell Oct 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be double checked if the original description is still up to date regarding cluster numbers?


Reply via ReviewNB

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

who should I ask here @Zethson ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me? idk^^ the dataset is simple and we just look at it ourselves. Did the numbers look wrong, change or are fishy?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they look fishy to me, and I wonder if the leiden clusters changed from when this text was written

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally possible. But unfortunately, it'd be you (us) that has to look at them. No expert involved.

"metadata": {},
"source": [
"# MIMIC-II IAC Patient Fate"
"# MIMIC-II IAC Patient Trajectory and Fate"
]
},
{
Expand All @@ -15,8 +15,8 @@
"source": [
"In the previous [introduction tutorial](https://ehrapy.readthedocs.io/en/latest/tutorials/notebooks/mimic_2_introduction.html), we explored the MIMIC-II IAC dataset, comprising electronic health records (EHR) of 1776 patients in 46 features, and identified patient group-specific clusters using ehrapy. Please go through the MIMIC-II IAC introduction before performing this tutorial to get familiar with the dataset. \n",
"\n",
"As a next step, we want to determine patient fate. The goal is to detect terminal states and the corresponding origins based on pseudotime. Real time very rarely reflects the actual progression of a disease. When measurements are done on a certain day, some patients will show no sign of disease (e.g. healthy or recovered), some are at the onset of a specific disease and some are in a more severe stage or even at the height.\n",
"For an appropriate analysis, we are interested in a continuous transition of states, such as from healthy to diseased to death, for which the real time is therefore not informative. Identification of transition states can be achieved by identifying source states (e.g. healthy) and then calculating pseudotime from this state.\n",
"As a next step, we want to determine patient trajectories and patient fate. The goal is to detect terminal states and the corresponding origins based on pseudotime. Real time very rarely reflects the actual progression of a disease. When measurements are done in a single snapshot or cross-sectional setting, some patients will show no sign of disease (e.g. healthy or recovered), some are at the onset of a specific disease and some are in a more severe stage or even at the height.\n",
"For an appropriate analysis, we are interested in a continuous transition of states, such as from healthy to diseased to death, for which the real time is therefore not available or informative. Identification of transition states can be achieved by identifying source states (e.g. healthy) and then calculating pseudotime from this state.\n",
"Based on Markov chain modelling, we uncover patient dynamics using [CellRank](https://cellrank.readthedocs.io/en/latest/index.html).\n",
"For more details, please read [CellRank paper 1](https://www.nature.com/articles/s41592-021-01346-6) and [CellRank paper 2](https://www.biorxiv.org/content/10.1101/2023.07.19.549685v1)."
]
Expand Down Expand Up @@ -149,7 +149,7 @@
"id": "53aedbab",
"metadata": {},
"source": [
"This tutorial is based on the MIMIC-II IAC dataset which was previously introduced in the [MIMIC-II IAC introduction tutorial](https://ehrapy.readthedocs.io/en/latest/tutorials/notebooks/mimic_2_introduction.html). We will load the encoded version of the dataset as an AnnData object, ehrapy's default encoding is a simple one-hot encoding in this case. "
"This tutorial is based on the MIMIC-II IAC dataset which was previously introduced in the [MIMIC-II IAC introduction tutorial](https://ehrapy.readthedocs.io/en/latest/tutorials/notebooks/mimic_2_introduction.html)."
]
},
{
Expand Down Expand Up @@ -390,7 +390,7 @@
"id": "668158ef",
"metadata": {},
"source": [
"This UMAP embedding is exactly the same as previously computed in the MIMIC-II IA introduction tutorial. Now we continue with the patient fate analysis."
"This UMAP embedding is exactly the same as previously computed in the MIMIC-II IAC introduction tutorial. Now we continue with the patient fate analysis."
]
},
{
Expand Down Expand Up @@ -477,7 +477,7 @@
"source": [
"The [PseudotimeKernel](https://cellrank.readthedocs.io/en/latest/notebooks/tutorials/kernels/300_pseudotime.html) computes direct transition probabilities based on a KNN graph and pseudotime.\n",
"\n",
"The KNN graph contains information about the (undirected) conductivities among observations (here patients), reflecting their similarity. Pseudotime can be used to either remove edges that point against the direction of increasing pseudotime, or to downweight them."
"The KNN graph contains information about the (undirected) conductivities among patients, reflecting their similarity. Pseudotime can be used to either remove edges that point against the direction of increasing pseudotime, or to downweight them."
]
},
{
Expand Down Expand Up @@ -550,7 +550,7 @@
"id": "6c4565ca",
"metadata": {},
"source": [
"We observe two main trajectories originating from cluster 0 going to clusters 2 and 5. Let's check the metadata again. "
"We observe two main trajectories originating from cluster 0 going to clusters 2, 3, and 5. Let's check the metadata again. "
]
},
{
Expand Down Expand Up @@ -606,7 +606,7 @@
"id": "822d68d1-4406-4615-b695-95d1f7e24deb",
"metadata": {},
"source": [
"Cluster 2 consists of patients that deceased and had severe comorbidities while cluster 5 includes patients with a high day post ICU admission. "
"Cluster 4 and 1 consist of patients that deceased, while cluster 5 includes patients with a high day post ICU admission. "
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion mimic_2_survival_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"id": "c9f3ba8d-da52-4038-8f63-2b513fd51fe4",
"metadata": {},
"source": [
"# MIMIC-II Survival Analysis"
"# MIMIC-II IAC Survival Analysis"
]
},
{
Expand Down
96 changes: 9 additions & 87 deletions out_of_core.ipynb

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions patient_trajectory.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Patient Trajectory in COVID-19\n",
"\n",
"We want to understand the patient trajectory of patients with infectious diseases such as COVID-19.\n",
"Single-cell genomics can generate highly detailed molecular biological information on individuals suffering from such a disease.\n",
"[patpy](https://github.com/lueckenlab/patpy) is a tool which can generate a patient representation from such an individual patient's single-cell genomic profile.\n",
"\n",
"Check out **[this tutorial](https://github.com/lueckenlab/patpy/blob/main/docs/notebooks/Patient_trajectories_example.ipynb)** on the patpy repository to learn more about how ehrapy can be used for trajectory inference on representations generated from patpy."
]
}
],
"metadata": {
"language_info": {
"name": "python"
}
},
"nbformat": 4,
"nbformat_minor": 2
}