Skip to content

Commit 67d27ba

Browse files
committed
Change location of where ListLink wrapping occurs.
As discussed in issue MOZI-AI#164. Untested -- I have not tried running this code; I think it's correct but I might have made a mistake, or missed a spot where a change was needed.
1 parent c33963a commit 67d27ba

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

annotation/functions.scm

+14-13
Original file line numberDiff line numberDiff line change
@@ -436,8 +436,9 @@ in the specified namespaces."
436436
If do-protein is #t then protein interactions are included.
437437
"
438438
(map
439-
(lambda (act-gene)
440-
(generate-result gene act-gene do-protein namespace parents coding non-coding))
439+
(lambda (act-gene) (ListLink
440+
(generate-result gene act-gene do-protein
441+
namespace parents coding non-coding)))
441442

442443
(run-query (Get
443444
(VariableList
@@ -459,8 +460,8 @@ in the specified namespaces."
459460
If do-protein is #t then protein interactions are included.
460461
"
461462
(map
462-
(lambda (gene-pair)
463-
(generate-result (gar gene-pair) (gdr gene-pair) do-protein namespace parents coding non-coding))
463+
(lambda (gene-pair) (ListLink
464+
(generate-result (gar gene-pair) (gdr gene-pair) do-protein namespace parents coding non-coding)))
464465

465466
(run-query (Get
466467
(VariableList
@@ -544,7 +545,7 @@ in the specified namespaces."
544545

545546
;; ---------------------------------
546547

547-
(define-public (generate-result gene-a gene-b do-protein namespaces num-parents
548+
(define (generate-result gene-a gene-b do-protein namespaces num-parents
548549
coding-rna non-coding-rna)
549550
"
550551
generate-result -- add info about matched variable nodes
@@ -562,7 +563,7 @@ in the specified namespaces."
562563
(if
563564
(or (equal? (cog-type gene-a) 'VariableNode)
564565
(equal? (cog-type gene-b) 'VariableNode))
565-
(ListLink)
566+
'()
566567
(let* (
567568
[already-done-a ((biogrid-genes) gene-a)]
568569
[already-done-b ((biogrid-genes) gene-b)]
@@ -604,8 +605,8 @@ in the specified namespaces."
604605
[coding-prot-b (find-protein-form gene-b)])
605606
(if (or (equal? coding-prot-a (ListLink))
606607
(equal? coding-prot-b (ListLink)))
607-
(ListLink)
608-
(ListLink
608+
'()
609+
(list
609610
interaction
610611
(Evaluation (Predicate "expresses") (List gene-a coding-prot-a))
611612
(node-info gene-a)
@@ -619,7 +620,7 @@ in the specified namespaces."
619620
rna-cross-annotation
620621
)
621622
))
622-
(ListLink
623+
(list
623624
interaction
624625
(node-info gene-a)
625626
(locate-node gene-a)
@@ -652,8 +653,8 @@ in the specified namespaces."
652653
(if do-protein
653654
(let ([coding-prot (find-protein-form gene-x)])
654655
(if (equal? coding-prot (ListLink))
655-
(ListLink)
656-
(ListLink
656+
'()
657+
(list
657658
interaction
658659
(Evaluation (Predicate "expresses") (List gene-x coding-prot))
659660
(node-info gene-x)
@@ -662,7 +663,7 @@ in the specified namespaces."
662663
go-cross-annotation
663664
rna-cross-annotation)
664665
))
665-
(ListLink
666+
(list
666667
interaction
667668
(node-info gene-x)
668669
(locate-node gene-x)
@@ -671,7 +672,7 @@ in the specified namespaces."
671672
)))
672673

673674
;;; Both of the genes have been done.
674-
(else (if already-done-pair (ListLink) (ListLink interaction)))
675+
(else (if already-done-pair '() (list interaction)))
675676
)
676677
)
677678
)

0 commit comments

Comments
 (0)