Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change location of where ListLink wrapping occurs. #165

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 14 additions & 13 deletions annotation/functions.scm
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,9 @@ in the specified namespaces."
If do-protein is #t then protein interactions are included.
"
(map
(lambda (act-gene)
(generate-result gene act-gene do-protein namespace parents coding non-coding))
(lambda (act-gene) (ListLink
(generate-result gene act-gene do-protein
namespace parents coding non-coding)))

(run-query (Get
(VariableList
Expand All @@ -459,8 +460,8 @@ in the specified namespaces."
If do-protein is #t then protein interactions are included.
"
(map
(lambda (gene-pair)
(generate-result (gar gene-pair) (gdr gene-pair) do-protein namespace parents coding non-coding))
(lambda (gene-pair) (ListLink
(generate-result (gar gene-pair) (gdr gene-pair) do-protein namespace parents coding non-coding)))

(run-query (Get
(VariableList
Expand Down Expand Up @@ -544,7 +545,7 @@ in the specified namespaces."

;; ---------------------------------

(define-public (generate-result gene-a gene-b do-protein namespaces num-parents
(define (generate-result gene-a gene-b do-protein namespaces num-parents
coding-rna non-coding-rna)
"
generate-result -- add info about matched variable nodes
Expand All @@ -562,7 +563,7 @@ in the specified namespaces."
(if
(or (equal? (cog-type gene-a) 'VariableNode)
(equal? (cog-type gene-b) 'VariableNode))
(ListLink)
'()
(let* (
[already-done-a ((biogrid-genes) gene-a)]
[already-done-b ((biogrid-genes) gene-b)]
Expand Down Expand Up @@ -604,8 +605,8 @@ in the specified namespaces."
[coding-prot-b (find-protein-form gene-b)])
(if (or (equal? coding-prot-a (ListLink))
(equal? coding-prot-b (ListLink)))
(ListLink)
(ListLink
'()
(list
interaction
(Evaluation (Predicate "expresses") (List gene-a coding-prot-a))
(node-info gene-a)
Expand All @@ -619,7 +620,7 @@ in the specified namespaces."
rna-cross-annotation
)
))
(ListLink
(list
interaction
(node-info gene-a)
(locate-node gene-a)
Expand Down Expand Up @@ -652,8 +653,8 @@ in the specified namespaces."
(if do-protein
(let ([coding-prot (find-protein-form gene-x)])
(if (equal? coding-prot (ListLink))
(ListLink)
(ListLink
'()
(list
interaction
(Evaluation (Predicate "expresses") (List gene-x coding-prot))
(node-info gene-x)
Expand All @@ -662,7 +663,7 @@ in the specified namespaces."
go-cross-annotation
rna-cross-annotation)
))
(ListLink
(list
interaction
(node-info gene-x)
(locate-node gene-x)
Expand All @@ -671,7 +672,7 @@ in the specified namespaces."
)))

;;; Both of the genes have been done.
(else (if already-done-pair (ListLink) (ListLink interaction)))
(else (if already-done-pair '() (list interaction)))
)
)
)
Expand Down