Skip to content

Commit

Permalink
working on chemical affects gene query
Browse files Browse the repository at this point in the history
  • Loading branch information
webyrd committed Nov 25, 2023
1 parent 0e48441 commit eedaa70
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions contrib/medikanren2/neo/Will/chemical-affects-gene.rkt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#lang racket/base

(provide
chem-affects-gene
chem-affects-gene-entries
chem-affects-gene-TSV)

(require
Expand Down Expand Up @@ -29,7 +31,7 @@
(set->list (curie-synonyms-and-descendents gene-list))))))

(define header
(list "chemical CURIE" "chemical name" "predicate description" "object CURIE" "object name" "PUBMEDs" "source"))
(list "chemical CURIE" "chemical name" "predicate description" "object CURIE" "object name" "NCBITaxon" "PUBMEDs" "source"))

(define (create-entry result)
(match result
Expand All @@ -42,13 +44,18 @@
pred)
obj-curie
(concept->name obj-curie)
(or (get-assoc "NCBITaxon" props)
"N/A")
(string-join (get-pubs props) ",")
(get-primary-knowledge-source props))]))

(define (chem-affects-gene-entries gene-list)
(cons header
(remove-duplicates
(map create-entry
(chem-affects-gene gene-list)))))

(define (chem-affects-gene-TSV file-name gene-list)
(write-answers-to-tsv
file-name
(cons header
(remove-duplicates
(map create-entry
(chem-affects-gene gene-list))))))
(chem-affects-gene-entries gene-list)))

0 comments on commit eedaa70

Please sign in to comment.