diff --git a/Composing models/Merge logical models.ipynb b/Composing models/Merge logical models.ipynb index 7736351..1401d47 100644 --- a/Composing models/Merge logical models.ipynb +++ b/Composing models/Merge logical models.ipynb @@ -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\"" ] }, { @@ -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", @@ -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" ] } ], diff --git a/Data/significant_paths_to_phenotypes.txt b/Data/ProxPath/significant_paths_to_phenotypes.txt similarity index 100% rename from Data/significant_paths_to_phenotypes.txt rename to Data/ProxPath/significant_paths_to_phenotypes.txt diff --git a/Evaluating the merged model/Helper functions.ipynb b/Evaluating the merged model/Helper functions.ipynb new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md index fb66373..7f881a4 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,14 @@ ## 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 @@ -17,29 +17,30 @@ The workflow presented in this repository involves sequential steps: 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. @@ -54,7 +55,7 @@ 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. @@ -62,6 +63,8 @@ This repository is organized according to the workflow described in the manuscri ### 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/). diff --git a/Reproducing selected models/Bonzanni2013/Bonzanni2013.ipynb b/Reproducing selected models/Bonzanni2013/Bonzanni2013.ipynb index df49082..b982602 100644 --- a/Reproducing selected models/Bonzanni2013/Bonzanni2013.ipynb +++ b/Reproducing selected models/Bonzanni2013/Bonzanni2013.ipynb @@ -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\"" ] }, { @@ -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" ] }, @@ -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" ] }, diff --git a/Reproducing selected models/Ikonomi2020/Ikonomi2020.ipynb b/Reproducing selected models/Ikonomi2020/Ikonomi2020.ipynb index aae3fb2..0a67496 100644 --- a/Reproducing selected models/Ikonomi2020/Ikonomi2020.ipynb +++ b/Reproducing selected models/Ikonomi2020/Ikonomi2020.ipynb @@ -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\"" ] }, { @@ -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)" ] @@ -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)" ] @@ -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" ] }, diff --git a/Reproducing selected models/Krumsiek2011/Krumsiek2011.ipynb b/Reproducing selected models/Krumsiek2011/Krumsiek2011.ipynb index 7b39f90..cb68884 100644 --- a/Reproducing selected models/Krumsiek2011/Krumsiek2011.ipynb +++ b/Reproducing selected models/Krumsiek2011/Krumsiek2011.ipynb @@ -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\"" ] }, { @@ -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')" ] }, { diff --git a/Reproducing selected models/Latini2023/Latini2023.ipynb b/Reproducing selected models/Latini2023/Latini2023.ipynb index ebf87eb..d173c36 100644 --- a/Reproducing selected models/Latini2023/Latini2023.ipynb +++ b/Reproducing selected models/Latini2023/Latini2023.ipynb @@ -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\"" ] }, { @@ -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", @@ -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)" ] @@ -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()" @@ -1130,82 +1139,6 @@ "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": {}, @@ -1213,13 +1146,6 @@ "## 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": { diff --git a/Reproducing selected models/Palma2021.ipynb b/Reproducing selected models/Palma2021/Palma2021.ipynb similarity index 99% rename from Reproducing selected models/Palma2021.ipynb rename to Reproducing selected models/Palma2021/Palma2021.ipynb index 50da594..a2b2562 100644 --- a/Reproducing selected models/Palma2021.ipynb +++ b/Reproducing selected models/Palma2021/Palma2021.ipynb @@ -579,7 +579,12 @@ "from rpy2.robjects import pandas2ri\n", "boolnet = importr(\"BoolNet\")\n", "import seaborn as sns\n", - "from matplotlib.colors import ListedColormap" + "from matplotlib.colors import ListedColormap\n", + "\n", + "home = \"persistent/\" # home path for Logic Model Merger\n", + "model_name = \"Palma2021\"\n", + "txt_file = home + \"LogicModelMerger/Models/\" + model_name + \".txt\"\n", + "sbml_file = home + \"LogicModelMerger/Models/\" + model_name + \".sbml\"" ] }, { @@ -633,7 +638,7 @@ ], "source": [ "# import the model with no phenotype node (to calculate later)\n", - "palma_lqm = biolqm.load(\"../../Models/Palma2021.sbml\")\n", + "palma_lqm = biolqm.load(sbml_file)\n", "\n", "# visualize\n", "palma_lrg = biolqm.to_ginsim(palma_lqm)\n", @@ -1090,7 +1095,7 @@ "outputs": [], "source": [ "# Import the the mutation-specific hazard ratios provided by Papaemmanuil et al.\n", - "hazard_ratio = pd.read_csv('../../Data/AMLSG/Hazard Ratio for Death.csv')\n", + "hazard_ratio = pd.read_csv(home + \"LogicModelMerger/Data/AMLSG/Hazard Ratio for Death.csv\")\n", "hazard_ratio.index = ['Hazard_ratio']\n", "results = pd.concat([hazard_ratio,results])" ] diff --git a/Standardizing and annotating models/Convert model in text file to SBML-qual.ipynb b/Standardizing and annotating models/Convert model in text file to SBML-qual.ipynb index e2258d1..5051956 100644 --- a/Standardizing and annotating models/Convert model in text file to SBML-qual.ipynb +++ b/Standardizing and annotating models/Convert model in text file to SBML-qual.ipynb @@ -39,9 +39,10 @@ "metadata": {}, "outputs": [], "source": [ + "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\"" ] }, { @@ -73,17 +74,6 @@ "HHEX = (FLI1 | ERG | (TAL1 & GATA2))\n", "\n" ] - }, - { - "ename": "", - "evalue": "", - "output_type": "error", - "traceback": [ - "\u001b[1;31mThe Kernel crashed while executing code in the current cell or a previous cell. \n", - "\u001b[1;31mPlease review the code in the cell(s) to identify a possible cause of the failure. \n", - "\u001b[1;31mClick here for more info. \n", - "\u001b[1;31mView Jupyter log for further details." - ] } ], "source": [ @@ -148,7 +138,7 @@ } ], "source": [ - "folder_path = \"persistent/Models/Updated/\"\n", + "folder_path = home + \"LogicModelMerger/Models/\"\n", "num_models_converted = 0\n", "for file in os.listdir(folder_path):\n", " if file.endswith(\".txt\"):\n", diff --git a/Standardizing and annotating models/Ikonomi2020_hgnc_results_checked.csv b/Standardizing and annotating models/Output/Ikonomi2020_hgnc_results_checked.csv similarity index 100% rename from Standardizing and annotating models/Ikonomi2020_hgnc_results_checked.csv rename to Standardizing and annotating models/Output/Ikonomi2020_hgnc_results_checked.csv diff --git a/Standardizing and annotating models/Latini2023_JMD_hgnc_results_checked.csv b/Standardizing and annotating models/Output/Latini2023_JMD_hgnc_results_checked.csv similarity index 100% rename from Standardizing and annotating models/Latini2023_JMD_hgnc_results_checked.csv rename to Standardizing and annotating models/Output/Latini2023_JMD_hgnc_results_checked.csv diff --git a/Standardizing and annotating models/Latini2023_TKD_hgnc_results.csv b/Standardizing and annotating models/Output/Latini2023_TKD_hgnc_results.csv similarity index 100% rename from Standardizing and annotating models/Latini2023_TKD_hgnc_results.csv rename to Standardizing and annotating models/Output/Latini2023_TKD_hgnc_results.csv diff --git a/Standardizing and annotating models/class_Palma2021_Ikonomi2020.csv b/Standardizing and annotating models/Output/class_Palma2021_Ikonomi2020.csv similarity index 100% rename from Standardizing and annotating models/class_Palma2021_Ikonomi2020.csv rename to Standardizing and annotating models/Output/class_Palma2021_Ikonomi2020.csv diff --git a/Standardizing and annotating models/Standardize gene names to HGNC symbol.ipynb b/Standardizing and annotating models/Standardize gene names to HGNC symbol.ipynb index e93b4c1..2e2ebca 100644 --- a/Standardizing and annotating models/Standardize gene names to HGNC symbol.ipynb +++ b/Standardizing and annotating models/Standardize gene names to HGNC symbol.ipynb @@ -26,7 +26,10 @@ "metadata": {}, "outputs": [], "source": [ - "model_name = \"Ikonomi2020\"" + "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\"" ] }, { @@ -691,7 +694,7 @@ ], "source": [ "# Load the data\n", - "model = biolqm.load(\"../Models/\" + model_name + \".sbml\")\n", + "model = biolqm.load(sbml_file)\n", "\n", "# Use the GinSIM package to visualize it\n", "model_lrg = biolqm.to_ginsim(model)\n", @@ -1406,7 +1409,8 @@ "print(hgnc_df)\n", "\n", "# Save this data to a file\n", - "hgnc_df.to_csv(model_name + \"_hgnc_results.csv\", index=False)" + "output_path = home + \"LogicModelMerger/Standardizing and annotating models/Output/\" + model_name + \"_hgnc_results.csv\"\n", + "hgnc_df.to_csv(output_path, index=False)" ] }, { @@ -1429,13 +1433,13 @@ "outputs": [], "source": [ "# Read the revised csv file\n", - "hgnc_df = pd.read_csv(model_name + \"_hgnc_results_checked.csv\")\n", + "hgnc_df = pd.read_csv(output_path)\n", "\n", "# Create a name mapping dictionary from the reviewed data\n", "name_mapping = {row['original_gene']: row['symbol'] for _, row in hgnc_df.iterrows() if 'symbol' in row}\n", "\n", "# Read the SBML file as text\n", - "with open(\"../Models/\" + model_name + \".sbml\", \"r\") as file:\n", + "with open(sbml_file, \"r\") as file:\n", " sbml_content = file.read()\n", "\n", "# Replace gene names based on the mapping\n", @@ -1443,7 +1447,8 @@ " sbml_content = sbml_content.replace(original_name, new_symbol)\n", "\n", "# Write the modified content to a new file\n", - "with open(\"../Models/\" + model_name + \"_updated.sbml\", \"w\") as file:\n", + "new_sbml_file = home + \"LogicModelMerger/Models/\" + model_name + \"_updated.sbml\"\n", + "with open(new_sbml_file, \"w\") as file:\n", " file.write(sbml_content)" ] }, @@ -1469,7 +1474,7 @@ ], "source": [ "# Visualize it\n", - "updated_model = biolqm.load(\"../Models/\" + model_name + \"_updated.sbml\")\n", + "updated_model = biolqm.load(new_sbml_file)\n", "updated_model_lrg = biolqm.to_ginsim(updated_model)\n", "ginsim.show(updated_model_lrg)" ]