{ "cells": [ { "cell_type": "markdown", "id": "63655531-ed94-40be-8dda-2c56a64390ca", "metadata": {}, "source": [ "# Pulling Template/Predictor " ] }, { "cell_type": "code", "execution_count": 1, "id": "76825840-094c-4a84-b29b-a9178378e501", "metadata": {}, "outputs": [], "source": [ "import modelseedpy" ] }, { "cell_type": "code", "execution_count": 2, "id": "c608799e-484b-48e7-8ba4-a9aa4e5dce7d", "metadata": {}, "outputs": [], "source": [ "from modelseedpy.helpers import get_classifier, get_template, get_file" ] }, { "cell_type": "code", "execution_count": 3, "id": "56a998d6-d2e6-4eec-bad4-7e3dd81796b6", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'/usr/local/lib/python3.8/site-packages/modelseedpy//data/ml/knn_filter_features.json'" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "get_file('template_core.json', 'data', 'template_folder')\n", "get_file('template_gram_neg.json', 'data', 'template_folder')\n", "get_file('template_gram_pos.json', 'data', 'template_folder')\n", "get_file('knn_filter.pickle', 'data', 'classifier_folder')\n", "get_file('knn_filter_features.json', 'data', 'classifier_folder')" ] }, { "cell_type": "markdown", "id": "91b47516-0120-47ef-9933-725a10410d50", "metadata": {}, "source": [ "### load classifier\n", "options\n", "* knn_filter" ] }, { "cell_type": "code", "execution_count": 4, "id": "7959ee2b-1520-43ac-b791-815861b0a63c", "metadata": {}, "outputs": [], "source": [ "genome_cls = get_classifier('knn_filter')" ] }, { "cell_type": "markdown", "id": "1db81e21-97c7-4373-8173-33218abd8caf", "metadata": {}, "source": [ "### load template\n", "options\n", "* template_core\n", "* template_gram_neg\n", "* template_gram_pos" ] }, { "cell_type": "code", "execution_count": 5, "id": "90b7bb44-d639-44ea-8f9d-482e31a95f03", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'CoreModelTemplateV2'" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "core_template = get_template('template_core')\n", "core_template['id']" ] }, { "cell_type": "code", "execution_count": 7, "id": "9bd57712-b46d-49d3-9182-ae3016245fff", "metadata": {}, "outputs": [], "source": [ "from modelseedpy.core.mstemplate import MSTemplateBuilder\n", "template = MSTemplateBuilder.from_dict(core_template).build()" ] }, { "cell_type": "code", "execution_count": 8, "id": "8dd8aa70-11cf-43a7-9b0f-bf865b7a8b3d", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
IDCoreModelTemplateV2
Memory address0x07ff7918e46d0
Number of metabolites161
Number of species187
Number of reactions197
Number of biomasses2
Number of roles20552
Number of complexes9423
" ], "text/plain": [ "" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "template" ] }, { "cell_type": "code", "execution_count": 13, "id": "ea2265a0-342c-4f1b-b0d0-991c9cf74f6e", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Reaction identifierrxn01975_c
Namebeta-D-Glucose-6-phosphate:NADP+ 1-oxoreductase
Memory address0x07ff790433310
Stoichiometry\n", "

cpd00006_c + cpd00863_c --> cpd00005_c + cpd00067_c + cpd00911_c

\n", "

NADP + beta-D-Glucose 6-phosphate --> NADPH + H+ + 6-phospho-D-glucono-1-5-lactone

\n", "
GPRcpx00354 or cpx30278
Lower bound0
Upper bound1000
\n", " " ], "text/plain": [ "" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "template_reaction = template.reactions[0]\n", "template_reaction" ] }, { "cell_type": "code", "execution_count": 14, "id": "7616ea40-6e7a-4644-98c2-3c28266c6655", "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Reaction identifierrxn01975_c0
Namebeta-D-Glucose-6-phosphate:NADP+ 1-oxoreductase [c0]
Memory address0x07ff7901ef220
Stoichiometry\n", "

cpd00006_c0 + cpd00863_c0 --> cpd00005_c0 + cpd00067_c0 + cpd00911_c0

\n", "

NADP [c0] + beta-D-Glucose 6-phosphate [c0] --> NADPH [c0] + H+ [c0] + 6-phospho-D-glucono-1-5-lactone [c0]

\n", "
GPR
Lower bound0
Upper bound1000
\n", " " ], "text/plain": [ "" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "template_reaction.to_reaction()" ] }, { "cell_type": "code", "execution_count": null, "id": "38b051f9-b068-4c2e-945a-14d47c53d3e0", "metadata": {}, "outputs": [], "source": [] } ], "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.9.12" } }, "nbformat": 4, "nbformat_minor": 5 }