Skip to content

Commit

Permalink
Merge pull request #196 from tanksha/covid-biogrid
Browse files Browse the repository at this point in the history
Includes Biogrid interaction for COVID19 proteins
  • Loading branch information
Habush authored Apr 24, 2020
2 parents 3f8f51b + b58e754 commit 9feabc2
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
3 changes: 2 additions & 1 deletion annotation/parser.scm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"interacts_with"
"inferred_interaction"
"transcribed_to"
"translated_to")
"translated_to"
"from_organism")
(set! *edges* (cons (create-edge (cadr lns)
(car lns)
predicate
Expand Down
32 changes: 30 additions & 2 deletions annotation/util.scm
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@
(if (null? lst) (ConceptNode "N/A") (car lst))))

(if (cog-node? node)
(EvaluationLink (PredicateNode "has_name") (ListLink node (node-name node)))
(list
(find-organism node)
(EvaluationLink (PredicateNode "has_name") (ListLink node (node-name node)))
)
(ListLink))
)

Expand All @@ -98,7 +101,7 @@

(define-public (node-info ENTITY)
"
node-info ENTITY -- Find the name and description of an entity.
node-info ENTITY -- Find the name,description and organism of an entity.
An entity can be any kind of conceptual object, such as a gene, protein,
small molecule, RNA, GeneOntology (GO) term, cellular location, etc.
Expand Down Expand Up @@ -429,3 +432,28 @@
((and (cog-link? x) (null? (cog-outgoing-set x))) '())
((pair? x) (append (flatten (car x)) (flatten (cdr x))))
(else (list x))))

(define (do-find-organism gene)
"
finds the organism(from human or virus etc ..) of a node
node can be GeneNode or MoleculeNode
"
(run-query
(Bind
(VariableList
(TypedVariable (Variable "$org") (Type 'ConceptNode))
(TypedVariable (Variable "$name") (Type 'ConceptNode)))
(AndLink
(Evaluation (Predicate "from_organism") (List gene (Variable "$org")))
(Evaluation (Predicate "has_name") (List (Variable "$org") (VariableNode "$name")))
)
(list
(Evaluation (Predicate "from_organism") (List gene (Variable "$org")))
(Evaluation (Predicate "has_name") (List (Variable "$org") (VariableNode "$name"))))
))
)
; Cache results of do-find-organism for performance.
(define cache-find-organism (memoize-function-call do-find-organism))

(define-public (find-organism gene)
(list (cache-find-organism gene)))

0 comments on commit 9feabc2

Please sign in to comment.