Debugging the bug/ecocyc-ucsd-gene-reaction-predicate.lisp

From FreeBio

Gene reaction predicate matching using lsw.

Contents

Ontology

First define the ontology:

(define-ontology ucsd-gene-predicate ()

Genes

Then represent the genes as primitive classes:

 (class !B0002 :partial)
 (class !B0003 :partial)
 (class !B0004 :partial)
 (class !B0007 :partial)
 (class !B0008 :partial)
 (class !B0019 :partial)
 (class !B0025 :partial)
 (class !B0026 :partial)
 (class !B0029 :partial)
 (class !B0030 :partial)
 (class !B0031 :partial)
 (class !B0032 :partial)
 (class !B0033 :partial)
 (class !B0036 :partial)
 (class !B0037 :partial)
 (class !B0038 :partial)
 (class !B0040 :partial)
 (class !B0047 :partial)
 (class !B0048 :partial)
 (class !B0049 :partial)
 ....

EcoCyc

Next, represent the EcoCyc reactions as classes defined as intersections (AND) and unions (OR) of gene classes.

(class !TRANS-RXN-117 :complete (union-of (intersection-of !B3258))) 
(class !RXN0-2481 :complete
 (union-of (intersection-of !B1377) (intersection-of !B0241)
  (intersection-of !B0929) (intersection-of !B2215))) 
(class !ABC-16-RXN :complete
 (union-of (intersection-of !B4034 !B4032 !B4033 !B4035))) 
(class !RXN0-2261 :complete
 (union-of
  (intersection-of !B4291 !B3005 !B3006 !B1252 !B4287 !B4289 !B4288
   !B4290))) 
(class !RXN0-2241 :complete
 (union-of
  (intersection-of !B3005 !B3006 !B1252 !B0150 !B0151 !B0153 !B0152))) 
(class !RXN0-22 :complete (union-of (intersection-of !B3662))) 
(class !RXN0-2181 :complete
 (union-of
  (intersection-of !B3005 !B3006 !B1252 !B0584 !B0588 !B0590 !B0589
   !B0592))) 
(class !RXN0-2162 :complete (union-of (intersection-of !B4115))) 
(class !RXN0-2121 :complete
 (union-of
  (intersection-of !B1709 !B1711 !B0158 !B3966 !B3005 !B3006 !B1252))) 
(class !RXN0-1981 :complete (union-of (intersection-of !B4067))) 
(class !RXN0-1924 :complete
 (union-of (intersection-of !B2578) (intersection-of !B1533))) 
(class !RXN0-1923 :complete
 (union-of (intersection-of !B2578) (intersection-of !B1533))) 
(class !RXN0-1804 :complete (union-of (intersection-of !B4036))) 
...

UCSD

Then define the UCSD reactions as individuals of a class defined as intersections (AND) and unions (OR) of gene classes.

        (datatype-property !equation)
        (datatype-property !geneAssociation)
	(individual !PNTOt4pp (type !B3258)
		(value !equation "na1[p] + pnto-R[p] --> na1[c] + pnto-R[c]")
		(value !geneAssociation "B3258"))
	(individual !12PPDRtex (type (union-of !B0241 !B0929 !B1377 !B2215))
		(value !equation "12ppd-R[e] <==> 12ppd-R[p]")
		(value !geneAssociation "( B0241 OR B0929 OR B1377 OR B2215 )"))
	(individual !12PPDStex (type (union-of !B0241 !B0929 !B1377 !B2215))
		(value !equation "12ppd-S[e] <==> 12ppd-S[p]")
		(value !geneAssociation "( B0241 OR B0929 OR B1377 OR B2215 )"))
	(individual !14GLUCANabcpp (type (intersection-of !B4034 !B4033 !B4032 !B4035))
		(value !equation "14glucan[p] + atp[c] + h2o[c] --> 14glucan[c] + adp[c] + h[c] + pi[c]")
		(value !geneAssociation "( B4034 AND B4033 AND B4032 AND B4035 )"))
	(individual !ACGAptspp (type (union-of (intersection-of !B2417 !B1101 !B2415 !B2416) (intersection-of !B0679 !B2415 !B2416)))
		(value !equation "acgam[p] + pep[c] --> acgam6p[c] + pyr[c]")
		(value !geneAssociation "( ( B2417 AND B1101 AND B2415 AND B2416 ) OR ( B0679 AND B2415 AND B2416 ) )"))

Apply Reasoner

CL-USER> (describe-entity !PNTOt4pp (kb ucsd-gene-predicate))
Individual http://example.com/#PNTOt4pp
All Types: ex:B3258, ex:TRANS-RXN-117
Direct Types: ex:B3258, ex:TRANS-RXN-117
ex:geneAssociation: (:literal "B3258" "xsd:string")
ex:equation: (:literal "na1[p] + pnto-R[p] --> na1[c] + pnto-R[c]" "xsd:string")
NIL
CL-USER> (describe-entity !12PPDRtex (kb ucsd-gene-predicate))
Individual http://example.com/#12PPDRtex
All Types: ex:RXN0-2481
Direct Types: ex:RXN0-2481
ex:geneAssociation: (:literal "( B0241 OR B0929 OR B1377 OR B2215 )" "xsd:string")
ex:equation: (:literal "12ppd-R[e] <==> 12ppd-R[p]" "xsd:string")
NIL
CL-USER> (describe-entity !12PPDStex  (kb ucsd-gene-predicate))
Individual http://example.com/#12PPDStex
All Types: ex:RXN0-2481
Direct Types: ex:RXN0-2481
ex:geneAssociation: (:literal "( B0241 OR B0929 OR B1377 OR B2215 )" "xsd:string")
ex:equation: (:literal "12ppd-S[e] <==> 12ppd-S[p]" "xsd:string")
NIL
CL-USER> (describe-entity !14GLUCANabcpp (kb ucsd-gene-predicate))
Individual http://example.com/#14GLUCANabcpp
All Types: ex:B4035, ex:B4034, ex:B4032, ex:ABC-16-RXN, ex:B4033
Direct Types: ex:ABC-16-RXN
ex:geneAssociation: (:literal "( B4034 AND B4033 AND B4032 AND B4035 )" "xsd:string")
ex:equation: (:literal "14glucan[p] + atp[c] + h2o[c] --> 14glucan[c] + adp[c] + h[c] + pi[c]" "xsd:string")
NIL
CL-USER> 
CL-USER> (describe-entity !ACGAptspp (kb ucsd-gene-predicate))
Individual http://example.com/#ACGAptspp
All Types: ex:B2415, ex:B2416
Direct Types: ex:B2415, ex:B2416
ex:geneAssociation: (:literal "( ( B2417 AND B1101 AND B2415 AND B2416 ) OR ( B0679 AND B2415 AND B2416 ) )" "xsd:string")
ex:equation: (:literal "acgam[p] + pep[c] --> acgam6p[c] + pyr[c]" "xsd:string")
NIL
CL-USER>