Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions docs/guide/init.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,10 @@ prepData.mat: 159 MB
```

Human-GEM also has a wrapper, `prepHumanModelForftINIT`, which reads those
two files for you. It does **not** run against RAVEN `develop3`: its
`importTsvFile` returns the `spontaneous` column as text, so the `== 1`
inside it throws. Calling `prepINITModel` directly, as above, sidesteps that.
two files for you. Before Human-GEM 2.0.1 it did not run against RAVEN
`develop3`: `importTsvFile` returned the `spontaneous` column as text, so the
`== 1` inside it threw. From 2.0.1 on it converts the column first; with an
older Human-GEM, call `prepINITModel` directly, as above.
:::
:::{tab-item} 🐍 Python
:sync: python
Expand All @@ -144,6 +145,7 @@ inside it throws. Calling `prepINITModel` directly, as above, sidesteps that.

```python
import cobra
import pandas as pd
from cobra.io import read_sbml_model

from raven_toolbox.init import prep_init_model
Expand All @@ -155,7 +157,11 @@ model = read_sbml_model("Human-GEM/model/Human-GEM.xml")
model.solver = "gurobi"
tasks = parse_task_list("Human-GEM/data/metabolicTasks/metabolicTasks_Essential.txt")

prep = prep_init_model(model, tasks, ext_comp="e")
# spontaneous reactions are flagged in the model's own annotation table
tsv = pd.read_csv("Human-GEM/model/reactions.tsv", sep="\t")
spont = tsv.loc[tsv["spontaneous"] == 1, "rxns"].tolist()

prep = prep_init_model(model, tasks, ext_comp="e", spontaneous=spont)
```

```text
Expand All @@ -176,6 +182,20 @@ same machine and solver. Two things affect the run:
:::
::::

:::{note} Pass the spontaneous reactions
ftINIT keeps every reaction passed as
spontaneous in every extracted model, whatever the data say. Other reactions
without a gene rule are kept only where the optimisation needs them, so they can
differ from sample to sample. In Human-GEM, `spontaneous` marks reactions that need
no enzyme. That includes diffusion: transport between cytosol and nucleus through
the nuclear pores, and gases and water (O2, CO2, H2O, NH3, H2O2, NO, H2S) crossing
membranes. Leaving out the list, or using a Human-GEM older than the release that
added these flags, lets ftINIT drop such transports in some samples. The model then
falls back on other routes. For example, without the dCTP transport into the nucleus,
deoxycytidine kinase (DCK) becomes essential for DNA synthesis, which is an artefact
of the extraction rather than biology.
:::

## 14.2 Bring in the expression data

RAVEN wants one struct: the genes, the sample names, and a genes × samples matrix
Expand Down
Loading