Skip to content

Commit 709e130

Browse files
committed
add compose part
1 parent 4069b90 commit 709e130

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,28 @@ enzmldoc = pe.read_enzymeml("enzmldoc.json")
105105
sbml_doc = pe.to_sbml(enzmldoc, "enzmldoc.omex")
106106
```
107107

108-
<sub>(Code should run as it is)</sup>
108+
<sub>(Code should run as it is)</sub>
109+
110+
### Compose an EnzymeML document
111+
112+
As an alternative to the manual creation of an EnzymeML document, you can use the `compose` function to create an EnzymeML document from a list of identifiers. This function will fetch the corresponding entities from the official databases and compose an EnzymeML document. Duplicate entities are removed to avoid redundancy.
113+
114+
```python
115+
import pyenzyme as pe
116+
117+
doc = pe.compose(
118+
name="test",
119+
proteins=["PDB:1A23"],
120+
small_molecules=["CHEBI:32551"],
121+
reactions=["RHEA:22864"],
122+
)
123+
124+
pe.write_enzymeml(doc, "enzmldoc.json")
125+
```
126+
127+
<sub>(Code should run as it is)</sub>
128+
129+
Please note, that by providing [RHEA](https://www.ebi.ac.uk/rhea/) identifiers, the function will automatically fetch all associated [CheBI](https://www.ebi.ac.uk/chebi/) molecules that are part of the reaction.
109130

110131
## 📖 Documentation and more examples
111132

0 commit comments

Comments
 (0)