Skip to content

Commit

Permalink
Updated Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
JR-1991 committed Mar 20, 2022
1 parent 343e06c commit 4f9e9a3
Show file tree
Hide file tree
Showing 7 changed files with 191 additions and 77 deletions.
2 changes: 1 addition & 1 deletion docs/_examples/01_KineticModeling_PySCeS.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"id": "67d1ee98-ca30-46d8-88ed-5d316b59d3f2",
"metadata": {},
"source": [
"## Scenario 5: Modeling a reaction by mass action cascades using PySCeS\n",
"# Modeling a reaction by mass action cascades using PySCeS\n",
"\n",
"This notebook is part of the publication \"EnzymeML at Work\" from Lauterbach et al. 2022 and adds a given micro-kinetic model to an EnzymeML document. Prior to this, experimental data was collected using the EnzymeML spreadsheet and converted to EnzymeML. The following notebook adresses the following key procedures using PyEnzyme:\n",
"\n",
Expand Down
100 changes: 42 additions & 58 deletions docs/_getstarted/01_BasicUsage.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"id": "515b1663-1f09-4085-ade9-bacd0fcbcb74",
"metadata": {},
"source": [
"## Initializing an EnzymeML document\n",
"# Setting up an EnzymeML document\n",
"\n",
"In order to write an EnzymeML document it needs to be initialized by calling the ```EnzymeMLDocument``` object. At this point it is possible to add metadata such as a name, URL, DOI or PubmedID to the document. In addition, it is necessary but not mandatory to add author information. Please note, that for a Dataverse upload adding an author is mandatory though.\n",
"\n",
Expand Down Expand Up @@ -99,7 +99,7 @@
"id": "b1293c5f-00f6-482a-85b8-fc3f1977060c",
"metadata": {},
"source": [
"### Vessels\n",
"__Vessels__\n",
"\n",
"- ```Vessel``` carries the metadata for vessels that are used.\n",
"- ```addVessel``` adds a ```Vessel``` object to the document and returns the ID."
Expand All @@ -121,7 +121,7 @@
"id": "3288f19a-56ca-4d33-bf71-ebf91fa9a49f",
"metadata": {},
"source": [
"### Proteins\n",
"__Proteins__\n",
"\n",
"- ```Protein``` carries the metadata for proteins that are part of the experiment.\n",
"- ```addProtein``` adds a ```Protein``` object to the document and returns the ID."
Expand All @@ -134,7 +134,9 @@
"metadata": {},
"outputs": [],
"source": [
"enzyme = pe.Protein(name=\"Enzyme\", vessel_id=vessel_id, sequence=\"MAVKLT\", constant=False)\n",
"enzyme = pe.Protein(name=\"Enzyme\", vessel_id=vessel_id,\n",
" sequence=\"MAVKLT\", constant=False)\n",
"\n",
"enzyme_id = enzmldoc.addProtein(enzyme)"
]
},
Expand All @@ -143,7 +145,7 @@
"id": "e6dc7af3-f9b5-4a26-8cee-d6da1da662c9",
"metadata": {},
"source": [
"### Reactants\n",
"__Reactants__\n",
"\n",
"- ```Reactant``` carries the metadata for reactants that are part of the experiment.\n",
"- ```addReactant``` adds a ```Reactant``` object to the document and returns the ID."
Expand Down Expand Up @@ -176,7 +178,7 @@
"id": "2548347a-2ea9-483e-b4b0-93872a368f08",
"metadata": {},
"source": [
"### Complexes\n",
"__Complexes__\n",
"\n",
"- ```Complex``` carries the metadata for complexes that are part of the experiment.\n",
"- ```addComplex``` adds a ```Complex``` object to the document and returns the ID."
Expand Down Expand Up @@ -279,9 +281,14 @@
"reaction_1 = pe.EnzymeReaction(name=\"reaction-1\", reversible=True)\n",
"\n",
"# Add each element\n",
"reaction_1.addEduct(species_id=substrate_id, stoichiometry=1.0, enzmldoc=enzmldoc)\n",
"reaction_1.addEduct(species_id=enzyme_id, stoichiometry=1.0, enzmldoc=enzmldoc)\n",
"reaction_1.addProduct(species_id=product_id, stoichiometry=1.0, enzmldoc=enzmldoc)"
"reaction_1.addEduct(species_id=substrate_id, stoichiometry=1.0, \n",
" enzmldoc=enzmldoc)\n",
"\n",
"reaction_1.addEduct(species_id=enzyme_id, stoichiometry=1.0,\n",
" enzmldoc=enzmldoc)\n",
"\n",
"reaction_1.addProduct(species_id=product_id, stoichiometry=1.0,\n",
" enzmldoc=enzmldoc)"
]
},
{
Expand Down Expand Up @@ -352,7 +359,7 @@
"id": "21624256-889c-4a3a-ba57-d2d5df19fb12",
"metadata": {},
"source": [
"### Measurement 1: 'Run 1'\n",
"__Measurement 1: 'Run 1'__\n",
"\n",
"- ```Measurement``` carries the metadata for measurements that are conducted in the experiment.\n",
"- ```addData``` appends measurement data to the ```Measurement``` object and checks consistency."
Expand All @@ -371,9 +378,14 @@
")\n",
"\n",
"# Add each entity that will be measured\n",
"measurement_1.addData(reactant_id=substrate_id, init_conc=10.0, unit=\"mmole / l\")\n",
"measurement_1.addData(reactant_id=product_id, unit=\"mmole / l\")\n",
"measurement_1.addData(protein_id=enzyme_id, init_conc=20.0, unit=\"fmole / l\")\n",
"measurement_1.addData(reactant_id=substrate_id,\n",
" init_conc=10.0, unit=\"mmole / l\")\n",
"\n",
"measurement_1.addData(reactant_id=product_id,\n",
" unit=\"mmole / l\")\n",
"\n",
"measurement_1.addData(protein_id=enzyme_id, init_conc=20.0,\n",
" unit=\"fmole / l\")\n",
"\n",
"# Add it to the EnzymeML document\n",
"meas_1_id = enzmldoc.addMeasurement(measurement_1)"
Expand All @@ -384,7 +396,7 @@
"id": "e7707c8a-5d04-4e53-92cf-d8c45e29c935",
"metadata": {},
"source": [
"### Measurement 2: 'Run 2'\n",
"__Measurement 2: 'Run 2'__\n",
"\n",
"- ```Measurement``` carries the metadata for measurements that are conducted in the experiment.\n",
"- ```addData``` appends measurement data to the ```Measurement``` object and checks consistency."
Expand All @@ -403,9 +415,14 @@
")\n",
"\n",
"# Add each entity that will be measured\n",
"measurement_2.addData(reactant_id=substrate_id, init_conc=100.0, unit=\"mmole / l\")\n",
"measurement_2.addData(reactant_id=product_id, unit=\"mmole / l\")\n",
"measurement_2.addData(protein_id=enzyme_id, init_conc=40.0, unit=\"fmole / l\")\n",
"measurement_2.addData(reactant_id=substrate_id,\n",
" init_conc=100.0, unit=\"mmole / l\")\n",
"\n",
"measurement_2.addData(reactant_id=product_id,\n",
" unit=\"mmole / l\")\n",
"\n",
"measurement_2.addData(protein_id=enzyme_id,\n",
" init_conc=40.0, unit=\"fmole / l\")\n",
"\n",
"# Add it to the EnzymeML document\n",
"meas_2_id = enzmldoc.addMeasurement(measurement_2)"
Expand Down Expand Up @@ -463,7 +480,7 @@
"id": "bfe87c90-2c79-4daf-a99c-f302d37f2adc",
"metadata": {},
"source": [
"### Data for 'Run 1'\n",
"__Data for 'Run 1'__\n",
"\n",
"- ```Replicate``` carries the tim-courses and metadata for each measured entity.\n",
"- ```addReplicates``` adds ```Replicate``` objects to a measurement to the corresponding ```MeasurementData``` container where the concentrations are also stored."
Expand Down Expand Up @@ -512,7 +529,7 @@
"id": "e7602d58-29a3-4a8a-93bf-40bedc1f82bb",
"metadata": {},
"source": [
"### Data for 'Run 2'\n",
"__Data for 'Run 2'__\n",
"\n",
"- ```Replicate``` carries the tim-courses and metadata for each measured entity.\n",
"- ```addReplicates``` adds ```Replicate``` objects to a measurement to the corresponding ```MeasurementData``` container where the concentrations are also stored."
Expand Down Expand Up @@ -581,7 +598,7 @@
"id": "1b5a7d92-f997-4c17-817e-64f1427f6466",
"metadata": {},
"source": [
"### Export\n",
"__Export__\n",
"\n",
"- ```toFile``` writes the EnzymeML document to an OMEX archive at the specified path.\n",
"- ```json``` converts the EnzymeML document to a JSON string, which in turn can be used for REST interfaces or data storage.\n",
Expand Down Expand Up @@ -621,7 +638,7 @@
"id": "5decfe8a-bb2d-460d-86c9-9e700162afb9",
"metadata": {},
"source": [
"### Upload\n",
"__Upload__\n",
"\n",
"- ```uploadToDataverse``` uploads the document to a Dataverse installation.\n",
"- Please note, that in order to work, your environment should contain these variables\n",
Expand Down Expand Up @@ -653,7 +670,7 @@
"id": "e99a7220-d586-44bc-8507-cef3ee1de231",
"metadata": {},
"source": [
"## Loading an EnzymeML document\n",
"# Loading and editing\n",
"\n",
"It is not expected to create an EnzymeML document in a single session, but to let it evolve over the course of an experiment. Thus it is necessary to load and edit an EnzymeML document, without re-creating everything from start. PyEnzyme's ```EnzymeMLDocument``` object offers an initialization method ```fromFile``` to edit an already existing document. In addition, it is also possible to use the aforementioned JSON \n",
"\n",
Expand Down Expand Up @@ -720,55 +737,22 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": null,
"id": "98715329-b341-4bfd-b749-1e2647f7fdd0",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Pyruvate Decarboxylation\n",
">>> Reactants\n",
"\tID: s0 \t Name: Pyruvate\n",
"\tID: s1 \t Name: Acetaldehyde\n",
"\tID: s2 \t Name: CO2\n",
">>> Proteins\n",
"\tID: p0 \t Name: Pyruvate decarboxylase isozyme 1\n",
">>> Complexes\n",
">>> Reactions\n",
"\tID: r0 \t Name: Pyruvate decarboxylation\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/opt/homebrew/Caskroom/miniforge/base/envs/enzymeml/lib/python3.9/site-packages/openpyxl/worksheet/_reader.py:315: UserWarning: Data Validation extension is not supported and will be removed\n",
" warn(msg)\n"
]
}
],
"outputs": [],
"source": [
"# Similar to the OMEX and JSON loaders, its a simple call\n",
"enzmldoc = pe.EnzymeMLDocument.fromTemplate(\"EnzymeML_Template_Example.xlsm\")\n",
"enzmldoc.printDocument()"
]
},
{
"cell_type": "markdown",
"id": "81201665-aebe-4db2-bbe1-de9f78edc8a2",
"metadata": {},
"source": [
"--------"
]
},
{
"cell_type": "markdown",
"id": "65b3a935-9b0d-4266-9aab-001f96241fe6",
"metadata": {},
"source": [
"## Editing EnzymeML: Kinetic Modeling\n",
"#### Adding a kinetic model\n",
"\n",
"Building on top of the previous section about loading an EnzymeML document, this example will demonstrate how to interact with an already created EnzymeML document using the OMEX loader. Since the purpose of an experiment is to generate data from a theory, modeling takes care of the interpretation of an experiment outcome. However, PyEnzyme and EnzymeML are no modeling platforms, but provides a convinient way to interface to such. Hence, this example will demonstrate how such an interfacing could look like.\n",
"\n",
Expand Down
7 changes: 4 additions & 3 deletions docs/_getstarted/My_Experiment.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,16 @@
"stoichiometry": 1.0,
"constant": false,
"ontology": "SBO:0000015"
},
}
],
"products": [
{
"species_id": "s1",
"stoichiometry": 1.0,
"constant": false,
"ontology": "SBO:0000015"
"ontology": "SBO:0000011"
}
],
"products": [],
"modifiers": []
},
"r1": {
Expand Down
Binary file modified docs/_getstarted/My_Experiment.omex
Binary file not shown.
19 changes: 10 additions & 9 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath('.'))

sys.path.insert(0, os.path.abspath("."))


# -- Project information -----------------------------------------------------

project = 'PyEnzyme'
copyright = '2021, Jan Range'
author = 'Jan Range'
project = "PyEnzyme"
copyright = "2022, Jan Range"
author = "Jan Range, Dr. Frank Bergmann, Prof. Dr. Johann Rohwer"

# The full version, including alpha/beta/rc tags
release = '1.2.0'
release = "1.1.3"


# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -52,22 +53,22 @@
autodoc_pydantic_settings_show_json = False

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]


# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
html_theme = "furo"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]

0 comments on commit 4f9e9a3

Please sign in to comment.