|
1 | 1 | (in-package :ecocyc)
|
2 | 2 |
|
| 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 | + |
3 | 24 | (defun collect-rxns (rxn-list filter-p)
|
4 | 25 | (loop for rxn in rxn-list
|
5 | 26 | when (funcall filter-p rxn)
|
|
17 | 38 | append (enzymes-of-reaction rxn)))
|
18 | 39 | collect (translate-enzyme-to-tms enzyme)))
|
19 | 40 |
|
| 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 | + |
20 | 53 | (defun translate-catalysis-to-tms (rxn)
|
21 | 54 | `(catalyze ,(get-frame-name rxn)
|
22 | 55 | ,@(enzymes-of-reaction rxn)))
|
|
43 | 76 | (atomic-balanced-p rxn 'S)
|
44 | 77 | (atomic-balanced-p rxn 'P)))
|
45 | 78 |
|
| 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 | + |
46 | 84 | (defun get-stoichiometry (rxn side participant)
|
47 | 85 | (let ((coeff (get-value-annot rxn side participant 'coefficient)))
|
48 | 86 | (if coeff
|
|
0 commit comments