Skip to content

Commit

Permalink
[REFACTOR] Refactor all omics files.
Browse files Browse the repository at this point in the history
  • Loading branch information
ao60337 committed Jul 2, 2024
1 parent 0698b4a commit 7a4c60c
Show file tree
Hide file tree
Showing 16 changed files with 11,644 additions and 283,250 deletions.
Binary file added Phenotype_Prediction_I.zip
Binary file not shown.
Binary file added Phenotype_Prediction_II.zip
Binary file not shown.
74,571 changes: 0 additions & 74,571 deletions omics/MODEL1612130000_url.xml

This file was deleted.

2,919 changes: 0 additions & 2,919 deletions omics/S2M2 - hands-on omics - exercise 12 - solutions.ipynb

This file was deleted.

1,896 changes: 0 additions & 1,896 deletions omics/S2M2 - hands-on omics - exercise 12.ipynb

This file was deleted.

7,734 changes: 7,734 additions & 0 deletions omics/S2M2_Troppo_exercise_1.ipynb

Large diffs are not rendered by default.

234 changes: 234 additions & 0 deletions omics/S2M2_Troppo_exercise_2.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
{
"cells": [
{
"cell_type": "code",
"id": "890101d30cf1fe37",
"metadata": {},
"source": [
"import pandas as pd\n",
"import numpy as np\n",
"from math import log\n",
"import cobra\n",
"import re\n",
"\n",
"from troppo.omics.readers.generic import TabularReader\n",
"from troppo.methods_wrappers import ModelBasedWrapper, ReconstructionWrapper\n",
"from troppo.omics.integration import ContinuousScoreIntegrationStrategy, CustomSelectionIntegrationStrategy\n",
"from troppo.methods.reconstruction.gimme import GIMME, GIMMEProperties\n",
"from cobamp.utilities.parallel import batch_run\n",
"from copy import deepcopy\n"
],
"outputs": [],
"execution_count": null
},
{
"metadata": {},
"cell_type": "markdown",
"source": [
"# Exercise 2\n",
"\n",
"We have shown several types of omics data which can be used to reconstruct a tissue specific model. For this exercise, we will use the breast cancer cell lines present in the CCLE panel.\n",
"\n",
"a) Select the 'ACH-000019', 'ACH-000028', 'ACH-000349' samples. With them, reconstruct a tissue model for each with the FastCORE algorithm. Perform FBA and pFBA for all the 3 models reconstructed. Highlight the main differences between them."
],
"id": "f30b4781ac8ae8aa"
},
{
"cell_type": "markdown",
"id": "1a75f7d6a47fda8b",
"metadata": {},
"source": [
"Define the parsing rules for the GPRs that will be used later on."
]
},
{
"cell_type": "code",
"id": "47487d35d3894174",
"metadata": {},
"source": [
"patt = re.compile('__COBAMPGPRDOT__[0-9]{1}')\n",
"replace_alt_transcripts = lambda x: patt.sub('', x)"
],
"outputs": [],
"execution_count": null
},
{
"cell_type": "markdown",
"id": "b2fa56f4053f8b2c",
"metadata": {},
"source": [
"#### Read model and omics data\n",
"\n",
"You have to download the .csv file containing the gene expression for breast cancer cell lines present in the CCLE panel. The nomenclature has been normalized for what is found in the metabolic model of this exercise."
]
},
{
"metadata": {},
"cell_type": "code",
"source": [
"model = cobra.io.load_matlab_model('redHUMAN_recon2_smin.mat')\n",
"model"
],
"id": "85125e12e0ab2686",
"outputs": [],
"execution_count": null
},
{
"metadata": {},
"cell_type": "markdown",
"source": "",
"id": "c7a0871e44476be3"
},
{
"cell_type": "code",
"id": "57d953123b778a92",
"metadata": {},
"source": "omics_data = pd.read_csv('CCLE_breast_cancer_expression.csv', index_col=0) ",
"outputs": [],
"execution_count": null
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2024-07-02T16:44:13.703802Z",
"start_time": "2024-07-02T16:44:13.681248Z"
}
},
"cell_type": "code",
"source": "import cplex",
"id": "62d073cbb332e271",
"outputs": [
{
"ename": "ModuleNotFoundError",
"evalue": "No module named 'cplex'",
"output_type": "error",
"traceback": [
"\u001B[1;31m---------------------------------------------------------------------------\u001B[0m",
"\u001B[1;31mModuleNotFoundError\u001B[0m Traceback (most recent call last)",
"\u001B[1;32m~\\AppData\\Local\\Temp\\ipykernel_78348\\3947162218.py\u001B[0m in \u001B[0;36m<module>\u001B[1;34m\u001B[0m\n\u001B[1;32m----> 1\u001B[1;33m \u001B[1;32mimport\u001B[0m \u001B[0mcplex\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m",
"\u001B[1;31mModuleNotFoundError\u001B[0m: No module named 'cplex'"
]
}
],
"execution_count": 3
},
{
"metadata": {
"ExecuteTime": {
"end_time": "2024-07-02T16:43:27.099056Z",
"start_time": "2024-07-02T16:43:27.074057Z"
}
},
"cell_type": "code",
"source": "import docplex",
"id": "472bc35bf94e2634",
"outputs": [
{
"ename": "ModuleNotFoundError",
"evalue": "No module named 'docplex'",
"output_type": "error",
"traceback": [
"\u001B[1;31m---------------------------------------------------------------------------\u001B[0m",
"\u001B[1;31mModuleNotFoundError\u001B[0m Traceback (most recent call last)",
"\u001B[1;32m~\\AppData\\Local\\Temp\\ipykernel_78348\\2079162164.py\u001B[0m in \u001B[0;36m<module>\u001B[1;34m\u001B[0m\n\u001B[1;32m----> 1\u001B[1;33m \u001B[1;32mimport\u001B[0m \u001B[0mdocplex\u001B[0m\u001B[1;33m\u001B[0m\u001B[1;33m\u001B[0m\u001B[0m\n\u001B[0m",
"\u001B[1;31mModuleNotFoundError\u001B[0m: No module named 'docplex'"
]
}
],
"execution_count": 2
},
{
"metadata": {},
"cell_type": "code",
"source": "",
"id": "1e348470b486b94",
"outputs": [],
"execution_count": null
},
{
"metadata": {},
"cell_type": "markdown",
"source": [
"b) Try to reproduce the Warburg Effect (if already not present). Use the `escher` library to view the metabolic pathway.\n",
"\n",
"Hint: Change the uptake of the oxygen drain to a small value. Also, our model is the redHUMAN reconstruction based on Recon2. However, some of the reaction names overlap with Recon1 and so we will use the central carbon metabolism map for that model."
],
"id": "32cee16cd40a433b"
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": "",
"id": "220fa18772f76c56"
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": "",
"id": "833bb51ed0cdc61c"
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": "",
"id": "c63e8d83f4d5fece"
},
{
"metadata": {},
"cell_type": "markdown",
"source": "c) Select a random sample. Reconstruct 3 models using with different thresholds. What are the main differences?",
"id": "1ceef275964fbf9f"
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": "",
"id": "1b0551850e1a20f1"
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": "",
"id": "a3e61af13b4478f8"
},
{
"metadata": {},
"cell_type": "code",
"outputs": [],
"execution_count": null,
"source": "",
"id": "dd58ab00609fea3b"
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.13"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Binary file added omics/S2M2_Troppo_exercise_2.zip
Binary file not shown.
Loading

0 comments on commit 7a4c60c

Please sign in to comment.