Skip to content

Commit

Permalink
Update README, correct file paths in the notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
lunaticstarr committed Nov 27, 2024
1 parent 637decf commit b804643
Show file tree
Hide file tree
Showing 15 changed files with 94 additions and 156 deletions.
21 changes: 12 additions & 9 deletions Composing models/Merge logical models.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@
"metadata": {},
"outputs": [],
"source": [
"home = \"persistent/\" # home path for Logic Model Merger\n",
"model1name = \"Palma2021\"\n",
"model2name = \"Ikonomi2020\""
"model2name = \"Ikonomi2020\"\n",
"sbml_file1 = home + \"LogicModelMerger/Models/\" + model1name + \".sbml\"\n",
"sbml_file2 = home + \"LogicModelMerger/Models/\" + model2name + \".sbml\""
]
},
{
Expand Down Expand Up @@ -435,8 +438,8 @@
],
"source": [
"# Load the networks\n",
"network1 = read_network(\"../Models/\" + model1name + \".sbml\")\n",
"network2 = read_network(\"../Models/\" + model2name + \".sbml\")\n",
"network1 = read_network(sbml_file1)\n",
"network2 = read_network(sbml_file2)\n",
"print(\"Network #1:\")\n",
"print(network1)\n",
"print(\"Network #2:\")\n",
Expand Down Expand Up @@ -694,12 +697,12 @@
"merged_inhibitor_wins_name = \"merged_inhibitor_wins_\" + model1name + \"_\" + model2name\n",
"merged_or_name = \"merged_or_\" + model1name + \"_\" + model2name\n",
"\n",
"write_network_to_file(merged_network_and, \"../Updated/Models/\" + merged_and_name, format=\"text\")\n",
"write_network_to_file(merged_network_inhibitor_wins, \"../Updated/Models/\" + merged_inhibitor_wins_name, format=\"text\")\n",
"write_network_to_file(merged_network_or, \"../Updated/Models/\" + merged_or_name, format=\"text\")\n",
"write_network_to_file(merged_network_and, \"../Updated/Models/\" + merged_and_name, format=\"sbml\")\n",
"write_network_to_file(merged_network_inhibitor_wins, \"../Updated/Models/\" + merged_inhibitor_wins_name, format=\"sbml\")\n",
"write_network_to_file(merged_network_or, \"../Updated/Models/\" + merged_or_name, format=\"sbml\")\n"
"write_network_to_file(merged_network_and, home + \"LogicModelMerger/Models/\" + merged_and_name, format=\"text\")\n",
"write_network_to_file(merged_network_inhibitor_wins, home + \"LogicModelMerger/Models/\" + merged_inhibitor_wins_name, format=\"text\")\n",
"write_network_to_file(merged_network_or, home + \"LogicModelMerger/Models/\" + merged_or_name, format=\"text\")\n",
"write_network_to_file(merged_network_and, home + \"LogicModelMerger/Models/\" + merged_and_name, format=\"sbml\")\n",
"write_network_to_file(merged_network_inhibitor_wins, home + \"LogicModelMerger/Models/\" + merged_inhibitor_wins_name, format=\"sbml\")\n",
"write_network_to_file(merged_network_or, home + \"LogicModelMerger/Models/\" + merged_or_name, format=\"sbml\")\n"
]
}
],
Expand Down
File renamed without changes.
Empty file.
51 changes: 27 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,45 @@

## Overview

This repository contains the code and resources for merging gene regulatory network (GRN) models as described in the manuscript **"Merging Logical Models: An Application in Acute Myeloid Leukemia Modeling"**. The repository provides a complete workflow for merging logic models, enhancing our understanding of complex biological systems, and demonstrate its application in Acute Myeloid Leukemia (AML).
This repository contains the code and resources for merging gene regulatory network (GRN) models as described in the manuscript **"Workflow for merging logical models: An application to gene regulation"**. The repository provides a semi-automated workflow for merging logic models, and demonstrate its application in Acute Myeloid Leukemia (AML) models.

The workflow presented in this repository involves sequential steps:
The workflow involves sequential steps:

1. **Identifying Candidate Models**: This step involves reviewing existing literature, repositories, and databases to identify models with shared components, such as shared genes in the GRNs.
2. **Standardizing and Annotating Models**: Standardizing the gene names using international standards like HGNC approved symbols and ensuring models are reproducible.
3. **Reproducing Selected Models**: Verifying that selected models replicate the behaviors described in their original publications.
4. **Merging Models**: Using the provided code to merge models with different logical combination methods (`OR`, `AND`, `Inhibitor Wins`).
1. **Finding Models**: This step involves reviewing existing literature, repositories, and databases to identify models with shared components.
2. **Standardizing and Annotating Models**: Convert models to SBML-qual format, and annotate gene names using HGNC approved symbols.
3. **Reproducing Selected Models**: Verifying that selected models replicate the behaviors described in their original resources.
4. **Merging Models**: Using the provided tool to automatically merge models with different logical combination methods (`OR`, `AND`, `Inhibitor Wins`).
5. **Evaluating the Merged Models**: Comparing the predictive accuracy and robustness of the merged models against the original models and applying the merged models to new, untested scenarios.

## Repository Structure

This repository is organized according to the workflow described in the manuscript:

1. **`Standardizing & Annotating Models`**:
- [Standardization](Standardizing%20and%20annotating%20models/Standardization.ipynb): Converting models in text file to SBML-qual format.
- [Annotation](Standardizing%20and%20annotating%20models/Annotation.ipynb): Fetching HGNC gene symbols for input SBML-qual models and updating the gene names after manual verification.
- [Standardization](Standardizing%20and%20annotating%20models/Convert%20model%20in%20text%20file%20to%20SBML-qual.ipynb): Converting models in text file to SBML-qual format.
- [Annotation](Standardizing%20and%20annotating%20models/Standardize%20gene%20names%20to%20HGNC%20symbol.ipynb): Fetching HGNC gene symbols for input SBML-qual models and updating the gene names after manual verification.
2. **`Reproducing Selected Models`**:
- Reproducibility check for each collected model, including:
- [`Bonzanni2013`](Reproducing%20selected%20models/Bonzanni2013)
- [`Ikonomi2020`](Reproducing%20selected%20models/Ikonomi2020)
- [`Krumsiek2011`](Reproducing%20selected%20models/Krumsiek2011)
- [`Palma2021`](Reproducing%20selected%20models/Palma2021) *(As Fig S3, S4 in the manuscript)*
- [Bonzanni2013](Reproducing%20selected%20models/Bonzanni2013/Bonzanni2013.ipynb)
- [Ikonomi2020](Reproducing%20selected%20models/Ikonomi2020/Ikonomi2020.ipynb)
- [Krumsiek2011](Reproducing%20selected%20models/Krumsiek2011/Krumsiek2011.ipynb)
- [Palma2021](Reproducing%20selected%20models/Palma2021/Palma2021.ipynb) *(As Table S3 in the manuscript)*
3. **`Composing Models`**:
- [Merge logical models](Composing%20models/Merge%20logical%20models.ipynb): Merging logical models, including the OR, AND, and Inhibitor Wins methods.
- Support model input in:
- Text files using a EBNF description
- [Merge logical models](Composing%20models/Merge%20logical%20models.ipynb): Automatically merging logical models, including the OR, AND, and Inhibitor Wins methods.
- Support models in:
- Text files using a EBNF description as in `Boolnet`
- SBML-qual files
4. **`Evaluating the Merged Model`**:
- [Functions](Evaluating%20the%20merged%20model/Helper%20functions.ipynb): Provides some helper functions for evaluating logical models.
- Contains notebooks for various evaluation tasks:
- [**Coverage**](Evaluating%20the%20merged%20model/Coverage.ipynb): Assessing the coverage of AML patients with each mutation profiles using BeatAML, TCGA, AMLSG and cBioPortal data. *(Fig S7)*
- [**Stable States Heatmap**](Evaluating%20the%20merged%20model/Stable%20states%20heatmap.ipynb): Visualizing stable states of the merged models and clustering them with individual models. *(Fig 3)*
- [**Correlation with HSC Expression**](Evaluating%20the%20merged%20model/Correlation%20with%20HSC%20expression.ipynb): Analyzing the correlation of model predictions with hematopoietic stem cell expression data. *(Fig 4, Fig S2)*
- [**Coverage**](Evaluating%20the%20merged%20model/Coverage.ipynb): Assessing the coverage of AML patients with each mutation profiles using BeatAML, TCGA, AMLSG and cBioPortal data.
- [**Stable States Heatmap**](Evaluating%20the%20merged%20model/Stable%20states%20heatmap.ipynb): Visualizing stable states of the merged models and clustering them with individual models. *(Fig 2B, 3B, S1)*
- [**Correlation with HSC Expression**](Evaluating%20the%20merged%20model/Correlation%20with%20HSC%20expression.ipynb): Analyzing the correlation of model predictions with hematopoietic stem cell expression data. *(Fig 2C-E, Fig S2)*
- **Correlation with Clinical Outcomes**: Separate notebooks for evaluating correlations with different clinical indicators/datasets:
- Blast percentages from the BeatAML data
- [Using approach similar to Palma et al.](Evaluating%20the%20merged%20model/Correlation%20with%20clinical%20outcome_BeatAML_Palma%20approach.ipynb) *(Fig 5a,b, Fig S5)*
- [Using all mutations](Evaluating%20the%20merged%20model/Correlation%20with%20clinical%20outcome_BeatAML_all%20mutation.ipynb) *(Fig 5c,d, Fig S6)*
- [Blast percentages from the TCGA data](Evaluating%20the%20merged%20model/Correlation%20with%20clinical%20outcome_TCGA.ipynb) *(Fig S4)*
- [Using approach similar to Palma et al.](Evaluating%20the%20merged%20model/Correlation%20with%20clinical%20outcome_BeatAML_Palma%20approach.ipynb) *(Fig 3C-D, Fig S4)*
- [Using all mutations](Evaluating%20the%20merged%20model/Correlation%20with%20clinical%20outcome_BeatAML_all%20mutation.ipynb) *(Fig 3E-F, Fig S4)*
- [Blast percentages from the TCGA data](Evaluating%20the%20merged%20model/Correlation%20with%20clinical%20outcome_TCGA.ipynb) *(TableS3)*
- [Hazard ratio for death from the AMLSG data](Evaluating%20the%20merged%20model/Correlation%20with%20clinical%20outcome_AMLSG.ipynb)

- [**`Data`**](Data): Contains datasets used for model evaluation.
Expand All @@ -54,14 +55,16 @@ This repository is organized according to the workflow described in the manuscri
git clone https://github.com/IlyaLab/LogicModelMerger.git

2. **Install and open the CoLoMoTo Notebook** (Optional):
Please refer to the usage guide on their website.
Please refer to the usage guide on their [website](https://colomoto.github.io/colomoto-docker/).

3. **Run notebooks:**
Navigate to the relevant directory and open the Jupyter notebooks using the CoLoMoTo notebook or your preferred Jupyter environment.


### CoLoMoTo Interactive Notebook

All Jupyter notebooks in this repository were conducted using the CoLoMoTo Interactive Notebook with the Docker image `colomoto/colomoto-docker:2024-03-01`. The CoLoMoTo notebook provides a unified environment to edit, execute, share, and reproduce analyses of qualitative models of biological networks.
Jupyter notebooks in this repository were conducted using the CoLoMoTo Interactive Notebook with Docker image `colomoto/colomoto-docker:2024-03-01`.

The CoLoMoTo notebook provides a unified environment to edit, execute, share, and reproduce analyses of qualitative models of biological networks.

For more information about CoLoMoTo Interactive Notebook, visit [CoLoMoTo](http://www.colomoto.org/notebook/).
For more information, visit [CoLoMoTo](http://www.colomoto.org/notebook/).
9 changes: 5 additions & 4 deletions Reproducing selected models/Bonzanni2013/Bonzanni2013.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@
"import matplotlib.pyplot as plt\n",
"from matplotlib.colors import ListedColormap\n",
"\n",
"home = \"persistent/\" # home path for Logic Model Merger\n",
"model_name = \"Bonzanni2013\"\n",
"txt_file = \"persistent/Models/\" + model_name + \".txt\"\n",
"sbml_file = \"persistent/Models/\" + model_name + \".sbml\""
"txt_file = home + \"LogicModelMerger/Models/\" + model_name + \".txt\"\n",
"sbml_file = home + \"LogicModelMerger/Models/\" + model_name + \".sbml\""
]
},
{
Expand Down Expand Up @@ -425,7 +426,7 @@
"\n",
"df_simple = df.T\n",
"df_simple.index = df_simple.index.str.replace('Attr', 'S')\n",
"df_simple.to_csv('persistent/SimulationResults/attr_' + model_name + '_simple.csv')\n",
"df_simple.to_csv(home + 'LogicModelMerger/SimulationResults/attr_' + model_name + '_simple.csv')\n",
"df_simple"
]
},
Expand Down Expand Up @@ -1009,7 +1010,7 @@
"\n",
"df = df.T\n",
"df.index = df.index.str.replace('Attr', 'S')\n",
"df.to_csv('persistent/SimulationResults/attr_' + model_name + '.csv')\n",
"df.to_csv(home + 'LogicModelMerger/SimulationResults/attr_' + model_name + '.csv')\n",
"df"
]
},
Expand Down
14 changes: 9 additions & 5 deletions Reproducing selected models/Ikonomi2020/Ikonomi2020.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,12 @@
"from matplotlib.colors import ListedColormap\n",
"from matplotlib.gridspec import GridSpec\n",
"import matplotlib.patches as patches\n",
"import matplotlib.colors as colors"
"import matplotlib.colors as colors\n",
"\n",
"home = \"persistent/\" # home path for Logic Model Merger\n",
"model_name = \"Ikonomi2020\"\n",
"txt_file = home + \"LogicModelMerger/Models/\" + model_name + \".txt\"\n",
"sbml_file = home + \"LogicModelMerger/Models/\" + model_name + \".sbml\""
]
},
{
Expand Down Expand Up @@ -610,8 +615,7 @@
}
],
"source": [
"model_name = \"Ikonomi2020\"\n",
"ikonomi = biolqm.load(\"../../Models/\" + model_name + \".sbml\")\n",
"ikonomi = biolqm.load(sbml_file)\n",
"ikonomi_lrg = biolqm.to_ginsim(ikonomi)\n",
"ginsim.show(ikonomi_lrg)"
]
Expand Down Expand Up @@ -1076,7 +1080,7 @@
}
],
"source": [
"net = boolnet.loadNetwork(\"../../Models/\" + model_name + \".txt\")\n",
"net = boolnet.loadNetwork(txt_file)\n",
"attr = boolnet.getAttractors(net)\n",
"print(attr)"
]
Expand Down Expand Up @@ -1364,7 +1368,7 @@
"\n",
"df = df.T\n",
"df.index = df.index.str.replace('Attr', 'S')\n",
"df.to_csv('../../SimulationResults/attr_' + model_name + '.csv')\n",
"df.to_csv(home + 'LogicModelMerger/SimulationResults/attr_' + model_name + '.csv')\n",
"df"
]
},
Expand Down
7 changes: 4 additions & 3 deletions Reproducing selected models/Krumsiek2011/Krumsiek2011.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,10 @@
"import matplotlib.pyplot as plt\n",
"from matplotlib.colors import ListedColormap\n",
"\n",
"home = \"persistent/\" # home path for Logic Model Merger\n",
"model_name = \"Krumsiek2011\"\n",
"txt_file = \"../../Models\" + model_name + \".txt\"\n",
"sbml_file = \"../../Models\" + model_name + \".sbml\""
"txt_file = home + \"LogicModelMerger/Models/\" + model_name + \".txt\"\n",
"sbml_file = home + \"LogicModelMerger/Models/\" + model_name + \".sbml\""
]
},
{
Expand Down Expand Up @@ -746,7 +747,7 @@
"source": [
"df = df.T\n",
"df.index = df.index.str.replace('Attr', 'S')\n",
"df.to_csv('../../SimulationResults/attr_' + model_name + '.csv')"
"df.to_csv(home + 'LogicModelMerger/SimulationResults/attr_' + model_name + '.csv')"
]
},
{
Expand Down
100 changes: 13 additions & 87 deletions Reproducing selected models/Latini2023/Latini2023.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,16 @@
"from itertools import combinations # for iterating over sets\n",
"import matplotlib.pyplot as plt # for modifying plots\n",
"import seaborn as sns # for heatmap visualization\n",
"#import pyboolnet # for reproduce the original results"
"#import pyboolnet # for reproduce the original results\n",
"\n",
"home = \"persistent/\" # home path for Logic Model Merger\n",
"model_name_TKD = \"Latini2023_TKD\"\n",
"txt_file_TKD = home + \"LogicModelMerger/Models/\" + model_name_TKD + \".txt\"\n",
"sbml_file_TKD = home + \"LogicModelMerger/Models/\" + model_name_TKD + \".sbml\"\n",
"\n",
"model_name_JMD = \"Latini2023_JMD\"\n",
"txt_file_JMD = home + \"LogicModelMerger/Models/\" + model_name_JMD + \".txt\"\n",
"sbml_file_JMD = home + \"LogicModelMerger/Models/\" + model_name_JMD + \".sbml\""
]
},
{
Expand Down Expand Up @@ -621,7 +630,7 @@
],
"source": [
"# Load the data\n",
"JMD_lqm = biolqm.load(\"Latini2023_JMD.sbml\")\n",
"JMD_lqm = biolqm.load(sbml_file_JMD)\n",
"\n",
"# Use the GinSIM package to visualize it\n",
"JMD_lrg = biolqm.to_ginsim(JMD_lqm)\n",
Expand All @@ -648,7 +657,7 @@
}
],
"source": [
"TKD_lqm = biolqm.load(\"Latini2023_TKD.sbml\")\n",
"TKD_lqm = biolqm.load(sbml_file_TKD)\n",
"TKD_lrg = biolqm.to_ginsim(TKD_lqm)\n",
"ginsim.show(TKD_lrg)"
]
Expand Down Expand Up @@ -922,7 +931,7 @@
],
"source": [
"# Read the apoptosis and proliferation data generated by ProxPath\n",
"apoptosis_df = pd.read_csv('paths_to_apoptosis_proliferation.txt', sep='\\t')\n",
"apoptosis_df = pd.read_csv(home+'LogicModelMerger/Data/ProxPath/paths_to_apoptosis_proliferation.txt', sep='\\t')\n",
"apoptosis_df['node'] = apoptosis_df['QueryNode'].str.replace('/', '_')\n",
"apoptosis_df = apoptosis_df[['node', 'EndNode', 'Final_Effect']].rename(columns={'EndNode': 'phenotype', 'Final_Effect': 'apoptosis'})\n",
"apoptosis_df.head()"
Expand Down Expand Up @@ -1130,96 +1139,13 @@
"Next, the authors have simulated the levels of apoptosis and proliferation, upon combinatorial knockout of FLT3 and one of the following key druggable kinases: ERK1/2, MEK1/2, GSK3A/B, IGF1R, JNK, KRAS, MEK1/2, mTOR, PDPK1, PI3K, p38, to predict novel combinatorial treatments reverting drug resistance of FLT3-ITD cells. Since the same strategy was used in this section, the results should also be identical and thus are skipped here. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Clinical outcomes\n",
"Using the same strategy as in [Palma 2021](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7916657/), I next compare the phenotype scores with clinical features derived from the AML TGCA dataset. Specifically, the mutation-specific peripheral blood (PB) and bone marrow (BM) blast percentages with the predictions of our models.\n",
"\n",
"The integrated network score is calculated by substracting the proliferation score by the apoptosis score. \n",
" \n",
"Mutation and clinical data are downloaded from the [NIH GDC website](https://gdc.cancer.gov/about-data/publications/laml_2012):\n",
"1. [Supplemental Table 06: All somatic mutations with annotation and readcounts from DNA and RNA sequencing](SupplementalTable06.tsv)\n",
"2. [Patient Clinical Data](https://portal.gdc.cancer.gov/files/c07a64a0-7588-4653-95ef-982b41a1a804?aeTable_offset=20)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Data file path\n",
"tsv_file_path_genes = 'SupplementalTable06.tsv'\n",
"tsv_file_path_clinical = 'nationwidechildrens.org_clinical_patient_laml.txt'\n",
"\n",
"# Mutation data\n",
"df_genes = pd.read_csv(tsv_file_path_genes, sep='\\t', usecols=['TCGA_id', 'gene_name'])\n",
"\n",
"# clinical data \n",
"df_clinical = pd.read_csv(tsv_file_path_clinical, sep='\\t', usecols=['bcr_patient_barcode', \n",
" 'blast_count',\n",
" 'percent_blasts_peripheral_blood'])\n"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'JMD_PROLIFERATION': {'tumor': 4, 'FLT3i': 2},\n",
" 'TKD_PROLIFERATION': {'tumor': 3, 'FLT3i': 3},\n",
" 'JMD_APOPTOSIS': {'tumor': -2, 'FLT3i': 0},\n",
" 'TKD_APOPTOSIS': {'tumor': -2, 'FLT3i': -2}}"
]
},
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"results"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"dict"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"type(results)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Conclusion\n",
"**Results from the Latini et al. 2023 paper are reproducible, and identical results could be generated using different platforms (Python versus R).** \n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
Loading

0 comments on commit b804643

Please sign in to comment.