{ "cells": [ { "cell_type": "markdown", "id": "1982c8ef-670b-4418-b346-00dfba8d0f76", "metadata": {}, "source": [ "# Getting started" ] }, { "cell_type": "markdown", "id": "fea21fff-173c-40f9-8919-ccb8b501bf4e", "metadata": {}, "source": [ "## Reconstruct with coralME\n", "\n", "Here we show an example to reconstruct a dME-model of *B. subtilis*." ] }, { "cell_type": "markdown", "id": "cc93ed2c-c978-45fa-ae0e-731c7f10e7dd", "metadata": {}, "source": [ "### Import packages" ] }, { "cell_type": "code", "execution_count": 1, "id": "968eedc7-c1ce-4b5a-ae06-1daf3f39a109", "metadata": {}, "outputs": [], "source": [ "from coralme.builder.main import MEBuilder\n", "from importlib.resources import files" ] }, { "cell_type": "markdown", "id": "be6449ec-ddc0-42b3-b49d-cf5e6b8ef12d", "metadata": {}, "source": [ "### Define path to inputs" ] }, { "cell_type": "markdown", "id": "7172b5e8-6fc5-4a88-a6cd-69a12d3b5ee9", "metadata": {}, "source": [ "Define the paths to inputs and desired outputs. For more information about these files see [Description of inputs](BasicInputs.ipynb)." ] }, { "cell_type": "code", "execution_count": 2, "id": "2e0e9e63-c7f1-4a69-8478-7ffe71c6bf07", "metadata": {}, "outputs": [], "source": [ "input = {\n", " # Inputs\n", " \"m-model-path\": \"./helper_files/inputs/m_model.json\", # Path to model file\n", " \"genbank-path\": \"./helper_files/inputs/genome.gb\", # Path to genome genbank file\n", "\n", " # Outputs\n", " \"df_gene_cplxs_mods_rxns\": \"./helper_files/building_data/OSM.xlsx\", # Desired output path of OSM\n", " \"out_directory\": \"./helper_files/\", # Output directory\n", " \"log_directory\": \"./helper_files/\", # Log directory\n", " \"locus_tag\": \"old_locus_tag\", # What IDs were used in the M-model? e.g. locus_tag, old_locus_tag\n", " \"ME-Model-ID\" : \"EXAMPLE-BACILLUS-ME\" # Name of the ME-model\n", "}" ] }, { "cell_type": "markdown", "id": "5ec56049-90aa-40c6-bb71-10b52740e415", "metadata": {}, "source": [ "Load organism setup. For now we can use the minimal setup with biological numbers from E. coli." ] }, { "cell_type": "code", "execution_count": 3, "id": "3c40401d-8820-4405-88a3-847f97907c10", "metadata": {}, "outputs": [], "source": [ "organism = str(files(\"coralme\") / \"iJL1678b\") + \"-ME/minimal-organism.json\"" ] }, { "cell_type": "markdown", "id": "38fdfacb-e080-4d08-abe1-f563e963c394", "metadata": {}, "source": [ "### Create builder" ] }, { "cell_type": "markdown", "id": "44c364d3-92aa-4b43-8571-a55d7e42bf0e", "metadata": {}, "source": [ "For more information about this class see [Architecture of coralME](coralMEArchitecture.ipynb)" ] }, { "cell_type": "code", "execution_count": 4, "id": "f04001c0-8b9b-41fa-9a17-55ca6006af41", "metadata": { "ExecuteTime": { "end_time": "2022-12-12T06:30:28.060280Z", "start_time": "2022-12-12T06:30:01.706785Z" }, "scrolled": true, "tags": [] }, "outputs": [], "source": [ "builder = MEBuilder(*[organism], **input)" ] }, { "cell_type": "markdown", "id": "91ed12aa-2dbc-4808-9f5c-38486450860d", "metadata": {}, "source": [ "### Generate files" ] }, { "cell_type": "markdown", "id": "c93557b6-b8bb-4a45-8e88-3470520413d8", "metadata": {}, "source": [ "This corresponds to _Synchronyze_ and _Complement_ steps in [Architecture of coralME](coralMEArchitecture.ipynb)" ] }, { "cell_type": "code", "execution_count": 5, "id": "17b488c8-822e-4598-a72e-33367294b3b2", "metadata": { "scrolled": true, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Initiating file processing...\n", "~ Processing files for EXAMPLE-BACILLUS-ME...\n", "Set parameter Username\n", "Academic license - for non-commercial use only - expires 2025-09-03\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Checking M-model metabolites... : 100.0%|██████████| 990/ 990 [00:00<00:00]\n", "Checking M-model genes... : 100.0%|██████████| 844/ 844 [00:00<00:00]\n", "Checking M-model reactions... : 100.0%|██████████| 1250/ 1250 [00:00<00:00]\n", "Syncing optional genes file... : 0.0%| | 0/ 0 [00:00" ] }, { "cell_type": "markdown", "id": "529527be-a1fa-4750-b0db-a625961985c7", "metadata": {}, "source": [ "## Curate manually" ] }, { "cell_type": "markdown", "id": "539e4555-603c-4226-ac26-8d928a506cc4", "metadata": {}, "source": [ "1. __Copy__ all of the generated _reference files_ in building_data/reference_files and replace accordingly in building_data/\n", "\n", "2. __Go one by one__ through the files in building_data/ curating as needed! Important flags are risen in curation_notes.json to further guide you through curation.\n", "\n", "3. Everytime you make a change, __run the model through the troubleshooter!__ It will show you remaining gaps to look at, and the new curation notes might show new warnings.\n", "\n", "4. __Keep iterating!__ You will have finished when no gaps are present, and all remaining warnings in curation notes are irrelevant." ] } ], "metadata": { "kernelspec": { "display_name": "coralme-dev", "language": "python", "name": "coralme-dev" }, "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.10.12" } }, "nbformat": 4, "nbformat_minor": 5 }