Skip to content

Commit 09d0eb3

Browse files
author
djinnome
committed
Added pathway generation functions and pathway export list
1 parent f8c1142 commit 09d0eb3

File tree

2 files changed

+1463
-0
lines changed

2 files changed

+1463
-0
lines changed

ptools/export-rxns.lisp

+38
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
(in-package :ecocyc)
22

3+
(defun collect-pwys (pwy-list filter-p)
4+
(loop for pwy in pwy-list
5+
when (funcall filter-p pwy)
6+
collect (translate-pwy-to-tms pwy)))
7+
8+
(defun collect-pwy-catalyses (pwy-list filter-p)
9+
(loop for pwy in pwy-list
10+
when (funcall filter-p pwy)
11+
collect (translate-pwy-catalysis-to-tms pwy)))
12+
13+
(defun collect-pwy-enzymes (pwy-list filter-p)
14+
(loop for enzyme in (remove-duplicates
15+
(loop for pwy in pwy-list
16+
when (funcall filter-p pwy)
17+
append (enzymes-of-pathway pwy)))
18+
collect (translate-enzyme-to-tms enzyme)))
19+
20+
(defun balanced-pwy-p (pwy)
21+
(and (coercible-to-frame-p pwy)
22+
(substrates-of-pwy-are-frames-p pwy)))
23+
324
(defun collect-rxns (rxn-list filter-p)
425
(loop for rxn in rxn-list
526
when (funcall filter-p rxn)
@@ -17,6 +38,18 @@
1738
append (enzymes-of-reaction rxn)))
1839
collect (translate-enzyme-to-tms enzyme)))
1940

41+
(defun translate-pwy-to-tms (pwy)
42+
(multiple-value-bind
43+
(all-reactants proper-reactants all-products proper-products)
44+
(substrates-of-pathway pwy)
45+
`(pwy ,(get-frame-name pwy)
46+
,proper-reactants
47+
,@all-products)))
48+
49+
(defun translate-pwy-catalysis-to-tms (pwy)
50+
`(pwy-catalyze ,(get-frame-name pwy)
51+
,@(enzymes-of-pathway pwy)))
52+
2053
(defun translate-catalysis-to-tms (rxn)
2154
`(catalyze ,(get-frame-name rxn)
2255
,@(enzymes-of-reaction rxn)))
@@ -43,6 +76,11 @@
4376
(atomic-balanced-p rxn 'S)
4477
(atomic-balanced-p rxn 'P)))
4578

79+
(defun substrates-of-pwy-are-frames-p (pwy)
80+
(not (loop for substrate in (compounds-of-pathway pwy)
81+
if (not (coercible-to-frame-p substrate))
82+
return substrate)))
83+
4684
(defun get-stoichiometry (rxn side participant)
4785
(let ((coeff (get-value-annot rxn side participant 'coefficient)))
4886
(if coeff

0 commit comments

Comments
 (0)