Copy disabled (too large)
Download .txt
Showing preview only (16,793K chars total). Download the full file to get everything.
Repository: webyrd/mediKanren
Branch: master
Commit: 3e01d5420b51
Files: 532
Total size: 41.0 MB
Directory structure:
gitextract_bl5lyvi7/
├── .github/
│ └── workflows/
│ └── request-10GB-CI.yml
├── .gitignore
├── LICENSE
├── Makefile
├── README.md
├── attic/
│ ├── code/
│ │ ├── README.md
│ │ ├── concept.rkt
│ │ ├── csv-semmed-ordered-unique-enum.rkt
│ │ ├── csv-semmed-simplify.rkt
│ │ ├── csv-semmed-validate-cuis.rkt
│ │ ├── csv.rkt
│ │ ├── db.rkt
│ │ ├── edge.rkt
│ │ ├── gui-simple.rkt
│ │ ├── helpers.rkt
│ │ ├── imatinib-query.rkt
│ │ ├── microKanren/
│ │ │ ├── README.md
│ │ │ ├── microKanren-test-programs.scm
│ │ │ ├── microKanren-test.scm
│ │ │ ├── microKanren.scm
│ │ │ └── miniKanren-wrappers.scm
│ │ ├── mk/
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── arithmetic.scm
│ │ │ ├── evalo.scm
│ │ │ ├── mk.scm
│ │ │ ├── test-all.scm
│ │ │ ├── test-arithmetic.scm
│ │ │ ├── test-check.scm
│ │ │ ├── test-interp.scm
│ │ │ ├── test-quines.scm
│ │ │ ├── test-type-infer.scm
│ │ │ └── type-infer.scm
│ │ ├── mk-db.rkt
│ │ ├── mk.rkt
│ │ ├── process-db.rkt
│ │ ├── programmatically-defined-relations.rkt
│ │ ├── read.rkt
│ │ ├── sample_semmed.csv
│ │ ├── semmed/
│ │ │ ├── PREDICATE.scm
│ │ │ ├── PREDICATE_OCCURRENCE_ORDERED.scm
│ │ │ ├── README.md
│ │ │ ├── SEMTYPE.scm
│ │ │ ├── concept.scm
│ │ │ └── cui-by-semtype.scm
│ │ ├── semmed-index-predicate.rkt
│ │ ├── study-dfo-raynaud.rkt
│ │ ├── study-imatinib.rkt
│ │ ├── study-sickle-malaria.rkt
│ │ └── tacrine.rkt
│ ├── medikanren/
│ │ ├── CACNA1A-full.rkt
│ │ ├── DNM1L-full.rkt
│ │ ├── NF1-full.rkt
│ │ ├── brca1-full.rkt
│ │ ├── brca1.rkt
│ │ ├── create-all-hashtables.rkt
│ │ ├── create-doid-cui-to-cid-hashtable.rkt
│ │ ├── create-ensembl-cui-to-cid-hashtable.rkt
│ │ ├── create-hashtable-common.rkt
│ │ ├── create-hgnc-cui-to-cid-hashtable.rkt
│ │ ├── create-hpo-cui-to-cid-hashtable.rkt
│ │ ├── create-mondo-cui-to-cid-hashtable.rkt
│ │ ├── create-omim-cui-to-cid-hashtable.rkt
│ │ ├── create-umls-cui-to-cid-hashtable.rkt
│ │ ├── create-uniprotkb-cui-to-cid-hashtable.rkt
│ │ ├── dhx30-full.rkt
│ │ ├── dhx30.rkt
│ │ ├── examine-concepts.rkt
│ │ ├── example-dhx30-monarch-lite.rkt
│ │ ├── example-dhx30-scigraph.rkt
│ │ ├── find-edges-by-pubmed-id.rkt
│ │ ├── gui-simple-v3.rkt
│ │ ├── sialic-full-will.rkt
│ │ ├── sialic-full.rkt
│ │ ├── test-POST.rkt
│ │ ├── w1m2-direct-POST.rkt
│ │ ├── web-server.rkt
│ │ ├── workflow-web-server.rkt
│ │ └── workflow1.rkt
│ ├── pharos/
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── csv.rkt
│ │ ├── db.rkt
│ │ ├── interact-sqlite3
│ │ ├── mk-db.rkt
│ │ ├── mk-parse.rkt
│ │ ├── mk.rkt
│ │ ├── mysql2sqlite/
│ │ │ ├── LICENSE
│ │ │ ├── mysql2sqlite
│ │ │ ├── mysql2sqlite.README
│ │ │ └── unit_tests.sh
│ │ ├── pharos-mysql-to-sqlite3-to-db
│ │ ├── read.rkt
│ │ ├── repr.rkt
│ │ ├── sql-schema-parse.rkt
│ │ ├── sql-tokenize.rkt
│ │ └── sqlite-to-db.rkt
│ └── yaml/
│ ├── biolink-model.scm
│ ├── example1.scm
│ ├── example1.yaml
│ ├── yaml.scm
│ └── yaml2sexp.py
├── contrib/
│ ├── README.md
│ ├── medikanren/
│ │ ├── 2020_NCATS_relay/
│ │ │ ├── INTEGRATED-QUERY/
│ │ │ │ └── textmining->rtx2.rkt
│ │ │ ├── kg-maps/
│ │ │ │ ├── rtx2_2020_09_16/
│ │ │ │ │ ├── rtx2_2020_09_16-map.html
│ │ │ │ │ ├── rtx2_2020_09_16-stats.txt
│ │ │ │ │ ├── rtx2_2020_09_16-subject_predicate_object_count.tsv
│ │ │ │ │ ├── rtx2_2020_09_16.dot
│ │ │ │ │ ├── rtx2_2020_09_16.txt
│ │ │ │ │ ├── shorest-path-graph-visual-hover.html
│ │ │ │ │ ├── shortest_path.rkt
│ │ │ │ │ └── shortest_path_with_visual.rkt
│ │ │ │ ├── sri-reference-kg-0.2.0/
│ │ │ │ │ ├── sri-reference-kg-0.2.0-map.html
│ │ │ │ │ ├── sri-reference-kg-0.2.0-subject_predicate_object_count.tsv
│ │ │ │ │ └── sri-reference-kg-0.2.0.dot
│ │ │ │ ├── sri_semmeddb/
│ │ │ │ │ ├── sri_semmeddb-map.html
│ │ │ │ │ ├── sri_semmeddb-stats.txt
│ │ │ │ │ ├── sri_semmeddb-subject_predicate_object_count.tsv
│ │ │ │ │ └── sri_semmeddb.dot
│ │ │ │ └── textminingprovider/
│ │ │ │ ├── co-occur/
│ │ │ │ │ ├── co-occur-map.html
│ │ │ │ │ ├── co-occur-stats.txt
│ │ │ │ │ ├── co-occur-subject_predicate_object_count.tsv
│ │ │ │ │ └── co-occur.dot
│ │ │ │ ├── pr-owl/
│ │ │ │ │ ├── pr-owl-map.html
│ │ │ │ │ ├── pr-owl-stats.txt
│ │ │ │ │ ├── pr-owl-subject_predicate_object_count.tsv
│ │ │ │ │ └── pr-owl.dot
│ │ │ │ └── textminingprovider/
│ │ │ │ ├── textminingprovider-map.html
│ │ │ │ ├── textminingprovider-stats.txt
│ │ │ │ ├── textminingprovider-subject_predicate_object_count.tsv
│ │ │ │ └── textminingprovider.dot
│ │ │ ├── kg_statistics_table_generator.R
│ │ │ ├── rtx2-KG-query.rkt
│ │ │ └── textmining-KG-query.rkt
│ │ ├── README.md
│ │ ├── X-Y-C.rkt
│ │ ├── auto_query_symptom.rkt
│ │ ├── example-dhx30-rtx.rkt
│ │ ├── example-dhx30-semmed.rkt
│ │ ├── example-tacrine-semmed.rkt
│ │ ├── genes-perturbed.rkt
│ │ ├── get-all-hgncs-from-raw-data.rkt
│ │ ├── make-kg-edge-covid19.rkt
│ │ ├── make-kg-edge-general.rkt
│ │ ├── make-kg-edge-sri-reference-kg.rkt
│ │ ├── make-kg-edge.rkt
│ │ ├── make-kg-node-general.rkt
│ │ ├── make-kg-node-sri-reference-kg.rkt
│ │ ├── make-kg-node.rkt
│ │ ├── marissa/
│ │ │ ├── migraine-case.rkt
│ │ │ └── patient-case-workflow.rkt
│ │ ├── marvin.rkt
│ │ ├── pieces-parts/
│ │ │ ├── CHAMP1_RNA_seq_original.rkt
│ │ │ ├── README_VISJS.md
│ │ │ ├── Thi-useful-functions.rkt
│ │ │ ├── causal-discovery.rkt
│ │ │ ├── chemical->drug-filter.rkt
│ │ │ ├── drug-ranker.rkt
│ │ │ ├── etl_for_new_KGs/
│ │ │ │ └── xmlparse.rkt
│ │ │ ├── example-2-hop-rhobtb2-drug-safe.rkt
│ │ │ ├── example-2-hop-rhobtb2.rkt
│ │ │ ├── example-2-hop-tmprss2.rkt
│ │ │ ├── example-ontology.rkt
│ │ │ ├── example-synonymize.rkt
│ │ │ ├── gene-budging.rkt
│ │ │ ├── lib.rkt
│ │ │ ├── make-map-fast.rkt
│ │ │ ├── make-map.rkt
│ │ │ ├── make-provenance-map-fast.rkt
│ │ │ ├── new-query-lang/
│ │ │ │ └── select.rkt
│ │ │ ├── non_drug_filter.rkt
│ │ │ ├── postquery.rkt
│ │ │ ├── pub-clustering.rkt
│ │ │ ├── rank-regulators-exe.rkt
│ │ │ ├── rank-regulators-gene-lists.rkt
│ │ │ ├── rank-regulators.rkt
│ │ │ ├── rank-side-effects.rkt
│ │ │ ├── synonymization_algorithm.rkt
│ │ │ ├── test-propagator.rkt
│ │ │ ├── trace-pathways-by-tissue-type.rkt
│ │ │ ├── trace-pathways-mjp.rkt
│ │ │ ├── trace-pathways.rkt
│ │ │ └── tutorial.rkt
│ │ ├── preds.rkt
│ │ ├── query-graph.rkt
│ │ ├── simple-query.rkt
│ │ ├── test-web-server.rkt
│ │ └── use-cases/
│ │ ├── CHAMP1_RNA_seq.rkt
│ │ └── PMI-20-10-Il1R1-case-reviews.rkt
│ └── medikanren2/
│ ├── README.md
│ ├── Thi/
│ │ ├── CHAMP1-drug-repurpose-June-15-2021.rkt
│ │ ├── Hakon-DEG-list.rkt
│ │ ├── Hakon-DEG-syns.rkt
│ │ ├── IL1R1-med2-translate-rtx2-only-June-15-2021.rkt
│ │ ├── IL1R1-med2-translate.rkt
│ │ ├── PMI-21-34-NEXMIF-2hop.rkt
│ │ ├── SLC16A11-explore.rkt
│ │ ├── build-kgx-synonym.rkt
│ │ ├── build-rtx-kg2.rkt
│ │ ├── example-one-hop-IL1R1-drugs.rkt
│ │ ├── example-one-hop-ORPHANET-ICD-9-10.rkt
│ │ ├── example-one-hop-UniProt-cause-OMIM.rkt
│ │ ├── example-two-hop-CHAMP1-drugs.rkt
│ │ ├── example-two-hop-PMI-21-34-NEXMIF.rkt
│ │ ├── query-low-level.rkt
│ │ └── synonym-low-level.rkt
│ ├── draw.rkt
│ ├── gregr/
│ │ ├── benchmark-nausea.rkt
│ │ ├── hao-demo.rkt
│ │ ├── notes-on-reasoning.md
│ │ ├── old/
│ │ │ ├── graph-builder-explorer.rkt
│ │ │ ├── query-simple.rkt
│ │ │ └── query-tree.rkt
│ │ ├── owlrl.rkt
│ │ ├── query-low-level.rkt
│ │ └── test-dataflow-nausea.rkt
│ ├── lw-reasoning-examples.rkt
│ ├── neo/
│ │ ├── Andy/
│ │ │ └── simple-query.rkt
│ │ ├── Kaiwen/
│ │ │ ├── auto-grow-example.rkt
│ │ │ └── mayo-gene-list.rkt
│ │ ├── Mayu/
│ │ │ ├── achromatopsia-query.rkt
│ │ │ ├── alz-query-revisited-multi-db-query.rkt
│ │ │ ├── genes-query.rkt
│ │ │ ├── nfix-multi-db-query.rkt
│ │ │ ├── simple-query.rkt
│ │ │ ├── wills-new-multi-db-queries.rkt
│ │ │ └── wills-new-rtx-kg2-queries.rkt
│ │ ├── Will/
│ │ │ ├── adverse-effects.rkt
│ │ │ ├── chemical-affects-gene.rkt
│ │ │ └── simple-query.rkt
│ │ └── utils.rkt
│ ├── profiling.rkt
│ └── trapi-tests.rkt
├── medikanren/
│ ├── .compile.sh
│ ├── .gitignore
│ ├── .install_pkgs.sh
│ ├── .run_ci.sh
│ ├── README.md
│ ├── apps/
│ │ ├── gui-simple-v2.rkt
│ │ └── translator-web-server.rkt
│ ├── biolink-types-examples.scm
│ ├── common.rkt
│ ├── config.defaults.scm
│ ├── configref.rkt
│ ├── csv.rkt
│ ├── db.rkt
│ ├── hgnc-ids.txt
│ ├── mk-db.rkt
│ ├── mk.rkt
│ ├── open-api/
│ │ ├── ISB-KG-api.rkt
│ │ ├── TranslatorReasonersAPI.json
│ │ ├── TranslatorReasonersAPI.yaml
│ │ ├── api-query.rkt
│ │ ├── html/
│ │ │ ├── .swagger-codegen/
│ │ │ │ └── VERSION
│ │ │ ├── .swagger-codegen-ignore
│ │ │ └── index.html
│ │ ├── html2/
│ │ │ ├── .swagger-codegen/
│ │ │ │ └── VERSION
│ │ │ ├── .swagger-codegen-ignore
│ │ │ └── index.html
│ │ ├── yaml-to-json.sh
│ │ └── yaml2json.py
│ ├── pieces-parts/
│ │ ├── NOTES-DB.md
│ │ ├── NOTES.md
│ │ ├── new-query-lang/
│ │ │ ├── may2.txt
│ │ │ └── michael-query-language-design.txt
│ │ ├── ontology.rkt
│ │ ├── orange_graph.dot
│ │ ├── propagator.rkt
│ │ ├── query.rkt
│ │ ├── synonymize.rkt
│ │ └── visjs.html
│ ├── repr.rkt
│ ├── string-search.rkt
│ ├── test/
│ │ ├── external-http/
│ │ │ └── 2020_NCATS_relay/
│ │ │ ├── INTEGRATED-QUERY/
│ │ │ │ └── integrated-query.rkt
│ │ │ ├── genetics-provider-query.rkt
│ │ │ ├── molepro-api-query.rkt
│ │ │ └── multiomics-api-query.rkt
│ │ └── full-dbs/
│ │ ├── example-common.rkt
│ │ └── test-common.rkt
│ ├── test-behave.sh
│ ├── tmp/
│ │ └── ignore
│ ├── todo.txt
│ ├── tsv.rkt
│ ├── use-cases/
│ │ └── README.md
│ └── util/
│ └── data-import/
│ ├── README.md
│ ├── build-pubmed-edges.rkt
│ ├── build-string-index.rkt
│ ├── csv-graph-to-db.rkt
│ ├── edges-to-csv.rkt
│ ├── tsv-graph-to-db-lenient.rkt
│ └── tsv-graph-to-db.rkt
├── medikanren2/
│ ├── .clean.sh
│ ├── .compile.sh
│ ├── .data-directory-ci
│ ├── .gitignore
│ ├── .install_pkgs.sh
│ ├── .run_ci.sh
│ ├── base.rkt
│ ├── chembl_sample_edge.rkt
│ ├── common.rkt
│ ├── configref.rkt
│ ├── connect_dbk_to_sql.rkt
│ ├── db/
│ │ ├── clinical_kg.rkt
│ │ ├── kgx-synonym.rkt
│ │ ├── rtx2-20210204.rkt
│ │ ├── rtx2-biolink_2_1_2021_07_28.rkt
│ │ ├── rtx2-biolink_2_1_2021_08_04_condensed.rkt
│ │ ├── semmed.rkt
│ │ ├── sri-reference-kg-0.3.0.rkt
│ │ ├── yeast-micro-sri-reference-kg-0.3.0.rkt
│ │ └── yeast-sri-reference-kg-0.3.0.rkt
│ ├── dbk/
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── SNAPSHOT
│ │ ├── bcat.rkt
│ │ ├── dbk/
│ │ │ ├── abstract-syntax.rkt
│ │ │ ├── codec.rkt
│ │ │ ├── common.rkt
│ │ │ ├── concrete-syntax-extended.rkt
│ │ │ ├── concrete-syntax.rkt
│ │ │ ├── config.rkt
│ │ │ ├── constraint.rkt
│ │ │ ├── data.rkt
│ │ │ ├── dsv.rkt
│ │ │ ├── enumerator.rkt
│ │ │ ├── example-concrete-syntax-extended.rkt
│ │ │ ├── heap.rkt
│ │ │ ├── io.rkt
│ │ │ ├── misc.rkt
│ │ │ ├── mk.rkt
│ │ │ ├── old/
│ │ │ │ ├── abstract-syntax.rkt
│ │ │ │ ├── example/
│ │ │ │ │ ├── base.rkt
│ │ │ │ │ ├── counters.rkt
│ │ │ │ │ ├── path.rkt
│ │ │ │ │ ├── quorum.rkt
│ │ │ │ │ └── shortest-path.rkt
│ │ │ │ ├── parse.rkt
│ │ │ │ └── process.rkt
│ │ │ ├── order.rkt
│ │ │ ├── semantics.rkt
│ │ │ ├── stream.rkt
│ │ │ ├── syntax.rkt
│ │ │ └── table.rkt
│ │ ├── dbk.rkt
│ │ ├── test/
│ │ │ ├── .gitignore
│ │ │ ├── benchmark-sorting/
│ │ │ │ ├── radix-sort.rkt
│ │ │ │ └── string-sort.rkt
│ │ │ ├── benchmark1.rkt
│ │ │ ├── test-dataflow.rkt
│ │ │ ├── test-ingest-example-simple.rkt
│ │ │ ├── test-ingest-example.rkt
│ │ │ └── test-mk.rkt
│ │ ├── toggle-git
│ │ ├── toggle-git-backup
│ │ ├── update
│ │ └── update-snapshot
│ ├── dbk.rkt
│ ├── etc/
│ │ ├── config.defaults.scm
│ │ ├── config.stage.dev.scm
│ │ └── config.stage.prod.scm
│ ├── ex_cohd.rkt
│ ├── gui.rkt
│ ├── ingest-pipeline-status.rkt
│ ├── logging.rkt
│ ├── logging2.rkt
│ ├── lw-reasoning.rkt
│ ├── mkconfigref.rkt
│ ├── neo/
│ │ ├── dbKanren/
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── bcat.rkt
│ │ │ ├── csv2tsv.rkt
│ │ │ ├── dbk/
│ │ │ │ ├── abstract-syntax.rkt
│ │ │ │ ├── codec.rkt
│ │ │ │ ├── common.rkt
│ │ │ │ ├── concrete-syntax-extended.rkt
│ │ │ │ ├── concrete-syntax.rkt
│ │ │ │ ├── config.rkt
│ │ │ │ ├── constraint.rkt
│ │ │ │ ├── data.rkt
│ │ │ │ ├── database.rkt
│ │ │ │ ├── dsv.rkt
│ │ │ │ ├── enumerator.rkt
│ │ │ │ ├── example-concrete-syntax-extended.rkt
│ │ │ │ ├── heap.rkt
│ │ │ │ ├── io.rkt
│ │ │ │ ├── logging.rkt
│ │ │ │ ├── misc.rkt
│ │ │ │ ├── mk.rkt
│ │ │ │ ├── old/
│ │ │ │ │ ├── abstract-syntax.rkt
│ │ │ │ │ ├── example/
│ │ │ │ │ │ ├── base.rkt
│ │ │ │ │ │ ├── counters.rkt
│ │ │ │ │ │ ├── path.rkt
│ │ │ │ │ │ ├── quorum.rkt
│ │ │ │ │ │ └── shortest-path.rkt
│ │ │ │ │ ├── parse.rkt
│ │ │ │ │ └── process.rkt
│ │ │ │ ├── order.rkt
│ │ │ │ ├── safe-unsafe.rkt
│ │ │ │ ├── semantics.rkt
│ │ │ │ ├── storage.rkt
│ │ │ │ ├── stream.rkt
│ │ │ │ ├── syntax.rkt
│ │ │ │ └── table.rkt
│ │ │ ├── dbk.rkt
│ │ │ └── test/
│ │ │ ├── .gitignore
│ │ │ ├── benchmark-sorting/
│ │ │ │ ├── radix-sort.rkt
│ │ │ │ └── string-sort.rkt
│ │ │ ├── benchmark1.rkt
│ │ │ ├── chinook/
│ │ │ │ ├── .gitignore
│ │ │ │ ├── README.md
│ │ │ │ └── build.sh
│ │ │ ├── datalog/
│ │ │ │ ├── basic-naive.rkt
│ │ │ │ ├── compile.rkt
│ │ │ │ ├── kanren-notation-micro.rkt
│ │ │ │ ├── micro-plus.rkt
│ │ │ │ ├── micro-with-sets.rkt
│ │ │ │ ├── micro.rkt
│ │ │ │ ├── test-basic.rkt
│ │ │ │ ├── test-kanren-micro.rkt
│ │ │ │ ├── test-unmanaged-micro-plus.rkt
│ │ │ │ ├── test-unmanaged-micro.rkt
│ │ │ │ ├── unmanaged-notation-micro-plus.rkt
│ │ │ │ └── unmanaged-notation-micro.rkt
│ │ │ ├── equivalence-database.rkt
│ │ │ ├── microbenchmarks/
│ │ │ │ ├── integer-bytes-throughput.rkt
│ │ │ │ ├── place1.rkt
│ │ │ │ ├── place2.rkt
│ │ │ │ └── shared.rkt
│ │ │ ├── test-database-small.rkt
│ │ │ ├── test-dataflow.rkt
│ │ │ ├── test-equivalence-database.rkt
│ │ │ ├── test-ingest-example-simple.rkt
│ │ │ ├── test-ingest-example.rkt
│ │ │ ├── test-low-level.rkt
│ │ │ ├── test-mk.rkt
│ │ │ ├── test-semantics.rkt
│ │ │ └── test-storage.rkt
│ │ ├── neo-biolink/
│ │ │ ├── biolink_2_4_8/
│ │ │ │ └── biolink-model.yaml
│ │ │ ├── biolink_3_0_3/
│ │ │ │ └── biolink-model.yaml
│ │ │ ├── biolink_3_1_1/
│ │ │ │ └── biolink-model.yaml
│ │ │ ├── biolink_3_1_2/
│ │ │ │ └── biolink-model.yaml
│ │ │ ├── biolink_3_5_2/
│ │ │ │ ├── biolink-model.yaml
│ │ │ │ ├── semmed-exclude-list-model.yaml
│ │ │ │ └── semmed-exclude-list.yaml
│ │ │ └── biolink_4_2_1/
│ │ │ └── biolink-model.yaml
│ │ ├── neo-command-line-interface/
│ │ │ ├── README.md
│ │ │ ├── command-line-interface.rkt
│ │ │ └── utils.rkt
│ │ ├── neo-data/
│ │ │ ├── place_processed_data_here.txt
│ │ │ ├── raw_downloads_from_kge_archive/
│ │ │ │ └── place_raw_2tsv_kge_downloads_here.txt
│ │ │ └── raw_downloads_from_kge_archive_transformed_to_4tsv/
│ │ │ └── 4tsv_versions_of_kgs_will_be_generated_here.txt
│ │ ├── neo-data-import/
│ │ │ ├── an_important_note_on_pre_processing_kgs.txt
│ │ │ ├── bucket-setting/
│ │ │ │ ├── README.md
│ │ │ │ ├── generate-publication-dist.py
│ │ │ │ ├── predicate-publication-statistics.rkt
│ │ │ │ ├── rtx-kg2-publication-distribution.rkt
│ │ │ │ └── run.sh
│ │ │ ├── build-mediKanren2-kg-from-4tsv/
│ │ │ │ ├── import-full-Robokop.rkt
│ │ │ │ ├── import-rtx-kg2.rkt
│ │ │ │ └── import-text_mining.rkt
│ │ │ └── transform-2tsv-to-4tsv-kgs/
│ │ │ ├── transform-edge-jsonl.rkt
│ │ │ ├── transform-edge-tsv.rkt
│ │ │ ├── transform-full-Robokop.rkt
│ │ │ ├── transform-generic.rkt
│ │ │ ├── transform-node-jsonl.rkt
│ │ │ ├── transform-node-tsv.rkt
│ │ │ ├── transform-rtx-kg2.rkt
│ │ │ ├── transform-text_mining.rkt
│ │ │ ├── transform-utils.rkt
│ │ │ └── transform.rkt
│ │ ├── neo-low-level/
│ │ │ ├── make-query-low-level.rkt
│ │ │ ├── query-low-level-equivalence.rkt
│ │ │ ├── query-low-level-multi-db.rkt
│ │ │ ├── query-low-level-node-normalization.rkt
│ │ │ ├── query-low-level-robokop.rkt
│ │ │ ├── query-low-level-rtx-kg2.rkt
│ │ │ └── query-low-level-text-mining.rkt
│ │ ├── neo-open-api/
│ │ │ ├── mediKanrenSmartAPI_1_4.json
│ │ │ ├── mediKanrenSmartAPI_1_4.yaml
│ │ │ ├── mediKanrenSmartAPI_1_5.json
│ │ │ ├── mediKanrenSmartAPI_1_5.yaml
│ │ │ ├── neo-api-query.rkt
│ │ │ ├── unsecret-source-consume.yaml
│ │ │ ├── unsecret_metaKG.json
│ │ │ └── unsecret_metaKG_May_2023.json
│ │ ├── neo-reasoning/
│ │ │ ├── neo-biolink-reasoning-low-level.rkt
│ │ │ ├── neo-biolink-reasoning.rkt
│ │ │ └── semmed-exclude.rkt
│ │ ├── neo-server/
│ │ │ ├── experiments/
│ │ │ │ ├── experiment-1.rkt
│ │ │ │ ├── experiment-2.rkt
│ │ │ │ ├── experiment-3.rkt
│ │ │ │ ├── experiment-4.rkt
│ │ │ │ ├── experiment-5.rkt
│ │ │ │ ├── experiment-6.rkt
│ │ │ │ └── experiment-7.rkt
│ │ │ ├── neo-server-utils.rkt
│ │ │ └── neo-server.rkt
│ │ ├── neo-tests/
│ │ │ └── test-mvps-TRAPI-response.rkt
│ │ ├── neo-utils/
│ │ │ ├── neo-helpers-multi-db.rkt
│ │ │ └── neo-helpers-without-db.rkt
│ │ └── readme.md
│ ├── open-api/
│ │ ├── ISB-KG-api.rkt
│ │ ├── TranslatorReasonersAPI.json
│ │ ├── TranslatorReasonersAPI.yaml
│ │ ├── api-query.rkt
│ │ ├── yaml-to-json.sh
│ │ └── yaml2json.py
│ ├── readme.md
│ ├── server.rkt
│ ├── string-search-config.rkt
│ ├── string-search-impl.rkt
│ ├── string-search-impl2.rkt
│ ├── string-search.rkt
│ ├── synonyms.rkt
│ ├── test/
│ │ ├── 10GB-CI/
│ │ │ ├── require-common-spec.rkt
│ │ │ ├── string-search-build-spec.rkt
│ │ │ ├── string-search-spec.rkt
│ │ │ ├── string-search-yeast-spec.rkt
│ │ │ └── with-yeast-sri-reference-kg-spec.rkt
│ │ ├── example_mk2_queries.rkt
│ │ ├── query_clinical_kg.rkt
│ │ ├── rtx2-20210204.rkt
│ │ └── semmed.rkt
│ ├── trapi-cli.rkt
│ ├── trapi.rkt
│ └── util/
│ ├── data-import-workaround/
│ │ └── remove_cr.pl
│ └── storage-size-workaround/
│ └── s-cerevisiae-kg-ref-ll.py
├── stuff/
│ ├── cmd-helpers.rkt
│ ├── install-data-files.rkt
│ ├── run-shell-pipelines.rkt
│ └── symlink-tree.rkt
└── trace-pathways-by-tissue-type.rkt
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/workflows/request-10GB-CI.yml
================================================
name: Request 10GB-CI
on:
push:
pull_request:
jobs:
request-10GB-CI:
runs-on: ubuntu-latest
steps:
- name: Request 10GB-CI
run: |
echo "Event '${{ github.event.action }}' received from '${{ github.event.client_payload.repository }}'"
curl -X POST https://api.github.com/repos/webyrd/mediKanren-ops/dispatches \
-H 'Accept: application/vnd.github.everest-preview+json' \
-u ${{ secrets.GH_ACCESS_TOKEN }} \
--data '{"event_type": "request-10GB-CI", "client_payload": {
"repository": "'"$GITHUB_REPOSITORY"'",
"github_sha1": "'$GITHUB_SHA1'",
"github_ref": "'$GITHUB_REF'",
"github_head_ref": "'$GITHUB_HEAD_REF'",
"github_base_ref": "'$GITHUB_BASE_REF'"
}}'
================================================
FILE: .gitignore
================================================
.DS_Store
/ci_artifacts
/code/semmed/publication-reference.scm
/code/semmed/edge-by-object
/code/semmed/edge-by-predicate
/code/semmed/edge-by-subject
/code/a.out
/biolink/pieces-parts/etl_for_new_KGs/NCT000sample
/biolink/pieces-parts/etl_for_new_KGs/NCT000sample/*.xml
medikanren/config.scm
medikanren2/config.scm
medikanren2/etc/config.scm
medikanren2/etc/config.installer.scm
*.dep
*.zo
================================================
FILE: LICENSE
================================================
The MIT License (MIT)
Copyright (c) 2017 William E. Byrd and Gregory Rosenblatt
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: Makefile
================================================
adirRepo := $(shell cd $(dir $(firstword $(MAKEFILE_LIST))) && pwd)
# https://stackoverflow.com/questions/322936/common-gnu-makefile-directory-path
default:
@echo ***available targets***: prepare_ci, run_ci, install_pkgs
prepare_ci:
@echo about to setup_artifacts
@mkdir -p $(adirRepo)/ci_artifacts
@rm -rf $(adirRepo)/ci_artifacts/status
@mkdir -p $(adirRepo)/ci_artifacts/status/pass
@touch $(adirRepo)/ci_artifacts/status/pass/empty
@mkdir -p $(adirRepo)/ci_artifacts/status/fail
@touch $(adirRepo)/ci_artifacts/status/fail/empty
@echo finished setup_artifacts
run_ci: prepare_ci
-bash $(adirRepo)/medikanren/.run_ci.sh
-bash $(adirRepo)/medikanren2/.run_ci.sh
install_pkgs:
-bash $(adirRepo)/medikanren/.install_pkgs.sh
-bash $(adirRepo)/medikanren2/.install_pkgs.sh
================================================
FILE: README.md
================================================
# mediKanren
*** FOR RESEARCH PURPOSES ONLY ***
Proof-of-concept for reasoning over medical knowledge graphs, using miniKanren + heuristics + indexing.
There are several prototypes, each in its directory:
- [`attic/code`](attic/code) is the original prototype.
- [`medikanren`](medikanren) is the working prototype.
- [`medikanren2`](medikanren2) is the next-generation prototype.
Contributed use cases, queries and applications are now located in a directory separate from medikanren itself:
- [contrib/](contrib)
If you have previously contributed code applying medikanren and can't find yours, look there.
================================================
FILE: attic/code/README.md
================================================
# mediKanren
*** FOR RESEARCH PURPOSES ONLY ***
Proof-of-concept for reasoning over the SemMedDB knowledge base, using miniKanren + heuristics + indexing.
`./code/study-imatinib.rkt` contains the most iteresting examples currently.
TODO: add SemMedDB files, along with terms of use information for SemMedDB.
TODO: add simple instructions for running the queries.
## Setup
### Download and install Racket
https://download.racket-lang.org/
### Obtain a CSV dump of SemMed DB
You'll need to obtain the full data from: https://skr3.nlm.nih.gov/SemMedDB/
A small sample, `code/sample_semmed.csv`, is provided to demonstrate the format expected for processing.
### Index the data for consumption by mediKanren
Given `semmed.csv`, Run these commands from the `code` directory:
```
mkdir semmed
racket csv-semmed-ordered-unique-enum.rkt semmed.csv semmed
racket csv-semmed-simplify.rkt semmed.csv semmed
racket semmed-index-predicate.rkt semmed
```
Depending on the size of the CSV you're using, these commands could take up to a few hours to process all records.
## Use
### Interact with the GUI
The GUI is a convenient way to express some forms of simple queries. For more power, see the section on running queries programmatically.
From the `code` directory, run `racket gui-simple.rkt` to start the GUI.
As you interact, the console will display additional information in some cases.
* When clicking on results, the corresponding PubMed URLs will be printed for your convenience. If you're running on OSX within iTerm2, you can CMD+click a URL to open it in the browser.
* When querying with synthetic predicates such as `increases[*]/decreases[*]`, the results will not be displayed in the GUI, but will instead be continuously streamed to the console.
### Run queries programmatically
Start with `code/tacrine.rkt` `code/imatinib-query.rkt`, which includes queries taken from `code/study-imatinib.rkt`, and also includes a high-level description of the queries.
Take a look at the various `study-*.rkt` files in the `code` directory for examples. You can run these from the command line, e.g., `racket study-imatinib.rkt`.
To write your own queries, either as a new `*.rkt` file or interactively, start with:
```
(require "mk-db.rkt")
```
to load the database and its indices (this will take several seconds, so be patient). Once loaded, you will have access to the full underlying miniKanren language, plus the new semmed-specific relations:
```
(concepto c)
(fuzzy-concepto name c)
(cuio c cui)
(cui*o c cui*)
(edgeo `(,subject-concept ,object-concept ,predicate ,subject-type ,object-type ,pubref))
```
which you can compose freely in queries. Being that mediKanren is an embedded DSL, you also have access to Racket for metaprogramming.
================================================
FILE: attic/code/concept.rkt
================================================
#lang racket/base
(provide
concept-cui
concept-name
concept-type
)
(define (concept-cui concept) (vector-ref concept 0))
(define (concept-name concept) (vector-ref concept 1))
(define (concept-type concept) (vector-ref concept 2))
================================================
FILE: attic/code/csv-semmed-ordered-unique-enum.rkt
================================================
#lang racket/base
(require
"csv.rkt"
(except-in racket/control set)
racket/set)
;; This is the pre-normalization pass, which generates two files:
;; * PREDICATE.scm
;; * SEMTYPE.scm
;; Each of these contains all unique string values for the corresponding
;; field types, sorted. These are mapped to numeric indices during
;; normalization.
(define argv (current-command-line-arguments))
(define argv-expected '#(IN_CSV OUT_DIR))
(when (not (= (vector-length argv-expected) (vector-length argv)))
(error 'cmd-line-args (format "expected ~s; given ~s" argv-expected argv)))
(define csv-file-name (vector-ref argv 0))
(define out-dir (vector-ref argv 1))
(define predicate-file-name (build-path out-dir "PREDICATE.scm"))
(define semtype-file-name (build-path out-dir "SEMTYPE.scm"))
(define (print-ordered-unique out-predicate out-semtype)
(define (yield record)
(define predicate (list-ref record 3))
(define subject-semtype (list-ref record 6))
(define object-semtype (list-ref record 10))
(shift k (cons (list predicate subject-semtype object-semtype) k)))
(lambda (in)
(read-line in 'any) ;; Skip header.
(let loop ((count 1)
(seen-predicate (set))
(seen-semtype (set))
(next (reset (and ((csv-records yield) in) #f))))
(when (= 0 (remainder count 100000))
(printf "processed ~s rows\n" count)
(flush-output out-predicate)
(flush-output out-semtype))
(if next
(let* ((data (car next))
(predicate (list-ref data 0))
(subject-semtype (list-ref data 1))
(object-semtype (list-ref data 2))
(k (cdr next))
(seen-predicate2
(if (set-member? seen-predicate predicate)
seen-predicate
(begin
(printf "~s\n" `(new predicate: ,predicate))
(set-add seen-predicate predicate))))
(seen-semtype2
(if (set-member? seen-semtype subject-semtype)
seen-semtype
(begin
(printf "~s\n" `(new semtype: ,subject-semtype))
(set-add seen-semtype subject-semtype))))
(seen-semtype3
(if (set-member? seen-semtype2 object-semtype)
seen-semtype2
(begin
(printf "~s\n" `(new semtype: ,object-semtype))
(set-add seen-semtype2 object-semtype)))))
(loop (+ 1 count) seen-predicate2 seen-semtype3 (k #t)))
(begin
(printf "writing files:\n~s\n~s\n"
(expand-user-path predicate-file-name)
(expand-user-path semtype-file-name))
(for ((predicate (sort (set->list seen-predicate) string<?)))
(fprintf out-predicate "~s\n" predicate))
(for ((semtype (sort (set->list seen-semtype) string<?)))
(fprintf out-semtype "~s\n" semtype)))))))
;; Print the distinct values of the indexed field.
(time (call-with-output-file
(expand-user-path predicate-file-name)
(lambda (out-predicate)
(call-with-output-file
(expand-user-path semtype-file-name)
(lambda (out-semtype)
(call-with-input-file
(expand-user-path csv-file-name)
(print-ordered-unique out-predicate out-semtype)))))))
================================================
FILE: attic/code/csv-semmed-simplify.rkt
================================================
#lang racket/base
(require
"csv.rkt"
"edge.rkt"
"read.rkt"
(except-in racket/control set)
racket/file
racket/list
racket/pretty
racket/set
racket/string
)
;; This is the first normalization pass, which generates several files:
;; * publication-reference.scm
;; ** PREDICATION_ID
;; ** SENTENCE_ID
;; ** PMID
;; * concept.scm
;; ** CUI
;; ** NAME
;; ** (list-of #(SEMTYPE NOVELTY))
;; * cui-by-semtype.scm
;; ** (SEMTYPE . (list-of CUI))
;; * edge-by-[subject,object]/
;; ** index.scm
;; *** [SUBJECT,OBJECT]_CUI
;; *** detail.bin file position of edge block for [SUBJECT,OBJECT]
;; ** detail.bin (byte-encoded)
;; *** [SUBJECT,OBJECT]_CUI (3 bytes)
;; *** [OBJECT,SUBJECT]_CUI (3 bytes)
;; *** PREDICATE (1 byte)
;; *** SUBJECT_SEMTYPE (1 byte)
;; *** OBJECT_SEMTYPE (1 byte)
;; *** PREDICATION_ID (4 bytes)
;; All PREDICATION_ID, SENTENCE_ID, PMID, CUI, NOVELTY fields have been
;; converted directly to numeric values.
;; All PREDICATE and SEMTYPE fields have been mapped to numeric indices
;; reflecting sorted order.
;; These conversions should save space and speed up loading.
(define argv (current-command-line-arguments))
(define argv-expected '#(IN_CSV OUT_DIR))
(when (not (= (vector-length argv-expected) (vector-length argv)))
(error 'cmd-line-args (format "expected ~s; given ~s" argv-expected argv)))
(define csv-file-name (vector-ref argv 0))
(define out-dir (vector-ref argv 1))
(define (make-directories* paths)
(for ((path paths))
(make-directory* (expand-user-path path))))
(define (call-with-?-file-vector cw?f base-path n proc)
(define vports (make-vector n))
(let loop ((i (- n 1)))
(if (> 0 i) (proc vports)
(cw?f (build-path base-path (number->string i))
(lambda (port) (vector-set! vports i port) (loop (- i 1)))))))
(define (call-with-output-file-vector base-path n proc)
(call-with-?-file-vector call-with-output-file base-path n proc))
(define (call-with-input-file-vector base-path n proc)
(call-with-?-file-vector call-with-input-file base-path n proc))
(define (call-with-?-files cw?f paths proc)
(let loop ((paths paths) (ports '()))
(if (null? paths) (apply proc (reverse ports))
(cw?f (car paths)
(lambda (port) (loop (cdr paths) (cons port ports)))))))
(define (call-with-output-files paths proc)
(call-with-?-files call-with-output-file paths proc))
(define edge-by-subject-dir
(expand-user-path (build-path out-dir "edge-by-subject/partitioned")))
(define edge-by-object-dir
(expand-user-path (build-path out-dir "edge-by-object/partitioned")))
(make-directories* (list edge-by-subject-dir edge-by-object-dir))
;; Use these to build enumeration mappings.
(define predicate-file-name (build-path out-dir "PREDICATE.scm"))
(define semtype-file-name (build-path out-dir "SEMTYPE.scm"))
(define (strings->string=>nat ss)
(make-immutable-hash (map cons ss (range (length ss)))))
(define predicate=>id
(strings->string=>nat (read-all-from-file predicate-file-name)))
(define semtype=>id
(strings->string=>nat (read-all-from-file semtype-file-name)))
(pretty-print `(predicate=>id ,predicate=>id))
(pretty-print `(semtype=>id ,semtype=>id))
;; Generate these.
(define out-file-paths
(map (lambda (p) (expand-user-path (build-path out-dir p)))
'("publication-reference.scm"
"concept.scm"
"cui-by-semtype.scm"
)))
(define out-edge-paths
(map (lambda (p) (expand-user-path (build-path out-dir p)))
'("edge-by-subject/index.scm"
"edge-by-subject/detail.bin"
"edge-by-object/index.scm"
"edge-by-object/detail.bin")))
(define set-empty (set))
(define (concept-add concept-by-cui concept)
(define key (vector-ref concept 0))
(define subdata0 (hash-ref concept-by-cui key set-empty))
(define subdata1 (set-add subdata0 concept))
(if (eq? subdata0 subdata1) concept-by-cui
(hash-set concept-by-cui key subdata1)))
(define (concept-sty concept) (vector-ref concept 2))
(define (sty-novelty datum) (vector (concept-sty datum) (vector-ref datum 3)))
(define (write-cui-by-semtype out concept-by-cui)
(define cui-by-semtype
(for*/fold ((cui-by-semtype (hash)))
((kv (in-hash-pairs concept-by-cui))
(sty (in-list (map concept-sty (set->list (cdr kv))))))
(hash-set cui-by-semtype sty
(cons (car kv) (hash-ref cui-by-semtype sty '())))))
(for ((sty (in-list (sort (hash-keys cui-by-semtype) <))))
(fprintf out "~s\n"
(cons sty (sort (hash-ref cui-by-semtype sty) <)))))
(define edge-cui-buckets 10)
(define (edge-partition-add vout edge)
(define cui (edge-src edge))
(define key (cond ((< 1000000 cui) 9)
((< 400000 cui) 8)
((< 200000 cui) 7)
((< 50000 cui) 6)
((< 40000 cui) 5)
((< 30000 cui) 4)
((< 20000 cui) 3)
((< 10000 cui) 2)
((< 5000 cui) 1)
(else 0)))
(write-bytes (edge->bytes edge) (vector-ref vout key)))
;; At least one PUBMED_ID is corrupted: PREDICATION_ID=57715160: "20126278 [3]"
(define (robust-string->number s)
(or (string->number s) (string->number (car (string-split s)))))
(define (print-pubref/concept/edge
vebs-out vebo-out out-pubref out-concept out-cui-by-semtype)
(define (yield record)
(define pubref (list->vector (map robust-string->number (take record 3))))
(define (concept xs) ;; CUI, NAME, SEMTYPE, NOVELTY
(define cui (string->number (substring (car xs) 1)))
(define semtype (hash-ref semtype=>id (caddr xs)))
(vector cui (cadr xs) semtype (string->number (cadddr xs))))
(define concepts (drop record 4))
(define subject (concept (take concepts 4)))
(define object (concept (drop concepts 4)))
(define edge (vector (vector-ref subject 0)
(vector-ref object 0)
(hash-ref predicate=>id (car (drop record 3)))
(vector-ref subject 2)
(vector-ref object 2)
(vector-ref pubref 2)))
(shift k (cons (list pubref subject object edge) k)))
(lambda (in)
(read-line in 'any) ;; Skip header.
(let loop ((count 1)
(concept-by-cui (hash))
(next (reset (and ((csv-records yield) in) #f))))
(when (= 0 (remainder count 100000))
(printf "processed ~s rows\n" count)
(flush-output out-pubref))
(if next
(let* ((data (car next))
(pubref (list-ref data 0))
(subject (list-ref data 1))
(object (list-ref data 2))
(edge (list-ref data 3))
(k (cdr next)))
(fprintf out-pubref "~s\n" pubref)
(edge-partition-add vebs-out edge)
(edge-partition-add vebo-out (edge-reverse edge))
(loop (+ 1 count)
(concept-add (concept-add concept-by-cui subject) object)
(k #t)))
(begin
(printf "Found ~s concepts\n" (hash-count concept-by-cui))
(for ((key (in-list (sort (hash-keys concept-by-cui) <))))
(define kdata (set->list (hash-ref concept-by-cui key)))
(define kdata0 (car kdata))
(fprintf out-concept "~s\n" (vector (vector-ref kdata0 0)
(vector-ref kdata0 1)
(map sty-novelty kdata))))
(flush-output out-concept)
(write-cui-by-semtype out-cui-by-semtype concept-by-cui)
(flush-output out-cui-by-semtype))))))
(time (call-with-output-files
out-file-paths
(lambda out*
(call-with-output-file-vector
edge-by-subject-dir edge-cui-buckets
(lambda (vebs-out)
(call-with-output-file-vector
edge-by-object-dir edge-cui-buckets
(lambda (vebo-out)
(call-with-input-file
(expand-user-path csv-file-name)
(apply print-pubref/concept/edge
vebs-out vebo-out out*)))))))))
(define (edge-add edges edge)
(define key (edge-src (bytes->edge edge)))
(hash-set edges key (cons edge (hash-ref edges key '()))))
(define (write-edges offset edges out-index out-detail)
(for/fold ((offset offset))
((key (in-list (sort (hash-keys edges) <))))
(define es (hash-ref edges key))
(for ((e (in-list (sort es bytes<?)))) (write-bytes e out-detail))
(fprintf out-index "~s\n" (cons key offset))
(+ offset (* edge-byte-size (length es)))))
(define (edges-index out-index out-detail vin)
(for/fold ((offset 0))
((i (range (vector-length vin))) (in (in-vector vin)))
(define edges (for/fold ((edges (hash)))
((edge (read-edge-bytes-all/stream in)))
(edge-add edges edge)))
(printf "Processing ~s edge buckets in partition ~s\n"
(hash-count edges) i)
(write-edges offset edges out-index out-detail))
(flush-output out-index)
(flush-output out-detail))
(time (call-with-output-files
out-edge-paths
(lambda (out-ebs-index out-ebs-detail out-ebo-index out-ebo-detail)
(call-with-input-file-vector
edge-by-subject-dir edge-cui-buckets
(lambda (vebs-in)
(call-with-input-file-vector
edge-by-object-dir edge-cui-buckets
(lambda (vebo-in)
(displayln "Building edges-by-subject")
(edges-index out-ebs-index out-ebs-detail vebs-in)
(displayln "Building edges-by-object")
(edges-index out-ebo-index out-ebo-detail vebo-in))))))))
================================================
FILE: attic/code/csv-semmed-validate-cuis.rkt
================================================
#lang racket/base
(require
"csv.rkt"
racket/list
)
(define argv (current-command-line-arguments))
(define argv-expected '#(IN_CSV))
(when (not (= (vector-length argv-expected) (vector-length argv)))
(error 'cmd-line-args (format "expected ~s; given ~s" argv-expected argv)))
(define csv-file-name (vector-ref argv 0))
(define count 0)
(define (validate record)
(define (concept xs) ;; CUI, NAME, SEMTYPE, NOVELTY
(when (not (equal? "C" (substring (car xs) 0 1)))
(error 'concept (format "unexpected CUI ~s" (car xs)))))
(define concepts (drop record 4))
(concept (take concepts 4)) ;; subject
(concept (drop concepts 4)) ;; object
(set! count (+ count 1))
(when (= 0 (remainder count 100000)) (printf "processed ~s rows\n" count)))
(time (call-with-input-file
(expand-user-path csv-file-name)
(lambda (in)
(read-line in 'any)
((csv-records validate) in))))
================================================
FILE: attic/code/csv.rkt
================================================
#lang racket/base
(provide
csv-records
set-field-separator!
)
;; Informal CSV Grammar
;RECORD-SEPARATOR ::= \r\n | \n | \r
;record-stream ::= EOF | record EOF | record RECORD-SEPARATOR record-stream
;record ::= field | field FIELD-SEPARATOR record
;field ::= \" inner-content* \" | CONTENT*
;inner-content ::= CONTENT | \"\" | FIELD-SEPARATOR | WHITESPACE
;; CONTENT includes anything other than double-quote, field separator, whitespace
(define *field-separator* #\,)
(define (set-field-separator! ch) (set! *field-separator* ch))
(define (end-of-record?! in)
(define ch (peek-char in))
(or (and (char=? #\return ch)
(or (and (char=? #\newline (peek-char in 1)) (read-string 2 in) #t)
(and (read-char in) #t)))
(and (char=? #\newline ch) (read-char in) #t)
(eof-object? ch)))
(define (end-of-field?! in)
(define ch (peek-char in))
(or (and (char=? *field-separator* ch) (read-char in) #t)
(char=? #\return ch) (char=? #\newline ch) (eof-object? ch)))
(define (field-quoted-begin?! in)
(define ch (peek-char in))
(and (char=? #\" ch) (read-char in) #t))
(define (field-quoted-end?! in)
(define ch (peek-char in))
(and (char=? #\" ch) (read-char in) (not (char=? #\" (peek-char in)))))
(define (csv-records yield-record!)
(lambda (in)
(let record-stream ()
(when (not (eof-object? (peek-char in)))
(yield-record!
(let record ()
(if (end-of-record?! in) '()
(cons (list->string
(let field ()
(cond ((end-of-field?! in) '())
((field-quoted-begin?! in)
(let field-quoted ()
(if (field-quoted-end?! in) (field)
(cons (read-char in) (field-quoted)))))
(else (cons (read-char in) (field))))))
(record)))))
(record-stream)))))
;; Test using:
;; (call-with-input-file PATH
;; (csv-records (lambda (record) (printf "~s\n" `(record: ,record)))))
================================================
FILE: attic/code/db.rkt
================================================
#lang racket/base
(provide
id=>predicate
predicate=>id
id=>semtype
semtype=>id
semtype-id=>cui*
concept*
cui=>concept
fuzzy-name->concept*
fuzzy-name*->concept*
subject->edge*
object->edge*
subject&object->edge*
subject*->edge*
object*->edge*
subject*&object*->edge*
subject->edge*/stream
object->edge*/stream
predicate->edge*/stream
edge*/stream
concept-pretty
edge-pretty
direct-edge*
count-ISA
)
(require
"concept.rkt"
"edge.rkt"
"read.rkt"
racket/list
racket/stream
racket/string
)
(define (file->hash path) (make-immutable-hash (read-all-from-file path)))
(define (file->id=>name path)
(define x* (read-all-from-file path))
(make-immutable-hash (map cons (range (length x*)) x*)))
(define (file->name=>id path)
(define x* (read-all-from-file path))
(make-immutable-hash (map cons x* (range (length x*)))))
(define id=>predicate (file->id=>name "semmed/PREDICATE.scm"))
(define predicate=>id (file->name=>id "semmed/PREDICATE.scm"))
(define id=>semtype (file->id=>name "semmed/SEMTYPE.scm"))
(define semtype=>id (file->name=>id "semmed/SEMTYPE.scm"))
(define semtype-id=>cui* (file->hash "semmed/cui-by-semtype.scm"))
(define concept* (read-all-from-file "semmed/concept.scm"))
(define cui=>concept
(make-immutable-hash (map (lambda (c) (cons (concept-cui c) c)) concept*)))
(define (fuzzy-name->concept* concept* name case-insensitive?)
(define needle (if case-insensitive? (string-downcase name) name))
(define c->name (if case-insensitive?
(lambda (c) (string-downcase (concept-name c)))
concept-name))
(filter (lambda (c) (string-contains? (c->name c) needle)) concept*))
(define (fuzzy-name*->concept* concept* names case-insensitive?)
(foldl (lambda (n c*) (fuzzy-name->concept* c* n case-insensitive?))
concept* names))
(define subject=>pos (file->hash "semmed/edge-by-subject/index.scm"))
(define in-detail-ebs (open-input-file "semmed/edge-by-subject/detail.bin"))
(define object=>pos (file->hash "semmed/edge-by-object/index.scm"))
(define in-detail-ebo (open-input-file "semmed/edge-by-object/detail.bin"))
(define predicate=>pos (file->hash "semmed/edge-by-predicate/index.scm"))
(define in-detail-ebp (open-input-file "semmed/edge-by-predicate/detail.bin"))
(define (maybe-bytes->edge bs) (if (eof-object? bs) bs (bytes->edge bs)))
(define (edge*-contiguous pos in-detail continue? p?)
(file-position in-detail pos)
(let loop ((edge (maybe-bytes->edge (read-edge-bytes in-detail))))
(if (and (not (eof-object? edge)) (continue? edge))
(if (p? edge)
(let build-edge ((pubs (list (edge-pub-info edge))))
(define e-next (maybe-bytes->edge (read-edge-bytes in-detail)))
(if (edge-meaning=? edge e-next)
(build-edge (cons (edge-pub-info e-next) pubs))
(cons (edge-pubrefs-set edge pubs) (loop e-next))))
(loop (maybe-bytes->edge (read-edge-bytes in-detail))))
'())))
(define (cui->edge* cui=>pos in-detail cui p?)
(define (cui-matches? e) (= cui (edge-src e)))
(define pos (hash-ref cui=>pos cui #f))
(if pos (edge*-contiguous pos in-detail cui-matches? p?) '()))
(define (subject->edge* cui p?)
(cui->edge* subject=>pos in-detail-ebs cui p?))
(define (object->edge* cui p?)
(cui->edge* object=>pos in-detail-ebo cui p?))
(define (subject&object->edge* cui-s cui-o p?)
(subject->edge* cui-s (lambda (e) (and (= cui-o (edge-dst e)) (p? e)))))
(define (subject*->edge* cui* p?)
(for/fold ((edge* '())) ((cui cui*)) (append (subject->edge* cui p?) edge*)))
(define (object*->edge* cui* p?)
(for/fold ((edge* '())) ((cui cui*)) (append (object->edge* cui p?) edge*)))
(define (subject*&object*->edge* cui-s* cui-o* p?)
(for*/fold ((edge* '()))
((cui-s cui-s*) (cui-o cui-o*))
(append (subject&object->edge* cui-s cui-o p?) edge*)))
(define (edge*-contiguous/stream pos in-detail continue? p?)
(let loop ((pos pos) (set-pos? #t))
(define edge (begin (when set-pos? (file-position in-detail pos))
(maybe-bytes->edge (read-edge-bytes in-detail))))
(define pos-next (+ pos edge-byte-size))
(if (and (not (eof-object? edge)) (continue? edge))
(if (p? edge)
(let build-edge ((pos pos-next) (pubs (list (edge-pub-info edge))))
(define e-next (maybe-bytes->edge (read-edge-bytes in-detail)))
(if (edge-meaning=? edge e-next)
(build-edge (+ pos edge-byte-size)
(cons (edge-pub-info e-next) pubs))
(stream-cons (edge-pubrefs-set edge pubs) (loop pos #t))))
(loop pos-next #f))
'())))
(define (cui->edge*/stream cui=>pos in-detail cui p?)
(define (cui-matches? e) (= cui (edge-src e)))
(define pos (hash-ref cui=>pos cui #f))
(if pos (edge*-contiguous/stream pos in-detail cui-matches? p?) '()))
(define (subject->edge*/stream cui p?)
(cui->edge*/stream subject=>pos in-detail-ebs cui p?))
(define (object->edge*/stream cui p?)
(cui->edge*/stream object=>pos in-detail-ebo cui p?))
(define (predicate->edge*/stream predicate subject-type object-type p?)
(define (edge*/stream pos set-pos?)
(define edge (begin (when set-pos? (file-position in-detail-ebp pos))
(maybe-bytes->edge (read-edge-bytes in-detail-ebp))))
(define pos-next (+ pos edge-byte-size))
(if (and (not (eof-object? edge))
(= predicate (edge-predicate edge))
(= subject-type (edge-src-type edge))
(= object-type (edge-dst-type edge)))
(if (p? edge)
(stream-cons edge (edge*/stream pos-next #t))
(edge*/stream pos-next #f))
'()))
(define pos (hash-ref predicate=>pos
(vector predicate subject-type object-type) #f))
(if pos (edge*/stream pos #t) '()))
(define (edge*/stream p?)
(edge*-contiguous/stream 0 in-detail-ebs (lambda (_) #t) p?))
(define (concept-pretty c)
(vector (concept-cui c) (concept-name c)
(map (lambda (tn) (vector (hash-ref id=>semtype (vector-ref tn 0))
(vector-ref tn 1)))
(concept-type c))))
(define (edge-pretty e)
(vector (concept-pretty (hash-ref cui=>concept (edge-src e)))
(concept-pretty (hash-ref cui=>concept (edge-dst e)))
(hash-ref id=>predicate (edge-predicate e))
(hash-ref id=>semtype (edge-src-type e))
(hash-ref id=>semtype (edge-dst-type e))
(edge-pub-info e)))
(define (direct-edge* c*1 c*2)
(map edge-pretty (subject*&object*->edge* (map concept-cui c*1)
(map concept-cui c*2)
(lambda (e) #t))))
(define predicate-id-ISA (hash-ref predicate=>id "ISA"))
(define (count-ISA cui)
(define (edge-ISA? e) (= predicate-id-ISA (edge-predicate e)))
(length (cui->edge* object=>pos in-detail-ebo cui edge-ISA?)))
================================================
FILE: attic/code/edge.rkt
================================================
#lang racket/base
(provide
bytes->edge
edge->bytes
edge-byte-size
edge-dst
edge-src
edge-predicate
edge-src-type
edge-dst-type
edge-pub-info
edge-meaning=?
edge-pubrefs-set
edge-reverse
read-edge-bytes
read-edge-bytes-all/stream
)
(require
"read.rkt"
racket/stream
)
;; 2 * 3-byte CUI + 1-byte predicate + 2 * 1-byte semtypes + 4-byte pubref
(define edge-byte-size (+ (* 2 3) 1 2 4))
(define (byte-at offset n) (bitwise-and 255 (arithmetic-shift n offset)))
(define (edge->bytes e)
(define c0 (vector-ref e 0))
(define c1 (vector-ref e 1))
(define pid (vector-ref e 5))
(bytes (byte-at -16 c0) (byte-at -8 c0) (byte-at 0 c0)
(byte-at -16 c1) (byte-at -8 c1) (byte-at 0 c1)
(vector-ref e 2) (vector-ref e 3) (vector-ref e 4)
(byte-at -24 pid) (byte-at -16 pid) (byte-at -8 pid) (byte-at 0 pid)))
(define (bytes->edge bs)
(define (bref pos) (bytes-ref bs pos))
(define (bref-to pos offset) (arithmetic-shift (bref pos) offset))
(define (bcui pos)
(+ (bref-to pos 16) (bref-to (+ 1 pos) 8) (bref-to (+ 2 pos) 0)))
(vector (bcui 0) (bcui 3) (bref 6) (bref 7) (bref 8)
(+ (bref-to 9 24) (bref-to 10 16) (bref-to 11 8) (bref-to 12 0))))
(define (edge-src edge) (vector-ref edge 0))
(define (edge-dst edge) (vector-ref edge 1))
(define (edge-predicate edge) (vector-ref edge 2))
(define (edge-src-type edge) (vector-ref edge 3))
(define (edge-dst-type edge) (vector-ref edge 4))
(define (edge-pub-info edge) (vector-ref edge 5))
(define (edge-meaning=? e1 e2)
(and (= (edge-src e1) (edge-src e2))
(= (edge-dst e1) (edge-dst e2))
(= (edge-predicate e1) (edge-predicate e2))
(= (edge-src-type e1) (edge-src-type e2))
(= (edge-dst-type e1) (edge-dst-type e2))))
(define (edge-pubrefs-set edge pubrefs)
(vector (edge-src edge)
(edge-dst edge)
(edge-predicate edge)
(edge-src-type edge)
(edge-dst-type edge)
pubrefs))
(define (edge-reverse edge)
(vector (edge-dst edge) (edge-src edge) (edge-predicate edge)
(edge-dst-type edge) (edge-src-type edge) (edge-pub-info edge)))
(define (read-edge-bytes in) (read-bytes edge-byte-size in))
(define (read-edge-bytes-all/stream in)
(define ebs (read-edge-bytes in))
(if (eof-object? ebs) '() (stream-cons ebs (read-edge-bytes-all/stream in))))
================================================
FILE: attic/code/gui-simple.rkt
================================================
#lang racket
(require
racket/sandbox
racket/gui/base
racket/engine
racket/date
"db.rkt"
"mk-db.rkt"
"concept.rkt"
"edge.rkt"
"programmatically-defined-relations.rkt"
)
(provide
launch-gui)
(displayln "Starting mediKanren...")
(newline)
(displayln "************************************************")
(displayln "*** mediKanren is for research purposes only ***")
(displayln "************************************************")
(newline)
(displayln
"Finished loading mk-db.rkt")
;; Add https://www.ncbi.nlm.nih.gov/pubmed/ in front of a PubMed ID to get a working URL. For example,
;;
;; ((1429928
;; "erythrocyte membrane protein 1, Plasmodium falciparum"
;; ("gngm" "aapp" "imft"))
;; (1368474 "rosetting" ("celf"))
;; "AFFECTS"
;; "aapp"
;; "celf"
;; (25482886 19546191 10828049))
;;
;; corresponds to the URLs
;;
;; https://www.ncbi.nlm.nih.gov/pubmed/25482886
;; https://www.ncbi.nlm.nih.gov/pubmed/19546191
;; https://www.ncbi.nlm.nih.gov/pubmed/10828049
(define *verbose* #t)
;;; window size
(define HORIZ-SIZE 800)
(define VERT-SIZE 400)
(define input-response-latency 50)
(define MAX-CHAR-WIDTH 100)
(define DECREASES_PREDICATE_STRING "decreases [synthetic]")
(define INCREASES_PREDICATE_STRING "increases [synthetic]")
(define DECREASES_STAR_PREDICATE_STRING "decreases* [synthetic]")
(define INCREASES_STAR_PREDICATE_STRING "increases* [synthetic]")
(define synthetic-relations
`((,DECREASES_PREDICATE_STRING . ,decreases)
(,INCREASES_PREDICATE_STRING . ,increases)
(,DECREASES_STAR_PREDICATE_STRING . ,decreases*)
(,INCREASES_STAR_PREDICATE_STRING . ,increases*)))
(define SYNTHETIC_PREDICATE_STRINGS (list DECREASES_PREDICATE_STRING
INCREASES_PREDICATE_STRING
DECREASES_STAR_PREDICATE_STRING
INCREASES_STAR_PREDICATE_STRING))
(define *concept-1-name-string* (box ""))
(define *concept-2-name-string* (box ""))
(define *concept-1-isa-flag* (box #f))
(define *concept-2-isa-flag* (box #f))
(define *concept-1-choices* (box '()))
(define *concept-2-choices* (box '()))
(define *concept-X-choices* (box '()))
(define *predicate-1-choices* (box '()))
(define *predicate-2-choices* (box '()))
(define *full-path-choices* (box '()))
;; saved choices used to generate
;; paths when clicking on a concept in the X list box.
(define *solution-concept-1-name-string* (box ""))
(define *solution-concept-2-name-string* (box ""))
(define *solution-concept-1-isa-flag* (box #f))
(define *solution-concept-2-isa-flag* (box #f))
(define *solution-concept-1-choices* (box '()))
(define *solution-concept-2-choices* (box '()))
(define *solution-predicate-1-choices* (box '()))
(define *solution-predicate-2-choices* (box '()))
(define (path-confidence p)
(define (weight-linear+1 n) (+ 1 n))
(define (weight-exponential n) (expt 2 n))
;; To experiment with sorting, try to only change the weight calculation
;; being used. Leave everything else the same.
(define weight weight-exponential)
(define (pubmed-count e)
(match e
[`(,subj ,obj ,pred ,subj-type ,obj-type ,pubmed*)
;; (printf "p1 x: ~s unique pubmed length: ~s\n" x (remove-duplicates pubmed*))
(length (remove-duplicates pubmed*))]))
(define (confidence/edge e) (- 1 (/ 1.0 (weight (pubmed-count e)))))
(foldl * 1 (map confidence/edge p)))
(define (path-confidence<? p1 p2)
(< (path-confidence p1) (path-confidence p2)))
(define (sort-paths paths) (sort paths path-confidence<?))
(define (remove-duplicate-pubrefs/edge e)
(match e
(`(,subj ,obj ,pred ,subj-type ,obj-type ,pubmed*)
`(,subj ,obj ,pred ,subj-type ,obj-type ,(remove-duplicates pubmed*)))))
(define (remove-duplicate-pubrefs/path p)
(map remove-duplicate-pubrefs/edge p))
(define (concept-list parent parent-search/isa-panel parent-list-boxes-panel label name-string isa-flag choices predicate-list-box-thunk predicate-choices edge-type)
(define name-field (new text-field%
(label label)
(parent parent-search/isa-panel)
(init-value "")
(callback (lambda (self event)
(define name (send self get-value))
(set-box! name-string name)
(set-box! predicate-choices '())
(send (predicate-list-box-thunk) set '())
(handle)))))
(define isa-field (new check-box%
(parent parent-search/isa-panel)
(label "Include ISA-related concepts")
(value #f)
(callback (lambda (self event) (handle)))))
(define concept-listbox (new list-box%
(label label)
(choices '())
(columns '("CUI" "Concept Type*" "Name"))
(parent parent-list-boxes-panel)
(style '(column-headers extended))
(callback (lambda (self event)
(define selections (send self get-selections))
(define selected-concepts (foldr (lambda (i l) (cons (list-ref (unbox choices) i) l)) '() selections))
(when *verbose*
(printf "selected concepts:\n~s\n" selected-concepts))
(define predicates
(sort
(remove-duplicates
(run* (predicate)
(fresh (e s o st ot pubref)
(== e `(,s ,o ,predicate ,st ,ot ,pubref))
(case edge-type
[(in-edge)
(membero o selected-concepts)]
[(out-edge)
(membero s selected-concepts)]
[else (error 'concept-listbox/predicates)])
(edgeo e))))
string<?))
(set! predicates (append
(list
DECREASES_PREDICATE_STRING
INCREASES_PREDICATE_STRING
DECREASES_STAR_PREDICATE_STRING
INCREASES_STAR_PREDICATE_STRING)
predicates))
;(printf "predicates: ~s\n" predicates)
(set-box! predicate-choices predicates)
(send (predicate-list-box-thunk) set predicates)))))
(define (mk-run)
(let ((ans (if (equal? current-name "")
'()
(run* (q) (fuzzy-concepto current-name q)))))
;; (printf "include-ISA: ~s\n" current-isa)
(let* ((isa-ans (if (and (not (equal? current-name "")) current-isa)
(begin
;; (printf "include-ISA is checked and current-name is non-empty!\n")
;; only grab the first 50
(let ((a (remove-duplicates
(run 50 (s)
(fresh (o st ot rest e)
(membero o ans)
(== `(,s ,o "ISA" ,st ,ot . ,rest) e)
(edgeo e))))))
a))
'()))
(ans (remove-duplicates (append ans isa-ans))))
(set-box! choices ans)
(send concept-listbox
set
(map (lambda (x)
(match x
[`(,cui ,name ,concept-type*)
(format "~a" cui)]))
ans)
(map (lambda (x)
(match x
[`(,cui ,name ,concept-type*)
(let ((concept-type*
(sort concept-type* string<?)))
(format "~a" concept-type*))]))
ans)
(map (lambda (x)
(match x
[`(,cui ,name ,concept-type*)
(~a name #:max-width MAX-CHAR-WIDTH #:limit-marker "...")]))
ans))
;; unselect all items
(for ([i (length ans)])
(send concept-listbox select i #f)))))
(define current-name "")
(define current-isa #f)
(define pending-name current-name)
(define mk-thread #f)
(define timer (new timer% (notify-callback
(lambda () (set! mk-thread (thread mk-run))))))
(define (handle)
(define new-name (send name-field get-value))
(define new-isa (send isa-field get-value))
(when (not (and (equal? current-name new-name)
(equal? current-isa new-isa)))
(set! current-name new-name)
(set! current-isa new-isa)
(set-box! isa-flag current-isa)
(and mk-thread (begin (kill-thread mk-thread) (set! mk-thread #f)))
(send timer stop)
(send timer start input-response-latency #t)))
concept-listbox)
(define (launch-gui)
(let ((frame (new frame%
(label "mediKanren Explorer v0.1")
(width HORIZ-SIZE)
(height VERT-SIZE))))
(define concept-1-search/isa-panel (new horizontal-panel%
(parent frame)
(alignment '(left center))
(stretchable-height #f)))
(define concept-1-list-boxes-panel (new horizontal-panel%
(parent frame)
(alignment '(left center))))
(define concept-1-list-box (concept-list frame concept-1-search/isa-panel concept-1-list-boxes-panel "Concept 1" *concept-1-name-string* *concept-1-isa-flag* *concept-1-choices* (lambda () predicate-1-list-box) *predicate-1-choices* 'out-edge))
(define predicate-1-list-box (new list-box%
(label "Predicate 1")
(choices (unbox *predicate-1-choices*))
(columns '("Name"))
(parent concept-1-list-boxes-panel)
(style '(extended))
(callback (lambda (button event)
(void)))))
(define edge-description (new message%
(parent frame)
(label "Concept 1 -> Predicate 1 -> [X] -> Predicate 2 -> Concept 2")))
(define concept-2-search/isa-panel (new horizontal-panel%
(parent frame)
(alignment '(left center))
(stretchable-height #f)))
(define concept-2-list-boxes-panel (new horizontal-panel%
(parent frame)
(alignment '(left center))))
(define predicate-2-list-box (new list-box%
(label "Predicate 2")
(choices (unbox *predicate-2-choices*))
(columns '("Name"))
(parent concept-2-list-boxes-panel)
(style '(extended))
(callback (lambda (button event)
(void)))))
(define concept-2-list-box (concept-list frame concept-2-search/isa-panel concept-2-list-boxes-panel "Concept 2" *concept-2-name-string* *concept-2-isa-flag* *concept-2-choices* (lambda () predicate-2-list-box) *predicate-2-choices* 'in-edge))
(define go-button (new button%
(parent frame)
(label "go!")
(callback (lambda (button event)
(send running-status-description set-label "Running...")
(define concept-1-selections (send concept-1-list-box get-selections))
(define concept-2-selections (send concept-2-list-box get-selections))
(define concept-1-selected-concepts (foldr (lambda (i l) (cons (list-ref (unbox *concept-1-choices*) i) l)) '() concept-1-selections))
(define concept-2-selected-concepts (foldr (lambda (i l) (cons (list-ref (unbox *concept-2-choices*) i) l)) '() concept-2-selections))
#|
(printf "concept-1-selections: ~s\n" concept-1-selections)
(displayln concept-1-selected-concepts)
(printf "---------------------------------\n")
(printf "concept-2-selections: ~s\n" concept-2-selections)
(displayln concept-2-selected-concepts)
(printf "---------------------------------\n")
|#
(define predicate-1-selections (send predicate-1-list-box get-selections))
(define predicate-2-selections (send predicate-2-list-box get-selections))
(define predicate-1-selected-predicates (foldr (lambda (i l) (cons (list-ref (unbox *predicate-1-choices*) i) l)) '() predicate-1-selections))
(define predicate-2-selected-predicates (foldr (lambda (i l) (cons (list-ref (unbox *predicate-2-choices*) i) l)) '() predicate-2-selections))
#|
(printf "predicate-1-selections: ~s\n" predicate-1-selections)
(displayln predicate-1-selected-predicates)
(printf "---------------------------------\n")
(printf "predicate-2-selections: ~s\n" predicate-2-selections)
(displayln predicate-2-selected-predicates)
(printf "---------------------------------\n")
|#
(find-X-concepts concept-1-selected-concepts
concept-2-selected-concepts
predicate-1-selected-predicates
predicate-2-selected-predicates
concept-X-list-box
running-status-description
full-path-list-box)))))
(define running-status-description (new message%
(parent frame)
(label " ")))
(define concept-X-list-box (new list-box%
(label "X")
(choices (unbox *concept-X-choices*))
(columns '("CUI" "Concept Type*" "Name"))
(parent frame)
(style '(column-headers single))
(callback (lambda (button event)
(let ((sel* (send concept-X-list-box get-selections)))
(when (= (length sel*) 1)
(let ((selected-X (list-ref (unbox *concept-X-choices*) (car sel*))))
;; (printf "selected ~s\n" selected-X)
(define concept-1* (unbox *solution-concept-1-choices*))
(define concept-2* (unbox *solution-concept-2-choices*))
;; (printf "concept-1* ~s\n" concept-1*)
;; (printf "concept-2* ~s\n" concept-2*)
(define predicate-1* (unbox *solution-predicate-1-choices*))
(define predicate-2* (unbox *solution-predicate-2-choices*))
;; (printf "predicate-1* ~s\n" predicate-1*)
;; (printf "predicate-2* ~s\n" predicate-2*)
(define atomic/synthetic-predicate-1* (split-atomic/synthetic-predicates predicate-1*))
(define atomic/synthetic-predicate-2* (split-atomic/synthetic-predicates predicate-2*))
(define atomic-predicate-1* (car atomic/synthetic-predicate-1*))
(define atomic-predicate-2* (car atomic/synthetic-predicate-2*))
(define synthetic-predicate-1* (cadr atomic/synthetic-predicate-1*))
(define synthetic-predicate-2* (cadr atomic/synthetic-predicate-2*))
(define paths '())
(cond
[(and (equal? (unbox *solution-concept-1-name-string*) "")
(equal? (unbox *solution-concept-2-name-string*) ""))
(set! paths '())]
[(equal? (unbox *solution-concept-1-name-string*) "")
(set! paths '())
;; run synthetic queries here
(set! paths
(remove-duplicates
(append paths
(run* (q)
(fresh (e2
x
o p2 t2 t3 r2)
(== (list e2) q)
(== selected-X x)
(== e2 `(,x ,o ,p2 ,t2 ,t3 ,r2))
(membero o concept-2*)
(membero p2 atomic-predicate-2*)
(edgeo e2)
)))))]
[(equal? (unbox *solution-concept-2-name-string*) "")
(set! paths '())
;; run synthetic queries here
(set! paths
(remove-duplicates
(append paths
(run* (q)
(fresh (e1
x
s
p1 ts t1 r1)
(== (list e1) q)
(== selected-X x)
(== e1 `(,s ,x ,p1 ,ts ,t1 ,r1))
(membero s concept-1*)
(membero p1 atomic-predicate-1*)
(edgeo e1)
)))))]
[else
(set! paths '())
;; run synthetic queries here
(set! paths
(remove-duplicates
(append paths
(run* (e1 e2)
(fresh (x
s
o p1 p2 ts t1 t2 t3 r1 r2)
(== selected-X x)
(== e1 `(,s ,x ,p1 ,ts ,t1 ,r1))
(== e2 `(,x ,o ,p2 ,t2 ,t3 ,r2))
(membero s concept-1*)
(membero o concept-2*)
(membero p1 atomic-predicate-1*)
(membero p2 atomic-predicate-2*)
(edgeo e1)
(edgeo e2)
)))))])
;; (printf "sorting paths: ~s\n" paths)
;; This sorting affects the order of the "Path" list for the selected concept.
(set! paths (map remove-duplicate-pubrefs/path (sort-paths paths)))
;; (printf "sorted paths: ~s\n" paths)
(define flattened-paths
(let ((ls (foldr
(lambda (p l)
(cons
(list "----" "----" "----" "----" "----" "----")
(append (reverse p) l)))
'()
paths)))
(if (null? ls)
;; ls should never be null!
'()
(reverse (cdr ls)))))
(define full-path-subj-list
(map (lambda (x)
(match x
[`(,subj ,obj ,pred ,subj-type ,obj-type ,pubmed*)
(~a subj #:max-width MAX-CHAR-WIDTH #:limit-marker "...")]))
flattened-paths))
(define full-path-obj-list
(map (lambda (x)
(match x
[`(,subj ,obj ,pred ,subj-type ,obj-type ,pubmed*)
(~a obj #:max-width MAX-CHAR-WIDTH #:limit-marker "...")]))
flattened-paths))
(define full-path-pred-list
(map (lambda (x)
(match x
[`(,subj ,obj ,pred ,subj-type ,obj-type ,pubmed*)
(~a pred #:max-width MAX-CHAR-WIDTH #:limit-marker "...")]))
flattened-paths))
(define full-path-subj-type-list
(map (lambda (x)
(match x
[`(,subj ,obj ,pred ,subj-type ,obj-type ,pubmed*)
(~a subj-type #:max-width MAX-CHAR-WIDTH #:limit-marker "...")]))
flattened-paths))
(define full-path-obj-type-list
(map (lambda (x)
(match x
[`(,subj ,obj ,pred ,subj-type ,obj-type ,pubmed*)
(~a obj-type #:max-width MAX-CHAR-WIDTH #:limit-marker "...")]))
flattened-paths))
(define full-path-pubmed*-list
(map (lambda (x)
(match x
[`(,subj ,obj ,pred ,subj-type ,obj-type ,pubmed*)
(~a pubmed* #:max-width MAX-CHAR-WIDTH #:limit-marker "...")]))
flattened-paths))
(send full-path-list-box
set
full-path-subj-list
full-path-obj-list
full-path-pred-list
full-path-subj-type-list
full-path-obj-type-list
full-path-pubmed*-list)
(set-box! *full-path-choices* flattened-paths)
;; unselect all items
(for ([i (length flattened-paths)])
(send full-path-list-box select i #f))
))
(void))))))
(define full-path-list-box (new list-box%
(label "Paths")
(choices (unbox *full-path-choices*))
(columns '("Subject" "Object" "Predicate" "Subj Type" "Obj Type" "PubMed IDs"))
(parent frame)
(style '(column-headers extended))
(callback (lambda (self event)
;; (when *verbose*
;; (printf "(unbox *full-path-choices*):\n~s\n" (unbox *full-path-choices*)))
(define selections (send self get-selections))
(when *verbose*
(printf "selection for full path:\n~s\n" selections))
(define selected-full-paths (foldr (lambda (i l) (cons (list-ref (unbox *full-path-choices*) i) l)) '() selections))
(when *verbose*
(printf "selected full path:\n")
(for-each
(lambda (x)
(match x
[`(,subj ,obj ,pred ,subj-type ,obj-type ,pubmed*)
(let ((pubmed* (if (list? pubmed*)
(map (lambda (pubmed-id) (string-append "https://www.ncbi.nlm.nih.gov/pubmed/" (~a pubmed-id)))
pubmed*)
pubmed*)))
(pretty-print `(,subj ,obj ,pred ,subj-type ,obj-type ,pubmed*)))]))
selected-full-paths))
))))
(send frame show #t)
))
(define (split-atomic/synthetic-predicates predicate*)
(define atomic-predicate* predicate*)
(define synthetic-predicate* '())
(set! synthetic-predicate* (filter (lambda (pred) (member pred SYNTHETIC_PREDICATE_STRINGS))
atomic-predicate*))
(when (member DECREASES_PREDICATE_STRING atomic-predicate*)
(set! atomic-predicate* (cons "INHIBITS" (cons "PREVENTS" (cons "TREATS" atomic-predicate*))))
(set! synthetic-predicate* (remove DECREASES_PREDICATE_STRING synthetic-predicate*)))
(when (member INCREASES_PREDICATE_STRING atomic-predicate*)
(set! atomic-predicate* (cons "STIMULATES" (cons "AUGMENTS" (cons "CAUSES" atomic-predicate*))))
(set! synthetic-predicate* (remove INCREASES_PREDICATE_STRING synthetic-predicate*)))
(set! atomic-predicate* (filter (lambda (pred) (not (member pred SYNTHETIC_PREDICATE_STRINGS)))
atomic-predicate*))
(set! atomic-predicate* (remove-duplicates atomic-predicate*))
(printf "atomic-predicate*: ~s\n" atomic-predicate*)
(printf "synthetic-predicate*: ~s\n" synthetic-predicate*)
(list atomic-predicate* synthetic-predicate*)
)
(define streaming-thread #f)
(define (stop-streaming)
(and streaming-thread (kill-thread streaming-thread))
(set! streaming-thread #f))
(define (print-stream ss)
(when (not (stream-empty? ss))
(pretty-print (stream-first ss))
(displayln "====================================")
(print-stream (stream-rest ss))))
(define (start-streaming ss)
(stop-streaming)
(thread (lambda () (print-stream ss))))
(define (find-X-concepts concept-1* concept-2* predicate-1* predicate-2* concept-X-list-box running-status-description full-path-list-box)
(define start-time (current-milliseconds))
#|
(printf "\nfinding concepts X for which\n[C1] -> P1 -> [X] -> P2 -> [C2]\n")
(printf "=============================\n")
|#
(define atomic/synthetic-predicate-1* (split-atomic/synthetic-predicates predicate-1*))
(define atomic/synthetic-predicate-2* (split-atomic/synthetic-predicates predicate-2*))
(define atomic-predicate-1* (car atomic/synthetic-predicate-1*))
(define atomic-predicate-2* (car atomic/synthetic-predicate-2*))
(define synthetic-predicate-1* (cadr atomic/synthetic-predicate-1*))
(define synthetic-predicate-2* (cadr atomic/synthetic-predicate-2*))
(define all-X-concepts-with-edges '())
(define (stream-query/predicate/trust predicate&nedges&ntrusted->ss)
(start-streaming
(foldr
(lambda (pname ss)
(define predicate (cdr (assoc pname synthetic-relations)))
(define (run/ranked nedges ntrusted)
(stream-cons
(begin
(displayln "***************************************")
(printf "Path length: ~s, Trusted edge count: ~s\n" nedges ntrusted)
(displayln "***************************************")
(flush-output))
(predicate&nedges&ntrusted->ss predicate nedges ntrusted)))
(stream-append
(stream-cons
(printf "Streaming synthetic predicate ~s\n" pname)
(stream-append
(run/ranked 1 1)
(stream-append
(run/ranked 1 0)
(let loop ((nedges 2) (ntrusted 2))
(if (< 4 nedges)
'()
(stream-append
(run/ranked nedges ntrusted)
(loop (+ nedges 1) (+ ntrusted 1))))))))
(stream-cons
(printf "Finished streaming synthetic predicate ~s\n" pname)
ss)))
(stream-cons (begin (displayln "Finished all streaming.")
(flush-output))
'())
synthetic-predicate-2*)))
(cond
[(and (equal? (unbox *concept-1-name-string*) "")
(equal? (unbox *concept-2-name-string*) ""))
(set! all-X-concepts-with-edges '())]
[(equal? (unbox *concept-1-name-string*) "")
(set! all-X-concepts-with-edges '())
;; run synthetic queries here
(stream-query/predicate/trust
(lambda (predicate nedges ntrusted)
(run-stream
(path-url)
(fresh (m o path)
(path-length-trustedo path nedges ntrusted)
(membero o concept-2*)
(predicate m o path)
(path/urlo path path-url)
;(== path path-url)
))))
(set! all-X-concepts-with-edges
(remove-duplicates
(append all-X-concepts-with-edges
(run* (q)
(fresh (m
e2
o p2 t2 t3 r2)
(== (list m (list r2) (list e2)) q)
(== e2 `(,m ,o ,p2 ,t2 ,t3 ,r2))
(membero o concept-2*)
(membero p2 atomic-predicate-2*)
(edgeo e2)
)))))]
[(equal? (unbox *concept-2-name-string*) "")
(set! all-X-concepts-with-edges '())
;; run synthetic queries here
(set! all-X-concepts-with-edges
(remove-duplicates
(append all-X-concepts-with-edges
(run* (q)
(fresh (m
e1 e2
s
p1 ts t1 r1)
(== (list m (list r1) (list e1)) q)
(== e1 `(,s ,m ,p1 ,ts ,t1 ,r1))
(membero s concept-1*)
(membero p1 atomic-predicate-1*)
(edgeo e1)
)))))]
[else
(set! all-X-concepts-with-edges '())
;; run synthetic queries here
(set! all-X-concepts-with-edges
(remove-duplicates
(append all-X-concepts-with-edges
(run* (q)
(fresh (m
e1 e2
s
o p1 p2 ts t1 t2 t3 r1 r2)
(== (list m (list r1 r2) (list e1 e2)) q)
(== e1 `(,s ,m ,p1 ,ts ,t1 ,r1))
(== e2 `(,m ,o ,p2 ,t2 ,t3 ,r2))
(membero s concept-1*)
(membero o concept-2*)
(membero p1 atomic-predicate-1*)
(membero p2 atomic-predicate-2*)
(edgeo e1)
(edgeo e2)
)))))])
(define end-time (current-milliseconds))
(define elapsed-time (- end-time start-time))
;;(printf "elapsed query time: ~s seconds\n" (/ elapsed-time 1000.0))
;;(printf "=============================\n")
;; This sorting affects order of appearance in the "X" concept list
(set! all-X-concepts-with-edges
(sort
all-X-concepts-with-edges
(lambda (c1 c2)
(match (list c1 c2)
[`((,_ ,_ ,e1*) (,_ ,_ ,e2*))
(not (path-confidence<? e1* e2*))]))))
(define all-X-concepts '())
(set! all-X-concepts
(let loop ([ls all-X-concepts-with-edges])
(cond
[(null? ls) '()]
[else
(match (car ls)
[`((,cui ,name ,concept-type*) ,pubmed** ,edge*)
(cons (car ls)
(loop (remf* (lambda (x)
(match x
[`((,cui-x ,name-x ,concept-type*-x) ,pubmed**-x ,edge*-x)
(equal? cui-x cui)]))
(cdr ls))))])])))
(set! all-X-concepts (map car all-X-concepts))
(newline)
(printf "========== begin query results =============\n")
(newline)
(printf "Query end date/time:\n~a\n" (date->string (seconds->date (current-seconds)) #t))
(newline)
(define number-Xs-found (length all-X-concepts))
(define query-seconds (/ elapsed-time 1000.0))
(define query-time-format-string "Found ~s X's after ~s seconds")
(send running-status-description set-label (format query-time-format-string number-Xs-found query-seconds))
(printf query-time-format-string number-Xs-found query-seconds)
(newline)
(newline)
(set-box! *concept-X-choices* all-X-concepts)
(set-box! *solution-concept-1-name-string* (unbox *concept-1-name-string*))
(set-box! *solution-concept-2-name-string* (unbox *concept-2-name-string*))
(set-box! *solution-concept-1-isa-flag* (unbox *concept-1-isa-flag*))
(set-box! *solution-concept-2-isa-flag* (unbox *concept-2-isa-flag*))
(set-box! *solution-concept-1-choices* concept-1*)
(set-box! *solution-concept-2-choices* concept-2*)
(set-box! *solution-predicate-1-choices* predicate-1*)
(set-box! *solution-predicate-2-choices* predicate-2*)
(printf "*solution-concept-1-name-string*:\n~s\n" (unbox *solution-concept-1-name-string*))
(printf "*solution-concept-1-isa-flag*:\n~s\n" (unbox *solution-concept-1-isa-flag*))
(printf "*solution-concept-1-choices*:\n")
(pretty-print (unbox *solution-concept-1-choices*))
(printf "*solution-predicate-1-choices*:\n")
(pretty-print (unbox *solution-predicate-1-choices*))
(newline)
(printf "*solution-concept-2-name-string*:\n~s\n" (unbox *solution-concept-2-name-string*))
(printf "*solution-concept-2-isa-flag*:\n~s\n" (unbox *solution-concept-2-isa-flag*))
(printf "*solution-concept-2-choices*:\n")
(pretty-print (unbox *solution-concept-2-choices*))
(printf "*solution-predicate-2-choices*:\n")
(pretty-print (unbox *solution-predicate-2-choices*))
(newline)
(define pretty-print-X-concepts-with-edges
(lambda (X-concepts-with-edges)
(with-output-to-file
"a.out"
(lambda ()
(printf "'(\n")
(let loop ([ls X-concepts-with-edges])
(cond
[(null? ls)
(printf ")\n")
(newline)]
[else
(match (car ls)
[`((,cui ,name ,concept-type*) ,pubmed** ,edge*)
;; (printf "-----------------------------------------------\n")
(for-each
(lambda (x)
(match x
[`(,subj ,obj ,pred ,subj-type ,obj-type ,pubmed*)
(let ((pubmed* (if (list? pubmed*)
(map (lambda (pubmed-id) (string-append "https://www.ncbi.nlm.nih.gov/pubmed/" (~a pubmed-id)))
pubmed*)
pubmed*)))
(pretty-print `(,subj ,obj ,pred ,subj-type ,obj-type ,pubmed*) (current-output-port) 1))]))
edge*)
(loop (cdr ls))])])))
#:mode 'text
#:exists 'append)))
;; (printf "all-X-concepts-with-edges:\n")
(pretty-print-X-concepts-with-edges all-X-concepts-with-edges)
(printf "========== end query results =============\n")
(send concept-X-list-box
set
(map (lambda (x)
(match x
[`(,cui ,name ,concept-type*)
(format "~a" cui)]))
all-X-concepts)
(map (lambda (x)
(match x
[`(,cui ,name ,concept-type*)
(let ((concept-type*
(sort concept-type* string<?)))
(format "~a" concept-type*))]))
all-X-concepts)
(map (lambda (x)
(match x
[`(,cui ,name ,concept-type*)
(~a name #:max-width MAX-CHAR-WIDTH #:limit-marker "...")]))
all-X-concepts))
;; unselect all items
(for ([i (length all-X-concepts)])
(send concept-X-list-box select i #f))
;; empty the entries in the full-path-list-box
(send full-path-list-box set '() '() '() '() '() '())
)
(displayln
"Launching GUI")
(launch-gui)
================================================
FILE: attic/code/helpers.rkt
================================================
#lang racket/base
(provide
membero
not-membero
)
(require
"mk.rkt"
)
;; list membership
(define membero
(lambda (x ls)
(fresh (y rest)
(== `(,y . ,rest) ls)
(conde
[(== x y)]
[(=/= x y) (membero x rest)]))))
;; list non-membership
(define not-membero
(lambda (x ls)
(conde
[(== '() ls)]
[(fresh (y rest)
(== `(,y . ,rest) ls)
(=/= x y)
(not-membero x rest))])))
================================================
FILE: attic/code/imatinib-query.rkt
================================================
#lang racket
;; We are using Racket as our base language.
;; Load the mediKanren logic engine, and the Racket-formatted version
;; of a lightly curated and lightly normalized version of the SemMedDB
;; knowledge base.
(require
"mk-db.rkt"
"concept.rkt"
"edge.rkt"
)
(displayln
"Finished loading mk-db.rkt.")
;; We are going to write a query that tries to find a disease 'Ds'
;; that a given drug 'Dg' might treat, but for which SemMedDB doesn't
;; contain a direct TREATS edge between 'Dg' and 'Ds'. That is, we
;; are trying to find "surprising" drug/disease links that might be
;; worth further exploration.
;;
;; THE BIGGER PROBLEM
;;
;; One important question this example query is meant to explore is
;; whether we can avoid the combinatorial, exponential explosion of
;; possible paths between the given drug 'Dg' and the "unknown"
;; disease 'Ds'. SemMedDB has millions of edges, 25,000 diseases,
;; thousands of drugs, etc. If we are naive, we can easily end
;; generating millions of paths between the given drug 'Dg' and the
;; tens of thousands of unknown diseases. We might think of this as
;; the "Six Degrees of Kevin Bacon" problem
;; (https://en.wikipedia.org/wiki/Six_Degrees_of_Kevin_Bacon): from
;; any disease there may be thousands, or even hundreds of thousands,
;; of indirect paths bewteen that drug and and specific disease. Not
;; only does this phenomenon lead to computationally intractable
;; problems, it also can overwhelm the human user with far too many
;; answers to consider in a lifetime, most of which are of extremely
;; dubious quality. For example, there are over 180,000 (relatively
;; short!) paths just between imatinib and asthma in SemMedDB.
;;
;; To avoid this problem, we are going to try to be clever, in
;; multiple dimensions. We are going to use various forms of
;; reasoning, including trying to explore connections between
;; concepts, exploring more specific drugs before exploring classes of
;; drugs, throwing out "degenrate" answers like 'Disease' that are so
;; general they are guaranteed to lead to exponential explosion, and
;; any other techniques that seem likely to avoid combinatorial
;; explosion in a wide class of queries, without being so aggressive
;; that useful answers are throw out.
;;
;; Philosophically, this is similar to how a chess engine like
;; Stockfish works (https://en.wikipedia.org/wiki/Stockfish_(chess)).
;; Even though the average branching factor in chess is around 35, the
;; best engines use heuristics to reduce the *effective* branching
;; factor to under 2. That is, when trying to decide on the next move
;; to play, in a chess position with 35 possible moves, most of the
;; time Stockfish will consider only the most promising one or two
;; moves. This allows Stockfish to efficiently search much deeper
;; than chess engines that consider all 35 moves in detail.
;;
;; In this example we try to explore a few possible heuristics that
;; might let us avoid a high average branching factor, by avoiding
;; paths that semantically don't make sense, avoiding degenerate
;; entities like 'Disease', trying more specific variants of a class
;; of drugs first to reduce the branching factor, etc.
;;
;;
;; THE QUERY
;;
;; By the very nature of our specific query (trying to find surprising
;; candidate diseases that might be treated by a given drug), we know
;; that SemMedDB will not contain the edge:
;;
;; Dg TREATS Ds
;;
;; (In fact, we will *insist* that such an edge doesn't exist, for Ds
;; to be considered a valid answer.) So instead of looking for a
;; direct TREATS edge, we will try a more nuanced query:
;;
;; Find an "unknown" disease 'Ds' that is not known to be directly treated by the
;; given drug 'Dg', where there exists a gene 'Gn', a "known" disease
;; 'Ds_k', a cell function 'Cf' such that:
;;
;; The given drug Dg directly INHIBITS some gene Gn, *and*
;; the inhibited gene Gn directly CAUSES some "known" disease Ds_k, *and*
;; the given drug Dg directly TREATS the "known" disease Ds_k, *and*
;; the inhibited gene Gn directly CAUSES some cell function Cf, *and*
;; the cell function Cf directly AFFECTS some "unknown" disease Ds, *and*
;; the given drug Dg does *not* directly TREATS the "unknown" disease Ds, *and*
;; the "unknown" disease Ds directly is a MANIFESTATION_OF the cell function Cf.
;;
;; Upper-case verbs, such as INHIBITS and TREATS, are SemMedDB edge
;; "predicates". Only the drug 'Dg' is given ("ground" in logic
;; programming terminology) in the query above. All other entities
;; ('Gn', 'Ds_k', '', etc.) are unknown ("fresh" or "non-ground" in
;; logic programming terminology). Even the "known" disease 'Ds_k'
;; starts out unknown. 'Ds_k' is a "known" disease only in the sense
;; that SemMedDB contains a direct TREATS edge between the given drug
;; 'Dg' and 'Ds_k'--we must discover that edge, and the disease
;; 'Ds_k', during the query.
;;
;; By parameterizing over the given drug 'Dg', we can turn this
;; specific query about imatinic into a more general "query schema"
;; that can be made to work for any drug.
;;
;; Part of the domain knowledge of a human user is encoded in the
;; *structure* of the query itself. This structure includes:
;;
;; * which entities are connected to each other;
;;
;; * the exact predicates chosen ('CAUSES' is a "stronger", or more
;; specific, predicate than 'AFFECTS', which is stronger than
;; 'ASSOCIATED_WITH'),
;;
;; * the exact SemMedDB semantic types chosen--diseases of interest
;; may or may not include neoplasms (semantic type 'neop'), for
;; example.
;;
;;
;; THE FIGURES
;;
;; We found it helpful to ourselves, to keep everything straight, to
;; draw by hand several figures showing the simple/naive query, and
;; a more sophisticated version that involves reasoning and heuristics.
;;
;; The overview of a naive version of the query can be found at the top of
;;
;; imatinib_simple.jpg
;;
;; This is really only part of a naive query, showing the path we hope
;; to find connecting imatinib to asthma via the KIT gene and mast
;; cell activation. Since there are over 180,000 relatively short
;; paths paths between imatinib and asthma, this path can be difficult
;; to find, even if you already knew to look for the connection to
;; asthma. If you didn't know which of the 25,000 diseases in
;; SemMedDB might be connected to imatinib, this query would be very
;; difficult indeed.
;;
;; In the same file is an abstracted version of the query, showing the
;; abstract categories and connections we are interested in. In this
;; case, we have also abstracted over the drug of interest: since none
;; of the entities are ground/concrete, this is a query schema that
;; could be applied to any drug. Of course, it is unlikely to give
;; useful answers without significant human intervention to help prune
;; bogus and boring answers.
;;
;; A more sophisticated version of the query can be found in
;;
;; imatinib_less_naive.jpg
;;
;; This figure shows branching factors we encountered when building up
;; the query by hand, while using various sorts of reasoning and
;; heuristics. Unlike the naive queries, these sub-queries were
;; executed on a laptop within a few seconds to a few minutes, with
;; relatively small numbers of interesting answers produced at the end
;; (~111 diseases to consider by a human). We aren't doing too much to
;; be efficient at this point--for example, we are representing sets as
;; lists, and taking other shortcuts. With some cleverness, we think
;; we could both speed up the queries, and also cut down on the number of
;; bogus/uninteresting answers.
;;
;;
;; CHEATING, BUT NOT REALLY
;;
;; In this file we are hand-compiling parts of the overall query, and
;; using various heuristics and reasoning techniques. We are most
;; interested in exploring *where we might get leverage to avoid
;; combinatorial explosion* while still keeping answers that are of
;; interest. In this file we will shamelessly hand-compile or chain
;; together parts of the query, and wave our hands to point out how we
;; applied a certain optimization or bit of reasoning. Obviously in a
;; real system a human would interact with the reasoning engine at a
;; much higher level of abstraction, and this code would be
;; automatically generated. Also, we would need to implement the
;; reasoning in a more automatic fashion, and might want to tweak or
;; change some of the hueristics, call out to external ontologies like
;; SNOMED so we can do logical queries to determine how concepts are
;; related, etc. We have tried to only include reasoning that we
;; think is generalizable, and which you might reasonably want to
;; apply for real queries.
;;
;; Obviously we are starting from an inherently cheating position,
;; since we know there is a connection bewteen imatinib and asthma.
;; However, we will try to be as honest as possible, and not use
;; tricks that just show asthma as the answer (ta da!). Instead, we
;; want to make sure that each step we take, and each bit of reasoning
;; we employ, seems reasonable. Over time we will learn which types
;; of reasoning seem to work best in practice--we might not use all of
;; these specific reasoning techniques, but we will use techniques
;; that are similar in spirit.
;;
;;
;; MUCH MORE EXPLORATION
;;
;; can be found in the 'study-imatinib.rkt' file, which is basically
;; 10K lines of queries and answers exploring different possible
;; answers, approaches to reasoning, etc. The examples and code below
;; have been taken from 'study-imatinib.rkt'.
;; Racket and mediKanren helpers
;; remove duplicates from a list
(define rem-dups
(lambda (ls)
(cond
[(null? ls) '()]
[(member (car ls) (cdr ls)) (rem-dups (cdr ls))]
[else (cons (car ls) (rem-dups (cdr ls)))])))
;; subtract elements from set l2 from set l1 (represented as lists)
(define set-subtraction
(lambda (l1 l2)
(cond
[(null? l1) '()]
[(member (car l1) l2) (set-subtraction (cdr l1) l2)]
[else (cons (car l1) (set-subtraction (cdr l1) l2))])))
;; set union
(define union
(lambda (l1 l2)
(cond
[(null? l1) l2]
[(member (car l1) l2) (union (cdr l1) l2)]
[else (cons (car l1) (union (cdr l1) l2))])))
;; set union for any number of sets
(define union*
(lambda args
(union*-aux args)))
;; helper for union*
(define union*-aux
(lambda (ls)
(cond
[(null? ls) '()]
[(null? (cdr ls)) (car ls)]
[else (union (car ls) (union*-aux (cdr ls)))])))
;; list membership helpers for mediKanren (depricated)
(define membero
(lambda (x ls)
(fresh (y rest)
(== `(,y . ,rest) ls)
(conde
[(== x y)]
[(=/= x y) (membero x rest)]))))
(define not-membero
(lambda (x ls)
(conde
[(== '() ls)]
[(fresh (y rest)
(== `(,y . ,rest) ls)
(=/= x y)
(not-membero x rest))])))
(displayln
"Finished loading helpers")
;;; First bit of reasoning:
;;
;; We want to find candidate "unknown" diseases that might be treated by imatinib.
;; SemMedDB has multiple concepts related to imatinib, some very specific (Gleevec),
;; some less specific (the class of imatinib-related drugs).
;;
;; One simple bit of reasoning we can do is try to find the types of
;; imatinib-related compounds, and thir relationships. An ontology
;; would be helpful here--we can get much of the way using the ISA
;; predicate in SemMedDB. We can also look at branchiong factors for
;; the different drug/gene inhibition connections, for example. Using
;; external sources as well, we can determine Gleevec is a trade name,
;; and is theremore more specific than the class of imatinib-related
;; compounds. We can therefor use the heuristic that we are going to
;; start by searching for connections from Gleevec, rather than all
;; imatinib compounds, to try to reduce the branching factor.
;; Here are the relevant ISA queries:
;; ??? ISA imatinib
;;
;; Gleevec makes sense (brand name), and probably Imatinib mesylate.
;; STI571 is okay, probably. http://chemocare.com/chemotherapy/drug-info/STI-571.aspx
;; And CGP 57148. https://www.biovision.com/imatinib-mesylate-cgp-57148b-sti-571.html
;;
;; The others seem...less good. 'Therapeutic procedure ISA imatinib' seems non-sensical.
;; 'Protein-tyrosine kinase inhibitor ISA imatinib' seems backwards.
;; '((3392 "Antineoplastic Agents" ("phsu"))
;; (13216 "Pharmacotherapy" ("topp"))
;; (13227 "Pharmaceutical Preparations" ("phsu"))
;; (87111 "Therapeutic procedure" ("topp"))
;; (385728 "CGP 57148" ("phsu" "orch"))
;; (543467 "Operative Surgical Procedures" ("topp"))
;; (906802 "STI571" ("phsu" "orch"))
;; (935987 "Gleevec" ("orch" "phsu"))
;; (939537 "Imatinib mesylate" ("orch" "phsu"))
;; (1268567 "Protein-tyrosine kinase inhibitor" ("phsu"))
;; (1268567 "Protein-tyrosine kinase inhibitor" ("phsu")))
(time
(run* (q)
(fresh (what-is-it drug e-what/drug st-what/drug ot-what/drug e-what/drug-rest)
(== what-is-it q)
(== '(935989 "imatinib" ("phsu" "orch")) drug)
(== `(,what-is-it ,drug "ISA" ,st-what/drug ,ot-what/drug . ,e-what/drug-rest) e-what/drug)
(edgeo e-what/drug))))
;; imatinib ISA ???
;; '((3392 "Antineoplastic Agents" ("phsu"))
;; (13216 "Pharmacotherapy" ("topp"))
;; (13227 "Pharmaceutical Preparations" ("phsu"))
;; (13227 "Pharmaceutical Preparations" ("phsu"))
;; (39796 "The science and art of healing" ("topp"))
;; (87111 "Therapeutic procedure" ("topp"))
;; (87111 "Therapeutic procedure" ("topp"))
;; (243076 "antagonists" ("chvf"))
;; (418981 "Medical therapy" ("topp"))
;; (543467 "Operative Surgical Procedures" ("topp"))
;; (679607 "treatment method" ("topp"))
;; (920425 "Cancer Treatment" ("topp"))
;; (935451 "neoplasm/cancer chemotherapy" ("topp"))
;; (939537 "Imatinib mesylate" ("orch" "phsu"))
;; (1254351 "Pharmacologic Substance" ("phsu"))
;; (1268567 "Protein-tyrosine kinase inhibitor" ("phsu"))
;; (1372955 "Active Ingredients" ("phsu"))
;; (1449702 "Protein Kinase Inhibitors" ("phsu"))
;; (1519313 "Signal Transduction Inhibitor" ("phsu"))
;; (1533685 "Injection procedure" ("topp"))
;; (1579409 "Molecular Target Inhibitors" ("phsu"))
;; (1611640 "Therapeutic agent (substance)" ("phsu")))
(time
(run* (q)
(fresh (drug what-is-it e-drug/what st-drug/what ot-drug/what e-drug/what-rest)
(== what-is-it q)
(== '(935989 "imatinib" ("phsu" "orch")) drug)
(== `(,drug ,what-is-it "ISA" ,st-drug/what ,ot-drug/what . ,e-drug/what-rest) e-drug/what)
(edgeo e-drug/what))))
(displayln
"Finished loading 'playing with ISA'")
;; THE CANDIDATE DISEASES
;;
;; Working backwards, here we calculate the final 111 candidate
;; diseases.
;;
;; subtract from the 154 disorders (no neoplasms or pathologic functions)
;; of interest those 456 disorders, neoplasms, or pathologic functions
;; directly treated by *any* form of imatinib (not just Gleevec)
;;
;; results in 111 disorders
;;
;; Should be able to pare down more using ontologies to see which
;; entries are forms of diabetes, for example. And use ontologies to
;; group remaning entries.
(define *final-disease-candidates*
(set-subtraction
'((10054 "Coronary Arteriosclerosis" ("dsyn"))
(41107 "Trisomy" ("dsyn"))
(25517 "Metabolic Diseases" ("dsyn"))
(15695 "Fatty Liver" ("dsyn"))
(752304 "Hypoxic-Ischemic Encephalopathy" ("dsyn"))
(17732 "Glucose Intolerance" ("dsyn"))
(158981 "Neonatal diabetes mellitus" ("dsyn"))
(6267 "Bronchiectasis" ("dsyn"))
(11616 "Contact Dermatitis" ("dsyn"))
(32285 "Pneumonia" ("dsyn"))
(1519680 "Tumor Immunity" ("dsyn"))
(242231 "Coronary Stenosis" ("dsyn"))
(729353 "Subfertility" ("dsyn"))
(9447 "Common Variable Immunodeficiency" ("dsyn"))
(33860 "Psoriasis" ("dsyn"))
(30920 "Peptic Ulcer" ("dsyn"))
(87086 "Thrombus" ("dsyn"))
(339510 "Vitelliform dystrophy" ("dsyn"))
(1857 "AIDS related complex" ("dsyn"))
(14038 "Encephalitis" ("dsyn"))
(35334 "Retinitis Pigmentosa" ("dsyn"))
(19163 "Hepatitis B" ("dsyn"))
(35435 "Rheumatism" ("dsyn"))
(38525 "Subarachnoid Hemorrhage" ("dsyn"))
(221757 "alpha 1-Antitrypsin Deficiency" ("dsyn"))
(948089 "Acute coronary syndrome" ("dsyn"))
(231341 "Premature aging syndrome" ("dsyn"))
(14553 "Absence Epilepsy" ("dsyn"))
(19151 "Hepatic Encephalopathy" ("dsyn"))
(20437 "Hypercalcemia" ("dsyn"))
(24899 "mastocytosis" ("dsyn"))
(178664 "Glomerulosclerosis" ("dsyn"))
(4153 "Atherosclerosis" ("dsyn"))
(4623 "Bacterial Infections" ("dsyn"))
(15397 "Eye diseases" ("dsyn"))
(21051 "Immunologic Deficiency Syndromes" ("dsyn"))
(26848 "Myopathy" ("dsyn"))
(35304 "Retinal Degeneration" ("dsyn"))
(35309 "Retinal Diseases" ("dsyn"))
(38220 "Status Epilepticus" ("dsyn"))
(85084 "Motor Neuron Disease" ("dsyn"))
(339573 "Primary open angle glaucoma" ("dsyn"))
(1285162 "Degenerative disorder" ("dsyn"))
(1290884 "Inflammatory disorder" ("dsyn"))
(1536085 "Geographic atrophy" ("dsyn"))
(18133 "Graft-vs-Host Disease" ("dsyn"))
(20459 "Hyperinsulinism" ("dsyn"))
(9319 "Colitis" ("dsyn"))
(11881 "Diabetic Nephropathy" ("dsyn"))
(14544 "Epilepsy" ("dsyn"))
(17601 "Glaucoma" ("dsyn"))
(19158 "Hepatitis" ("dsyn"))
(20456 "Hyperglycemia" ("dsyn"))
(20538 "Hypertensive disease" ("dsyn"))
(20550 "Hyperthyroidism" ("dsyn"))
(20615 "hypoglycemia" ("dsyn"))
(24141 "Lupus Erythematosus, Systemic" ("dsyn"))
(30305 "Pancreatitis" ("dsyn"))
(33626 "Protein Deficiency" ("dsyn"))
(36421 "Systemic Scleroderma" ("dsyn"))
(38454 "Cerebrovascular accident" ("dsyn"))
(151747 "Renal tubular disorder" ("dsyn"))
(239946 "Fibrosis, Liver" ("dsyn"))
(270814 "Spastic syndrome" ("dsyn"))
(400966 "Non-alcoholic fatty liver" ("dsyn"))
(878544 "Cardiomyopathies" ("dsyn"))
(948008 "Ischemic stroke" ("dsyn"))
(1175 "Acquired Immunodeficiency Syndrome" ("dsyn"))
(1824 "Agranulocytosis" ("dsyn"))
(2395 "Alzheimer's Disease" ("dsyn"))
(2736 "Amyotrophic Lateral Sclerosis" ("dsyn"))
(2871 "Anemia" ("dsyn"))
(3873 "Rheumatoid Arthritis" ("dsyn"))
(4135 "Ataxia Telangiectasia" ("dsyn"))
(4364 "Autoimmune Diseases" ("dsyn"))
(7193 "Cardiomyopathy, Dilated" ("dsyn"))
(7222 "Cardiovascular Diseases" ("dsyn"))
(7785 "Cerebral Infarction" ("dsyn"))
(8312 "Primary biliary cirrhosis" ("dsyn"))
(8370 "Cholestasis" ("dsyn"))
(11615 "Dermatitis, Atopic" ("dsyn"))
(11847 "Diabetes" ("dsyn"))
(11849 "Diabetes Mellitus" ("dsyn"))
(11854 "Diabetes Mellitus, Insulin-Dependent" ("dsyn"))
(11860 "Diabetes Mellitus, Non-Insulin-Dependent" ("dsyn"))
(11884 "Diabetic Retinopathy" ("dsyn"))
(13595 "Eczema" ("dsyn"))
(14175 "Endometriosis, site unspecified" ("dsyn"))
(17152 "Gastritis" ("dsyn"))
(17658 "Glomerulonephritis" ("dsyn"))
(18799 "Heart Diseases" ("dsyn"))
(18801 "Heart failure" ("dsyn"))
(19693 "HIV Infections" ("dsyn"))
(20179 "Huntington Disease" ("dsyn"))
(20542 "Hypertension, Pulmonary" ("dsyn"))
(21053 "Immune System Diseases" ("dsyn"))
(21311 "Infection" ("dsyn"))
(21359 "Infertility" ("dsyn"))
(21364 "Infertility, Male" ("dsyn"))
(21390 "Inflammatory Bowel Diseases" ("dsyn"))
(22116 "Ischemia" ("dsyn"))
(22658 "Kidney Diseases" ("dsyn"))
(22660 "Kidney Failure, Acute" ("dsyn"))
(23530 "Leukopenia" ("dsyn"))
(23895 "Liver diseases" ("dsyn"))
(24117 "Chronic Obstructive Airway Disease" ("dsyn"))
(24312 "Lymphopenia" ("dsyn"))
(26769 "Multiple Sclerosis" ("dsyn"))
(27051 "Myocardial Infarction" ("dsyn"))
(27765 "nervous system disorder" ("dsyn"))
(28754 "Obesity" ("dsyn"))
(29408 "Degenerative polyarthritis" ("dsyn"))
(29456 "Osteoporosis" ("dsyn"))
(30567 "Parkinson Disease" ("dsyn"))
(31763 "Photosensitization" ("dsyn"))
(32914 "Pre-Eclampsia" ("dsyn"))
(35305 "Retinal Detachment" ("dsyn"))
(36690 "Septicemia" ("dsyn"))
(38644 "Sudden infant death syndrome" ("dsyn"))
(39082 "Syndrome" ("dsyn"))
(40034 "Thrombocytopenia" ("dsyn"))
(41296 "Tuberculosis" ("dsyn"))
(42024 "Urinary Incontinence" ("dsyn"))
(42341 "Varicocele" ("dsyn"))
(42721 "Viral hepatitis" ("dsyn"))
(42769 "Virus Diseases" ("dsyn"))
(86543 "Cataract" ("anab" "dsyn"))
(151650 "Renal fibrosis" ("dsyn"))
(151744 "Myocardial Ischemia" ("dsyn"))
(158266 "Degenerative disc disease NOS" ("dsyn"))
(162557 "Liver Failure, Acute" ("dsyn"))
(162871 "Aortic Aneurysm, Abdominal" ("dsyn"))
(206139 "Lichen Planus, Oral" ("dsyn"))
(238806 "BONE MASS" ("dsyn"))
(242350 "Erectile dysfunction" ("dsyn"))
(242383 "Age related macular degeneration" ("dsyn"))
(242422 "Parkinsonian Disorders" ("dsyn"))
(268731 "Renal glomerular disease" ("dsyn"))
(270994 "Steroid-induced myopathy" ("dsyn"))
(339527 "Leber's amaurosis" ("dsyn"))
(340970 "Congenital neutropenia" ("dsyn"))
(343641 "Human papilloma virus infection" ("dsyn"))
(456909 "Blind Vision" ("dsyn"))
(524851 "Neurodegenerative Disorders" ("dsyn"))
(677607 "Hashimoto Disease" ("dsyn"))
(856169 "Endothelial dysfunction" ("dsyn"))
(857357 "Hepatic pathology" ("dsyn"))
(917798 "Cerebral Ischemia" ("dsyn"))
(1281300 "Vascular degeneration" ("dsyn"))
(1456670 "Nerve Diseases" ("dsyn"))
(4096 "Asthma" ("dsyn"))
(12634 "Disease" ("dsyn"))
(22661 "Kidney Failure, Chronic" ("dsyn"))
(23882 "Little's Disease" ("dsyn")))
'((2871 "Anemia" ("dsyn"))
(2874 "Aplastic Anemia" ("dsyn"))
(2895 "Sickle Cell Anemia" ("dsyn"))
(3047 "Animal Diseases" ("dsyn"))
(15376 "Extravasation" ("patf"))
(5684 "Malignant neoplasm of urinary bladder" ("neop"))
(4153 "Atherosclerosis" ("dsyn"))
(5684 "Malignant neoplasm of urinary bladder" ("neop"))
(5940 "Bone Diseases" ("dsyn"))
(18944 "Hematoma" ("patf"))
(7193 "Cardiomyopathy, Dilated" ("dsyn"))
(7682 "CNS disorder" ("dsyn"))
(20507 "Hyperplasia" ("patf"))
(6118 "Brain Neoplasms" ("neop"))
(21368 "Inflammation" ("patf"))
(8728 "Churg-Strauss Syndrome" ("dsyn"))
(6142 "Malignant neoplasm of breast" ("neop"))
(10403 "Cryoglobulinemia" ("dsyn"))
(11644 "Scleroderma" ("dsyn"))
(6142 "Malignant neoplasm of breast" ("neop"))
(29435 "Osteolysis" ("patf"))
(11854 "Diabetes Mellitus, Insulin-Dependent" ("dsyn"))
(36429 "Sclerosis" ("patf"))
(11881 "Diabetic Nephropathy" ("dsyn"))
(36974 "Shock" ("patf"))
(7095 "Carcinoid Tumor" ("neop"))
(14175 "Endometriosis, site unspecified" ("dsyn"))
(86565 "Liver Dysfunction" ("patf"))
(7095 "Carcinoid Tumor" ("neop"))
(15230 "Exanthema" ("dsyn"))
(151654 "Myocardial fibrosis" ("patf"))
(15230 "Exanthema" ("dsyn"))
(7097 "Carcinoma" ("neop"))
(15624 "Fanconi Syndrome" ("dsyn"))
(151746 "Abnormal renal function" ("patf"))
(17152 "Gastritis" ("dsyn"))
(7103 "Malignant neoplasm of endometrium" ("neop"))
(17658 "Glomerulonephritis" ("dsyn"))
(151746 "Abnormal renal function" ("patf"))
(7114 "Malignant neoplasm of skin" ("neop"))
(18801 "Heart failure" ("dsyn"))
(231178 "Chronic failure" ("patf"))
(19196 "Hepatitis C" ("dsyn"))
(20456 "Hyperglycemia" ("dsyn"))
(20538 "Hypertensive disease" ("dsyn"))
(21141 "Inappropriate ADH Syndrome" ("dsyn"))
(21390 "Inflammatory Bowel Diseases" ("dsyn"))
(22658 "Kidney Diseases" ("dsyn"))
(23882 "Little's Disease" ("dsyn"))
(23890 "Liver Cirrhosis" ("dsyn"))
(9404 "Colorectal Neoplasms" ("neop"))
(24115 "Lung diseases" ("dsyn"))
(333606 "Dystrophy" ("patf"))
(24440 "Macular Edema, Cystoid" ("dsyn"))
(443146 "Autoimmune" ("patf"))
(26769 "Multiple Sclerosis" ("dsyn"))
(27697 "Nephritis" ("dsyn"))
(549593 "kidney functional" ("patf"))
(27947 "Neutropenia" ("dsyn"))
(16048 "Fibromatosis" ("neop"))
(33838 "Kimura Disease" ("dsyn"))
(33860 "Psoriasis" ("dsyn"))
(34063 "Pulmonary Edema" ("dsyn"))
(744813 "Hepatic embolisation" ("patf"))
(35309 "Retinal Diseases" ("dsyn"))
(879626 "Adverse effects" ("patf"))
(35920 "Rubella" ("dsyn"))
(879626 "Adverse effects" ("patf"))
(18923 "Hemangiosarcoma" ("neop"))
(36992 "Short Bowel Syndrome" ("dsyn"))
(1265815 "Multiple ulcers" ("patf"))
(38013 "Ankylosing spondylitis" ("dsyn"))
(19204 "Primary carcinoma of the liver cells" ("neop"))
(1608322 "Leak NOS" ("patf"))
(39103 "Synovitis" ("dsyn"))
(19204 "Primary carcinoma of the liver cells" ("neop"))
(41296 "Tuberculosis" ("dsyn"))
(85786 "Hamman-Rich syndrome" ("dsyn"))
(23434 "Chronic Lymphocytic Leukemia" ("neop"))
(86438 "Hypogammaglobulinemia" ("dsyn"))
(151859 "Polyserositis" ("dsyn"))
(23448 "Lymphoblastic Leukemia" ("neop"))
(158168 "Villonodular synovitis" ("dsyn"))
(162557 "Liver Failure, Acute" ("dsyn"))
(162557 "Liver Failure, Acute" ("dsyn"))
(206062 "Lung Diseases, Interstitial" ("dsyn"))
(206143 "Loeffler's Endocarditis" ("dsyn"))
(236178 "Intraabdominal hemorrhage" ("dsyn"))
(238644 "anemia; profound" ("dsyn"))
(238790 "destruction; bone" ("dsyn"))
(239946 "Fibrosis, Liver" ("dsyn"))
(263664 "Generalized morphea" ("dsyn"))
(264939 "Systemic vasculitis" ("dsyn"))
(23475 "Leukemia, Myeloid, Philadelphia-Negative" ("neop"))
(272203 "Indolent Systemic Mastocytosis" ("dsyn"))
(276653 "Invasive pulmonary aspergillosis" ("dsyn"))
(277554 "Primary disease" ("dsyn"))
(277556 "Recurrent disease" ("dsyn"))
(334102 "Lymphangiomatosis" ("dsyn"))
(23484 "Leukemia, Plasmacytic" ("neop"))
(340548 "Pulmonary capillary hemangiomatosis" ("dsyn"))
(23601 "Leydig Cell Tumor" ("neop"))
(341213 "External gastric fistula" ("dsyn"))
(24301 "Lymphoma, Follicular" ("neop"))
(341439 "Chronic liver disease NOS" ("dsyn"))
(24623 "Malignant neoplasm of stomach" ("neop"))
(442867 "Malignant disease" ("dsyn"))
(549567 "Pigmentation Disorders" ("dsyn"))
(678236 "Rare Diseases" ("dsyn"))
(743496 "END ORGAN DAMAGE" ("dsyn"))
(25286 "meningioma" ("neop"))
(25500 "Mesothelioma" ("neop"))
(854467 "Myelosuppression" ("dsyn"))
(26764 "Multiple Myeloma" ("neop"))
(855227 "Purging" ("dsyn"))
(26986 "Dysmyelopoietic Syndromes" ("neop"))
(856169 "Endothelial dysfunction" ("dsyn"))
(878544 "Cardiomyopathies" ("dsyn"))
(920627 "Orphan Diseases" ("dsyn"))
(948008 "Ischemic stroke" ("dsyn"))
(948908 "Nephrotoxic serum nephritis" ("dsyn"))
(1273070 "Left ventricular diastolic dysfunction" ("dsyn"))
(1290884 "Inflammatory disorder" ("dsyn"))
(27832 "Neurofibromatosis 2" ("neop"))
(1299884 "Eosinophilic myositis" ("dsyn"))
(1306759 "Eosinophilic disorder" ("dsyn"))
(1306759 "Eosinophilic disorder" ("dsyn"))
(1332309 "Anti-Basement Membrane Glomerulonephritis" ("dsyn"))
(1533022 "Histiocytic proliferation" ("dsyn"))
(1565489 "Renal Insufficiency" ("dsyn"))
(36221 "Mast-Cell Sarcoma" ("neop"))
(41341 "Tuberous Sclerosis" ("neop"))
(79731 "B-Cell Lymphomas" ("neop"))
(79772 "T-Cell Lymphoma" ("neop"))
(153633 "Malignant neoplasm of brain" ("neop"))
(153633 "Malignant neoplasm of brain" ("neop"))
(162678 "Neurofibromatoses" ("neop"))
(205853 "Neoplasms, Epithelial" ("neop"))
(206647 "Dermatofibrosarcoma" ("neop"))
(206647 "Dermatofibrosarcoma" ("neop"))
(206657 "Sarcoma, Alveolar Soft Part" ("neop"))
(206754 "Neuroendocrine Tumors" ("neop"))
(206754 "Neuroendocrine Tumors" ("neop"))
(220650 "Metastatic malignant neoplasm to brain" ("neop"))
(238463 "Papillary thyroid carcinoma" ("neop"))
(242379 "Malignant neoplasm of lung" ("neop"))
(278517 "Non-small cell lung cancer recurrent" ("neop"))
(278695 "recurrent neuroblastoma" ("neop"))
(278704 "Malignant Childhood Neoplasm" ("neop"))
(278727 "Small cell lung cancer recurrent" ("neop"))
(279068 "childhood solid tumor" ("neop"))
(279087 "recurrent Kaposi's sarcoma" ("neop"))
(281361 "Adenocarcinoma pancreas" ("neop"))
(302592 "Cervix carcinoma" ("neop"))
(302592 "Cervix carcinoma" ("neop"))
(334410 "Leydig cell tumor, malignant" ("neop"))
(334695 "Endometrial Stromal Tumors" ("neop"))
(349636 "Pre B-cell acute lymphoblastic leukemia" ("neop"))
(553580 "Ewings sarcoma" ("neop"))
(677865 "Brain stem glioma" ("neop"))
(677865 "Brain stem glioma" ("neop"))
(685938 "Malignant neoplasm of gastrointestinal tract" ("neop"))
(686619 "Secondary malignant neoplasm of lymph node" ("neop"))
(854850 "Mycosis fungoides refractory" ("neop"))
(855054 "Fibrosarcoma metastatic" ("neop"))
(855211 "Seminoma of testis" ("neop"))
(948380 "Colorectal cancer metastatic" ("neop"))
(948380 "Colorectal cancer metastatic" ("neop"))
(1266042 "Chromophobe Renal Cell Carcinoma" ("neop"))
(1266101 "Thymic epithelial neoplasm" ("neop"))
(1266119 "Solitary fibrous tumor" ("neop"))
(1266120 "Solitary fibrous tumor, malignant" ("neop"))
(1300127 "Perivascular epithelial cell tumor" ("neop"))
(1306837 "Papillary Renal Cell Carcinoma" ("neop"))
(1318543 "Tenosynovial giant cell tumor" ("neop"))
(1319185 "Chiasmal glioma" ("neop"))
(1326912 "Tumorigenesis" ("neop"))
(1328504 "Hormone-refractory prostate cancer" ("neop"))
(1328504 "Hormone-refractory prostate cancer" ("neop"))
(1332884 "Central Nervous System Leukemia" ("neop"))
(1333614 "Fibrosarcomatous Dermatofibrosarcoma Protuberans" ("neop"))
(1334432 "Low Risk Gastrointestinal Stromal Tumor" ("neop"))
(1335996 "Small Intestinal Gastrointestinal Stromal Tumor" ("neop"))
(1378050 "Oncocytic Neoplasm" ("neop"))
(1411997 "Acute biphenotypic leukemia" ("neop"))
(1512409 "Hepatocarcinogenesis" ("neop"))
(1524028 "Intraepithelial Neoplasia of the Mouse Mammary Gland" ("neop"))
(3864 "Arthritis" ("dsyn"))
(3873 "Rheumatoid Arthritis" ("dsyn"))
(1418 "Adenocarcinoma" ("neop"))
(4364 "Autoimmune Diseases" ("dsyn"))
(6272 "Bronchiolitis Obliterans" ("dsyn"))
(9782 "Connective Tissue Diseases" ("dsyn"))
(10828 "Cytopenia" ("patf"))
(11603 "Dermatitis" ("dsyn"))
(11633 "Dermatomyositis" ("dsyn"))
(242656 "Disease Progression" ("patf"))
(14457 "Eosinophilia" ("dsyn"))
(14457 "Eosinophilia" ("dsyn"))
(242656 "Disease Progression" ("patf"))
(18133 "Graft-vs-Host Disease" ("dsyn"))
(7102 "Malignant tumor of colon" ("neop"))
(19618 "Histiocytosis" ("dsyn"))
(243083 "associated disease" ("patf"))
(19621 "Histiocytosis, Langerhans-Cell" ("dsyn"))
(7115 "Malignant neoplasm of thyroid" ("neop"))
(19624 "Histiocytosis, Non-Langerhans-Cell" ("dsyn"))
(277785 "Functional disorder" ("patf"))
(19625 "Sinus histiocytosis" ("dsyn"))
(20542 "Hypertension, Pulmonary" ("dsyn"))
(21311 "Infection" ("dsyn"))
(22661 "Kidney Failure, Chronic" ("dsyn"))
(399498 "Oral lichenoid reaction" ("patf"))
(24901 "Mastocytosis, Diffuse Cutaneous" ("dsyn"))
(26272 "Mixed Connective Tissue Disease" ("dsyn"))
(699748 "Pathogenesis" ("patf"))
(28754 "Obesity" ("dsyn"))
(7137 "Squamous cell carcinoma" ("neop"))
(31154 "Peritonitis" ("dsyn"))
(867389 "Chronic graft-versus-host disease" ("patf"))
(31763 "Photosensitization" ("dsyn"))
(7140 "Carcinosarcoma" ("neop"))
(32285 "Pneumonia" ("dsyn"))
(867389 "Chronic graft-versus-host disease" ("patf"))
(33687 "Proteinuria" ("dsyn"))
(7847 "Malignant neoplasm of cervix uteri" ("neop"))
(34069 "Pulmonary Fibrosis" ("dsyn"))
(34155 "Purpura, Thrombotic Thrombocytopenic" ("dsyn"))
(8479 "Chondrosarcoma" ("neop"))
(35435 "Rheumatism" ("dsyn"))
(8487 "Chordoma" ("neop"))
(36421 "Systemic Scleroderma" ("dsyn"))
(8487 "Chordoma" ("neop"))
(10606 "Adenoid Cystic Carcinoma" ("neop"))
(10606 "Adenoid Cystic Carcinoma" ("neop"))
(39082 "Syndrome" ("dsyn"))
(39106 "Pigmented villonodular synovitis" ("dsyn"))
(40034 "Thrombocytopenia" ("dsyn"))
(42384 "Vasculitis" ("dsyn"))
(18206 "granulosa cell tumor" ("neop"))
(152171 "Primary pulmonary hypertension" ("dsyn"))
(162835 "Hypopigmentation" ("dsyn"))
(206061 "Pneumonitis, Interstitial" ("dsyn"))
(23435 "Leukemia, B-Cell, Acute" ("neop"))
(267437 "Allergic diarrhea" ("dsyn"))
(282548 "Leukostasis" ("dsyn"))
(339143 "Thyroid associated opthalmopathies" ("dsyn"))
(339510 "Vitelliform dystrophy" ("dsyn"))
(341697 "Renal impairment" ("dsyn"))
(745091 "Hypereosinophilia" ("dsyn"))
(745091 "Hypereosinophilia" ("dsyn"))
(23470 "Myeloid Leukemia" ("neop"))
(745283 "INFECTIOUS PROCESS" ("dsyn"))
(23470 "Myeloid Leukemia" ("neop"))
(748159 "PULMONARY INVOLVEMENT" ("dsyn"))
(23472 "Leukemia, Myeloid, Aggressive-Phase" ("neop"))
(836924 "thrombocytosis" ("dsyn"))
(23472 "Leukemia, Myeloid, Aggressive-Phase" ("neop"))
(949690 "Spondylarthritis" ("dsyn"))
(1112486 "Aggressive Systemic Mastocytosis" ("dsyn"))
(1136033 "Cutaneous Mastocytosis" ("dsyn"))
(1142420 "Hepatitis B reactivation" ("dsyn"))
(1261469 "End stage renal failure" ("dsyn"))
(23479 "Leukemia, Myelomonocytic, Acute" ("neop"))
(1279945 "Acute interstitial pneumonia" ("dsyn"))
(1368107 "Aplastic bone marrow" ("dsyn"))
(1619734 "Pulmonary arterial hypertension" ("dsyn"))
(23487 "Acute Promyelocytic Leukemia" ("neop"))
(23487 "Acute Promyelocytic Leukemia" ("neop"))
(23494 "Leukemia, T-Cell, Chronic" ("neop"))
(23827 "liposarcoma" ("neop"))
(26987 "Myelofibrosis" ("neop"))
(29925 "Ovarian Carcinoma" ("neop"))
(29925 "Ovarian Carcinoma" ("neop"))
(32463 "Polycythemia Vera" ("neop"))
(32463 "Polycythemia Vera" ("neop"))
(35412 "Rhabdomyosarcoma" ("neop"))
(36220 "Kaposi Sarcoma" ("neop"))
(36631 "Seminoma" ("neop"))
(39101 "synovial sarcoma" ("neop"))
(40100 "Thymoma" ("neop"))
(79218 "Fibromatosis, Aggressive" ("neop"))
(79218 "Fibromatosis, Aggressive" ("neop"))
(151779 "[X]Malignant melanoma of skin, unspecified" ("neop"))
(205851 "Germ cell tumor" ("neop"))
(205969 "Thymic Carcinoma" ("neop"))
(205969 "Thymic Carcinoma" ("neop"))
(206630 "Endometrial Stromal Sarcoma" ("neop"))
(206693 "Medullary carcinoma" ("neop"))
(206698 "Cholangiocarcinoma" ("neop"))
(206728 "Plexiform Neurofibroma" ("neop"))
(206728 "Plexiform Neurofibroma" ("neop"))
(276535 "AIDS with Kaposi's sarcoma" ("neop"))
(278488 "Breast cancer metastatic" ("neop"))
(278488 "Breast cancer metastatic" ("neop"))
(278678 "Metastatic renal cell carcinoma" ("neop"))
(278694 "Disseminated neuroblastoma" ("neop"))
(278787 "relapsing chronic myelogenous leukemia" ("neop"))
(278787 "relapsing chronic myelogenous leukemia" ("neop"))
(278883 "Metastatic melanoma" ("neop"))
(278883 "Metastatic melanoma" ("neop"))
(279549
"Philadelphia chromosome negative chronic myelogenous leukemia"
("neop"))
(280449 "secondary acute myeloid leukemia" ("neop"))
(334664 "Mast Cell Neoplasm" ("neop"))
(338113 "Uterine Corpus Sarcoma" ("neop"))
(341823 "Epithelial tumor of ovary" ("neop"))
(345967 "Malignant mesothelioma" ("neop"))
(345967 "Malignant mesothelioma" ("neop"))
(346421 "Chronic eosinophilic leukemia" ("neop"))
(346976 "Secondary malignant neoplasm of pancreas" ("neop"))
(349640 "[M]Subacute myeloid leukemia" ("neop"))
(431109 "Choroid Plexus Carcinoma" ("neop"))
(476089 "Endometrial Carcinoma" ("neop"))
(476089 "Endometrial Carcinoma" ("neop"))
(521158 "Recurrent tumor" ("neop"))
(543478 "Residual Tumor" ("neop"))
(543478 "Residual Tumor" ("neop"))
(549379 "Recurrent Carcinoma" ("neop"))
(598798 "Lymphoid neoplasm" ("neop"))
(598934 "tumor growth" ("neop"))
(677936 "Refractory Carcinoma" ("neop"))
(699889 "Female reproductive neoplasm malignant NOS" ("neop"))
(740267 "Ocular melanomas" ("neop"))
(740277 "Bile duct carcinoma" ("neop"))
(743535 "EOSINOPHILIC GRANULOMATOSIS" ("neop"))
(751690 "Malignant Peripheral Nerve Sheath Tumor" ("neop"))
(751690 "Malignant Peripheral Nerve Sheath Tumor" ("neop"))
(812413 "Malignant Pleural Mesothelioma" ("neop"))
(855013 "Chondrosarcoma recurrent" ("neop"))
(936223 "Prostate cancer metastatic" ("neop"))
(1292778 "Chronic myeloproliferative disorder (morphology)" ("neop"))
(1292778 "Chronic myeloproliferative disorder (morphology)" ("neop"))
(1327920 "childhood chronic myelogenous leukemia" ("neop"))
(1333768 "Gastric Gastrointestinal Stromal Tumor" ("neop"))
(1334026 "High Risk Gastrointestinal Stromal Tumor" ("neop"))
(1334026 "High Risk Gastrointestinal Stromal Tumor" ("neop"))
(1334699 "Mesenchymal Cell Neoplasm" ("neop"))
(1335711 "Recurrent Mature T- and NK-Cell Non-Hodgkin's Lymphoma" ("neop"))
(1335713 "Recurrent Meningioma" ("neop"))
(1335729 "Refractory Neoplasm" ("neop"))
(1336746 "Thymus Carcinoid Tumor" ("neop"))
(1540912 "Hypereosinophilic syndrome" ("neop"))
(1540912 "Hypereosinophilic syndrome" ("neop"))
(235063 "Respiratory Depression" ("patf"))
(679222 "functional insufficiency" ("patf"))
(12634 "Disease" ("dsyn"))
(1815 "Primary Myelofibrosis" ("neop"))
(12634 "Disease" ("dsyn"))
(9566 "Complication" ("patf"))
(24228 "Lymphatic Diseases" ("dsyn"))
(24899 "mastocytosis" ("dsyn"))
(20517 "Hypersensitivity" ("patf"))
(37354 "Smallpox" ("dsyn"))
(28778 "Obstruction" ("patf"))
(221013 "Mastocytosis, Systemic" ("dsyn"))
(1318485 "Liver regeneration disorder" ("dsyn"))
(242184 "Hypoxia" ("patf"))
(9402 "Carcinoma of the Large Intestine" ("neop"))
(456070 "Growth delay" ("patf"))
(17638 "Glioma" ("neop"))
(19829 "Hodgkin Disease" ("neop"))
(23269 "leiomyosarcoma" ("neop"))
(23269 "leiomyosarcoma" ("neop"))
(23453 "Leukemia, Lymphocytic, Acute, L2" ("neop"))
(23476 "Leukemia, Myeloid, Philadelphia-Positive" ("neop"))
(23480 "Leukemia, Myelomonocytic, Chronic" ("neop"))
(23481 "Leukemia, Neutrophilic, Chronic" ("neop"))
(27022 "Myeloproliferative disease" ("neop"))
(27819 "Neuroblastoma" ("neop"))
(29463 "osteosarcoma" ("neop"))
(85136 "Central Nervous System Neoplasms" ("neop"))
(149925 "Small cell carcinoma of lung" ("neop"))
(149925 "Small cell carcinoma of lung" ("neop"))
(152018 "Esophageal carcinoma" ("neop"))
(178874 "Neoplasm progression" ("neop"))
(206093 "Neuroectodermal Tumors" ("neop"))
(235974 "Pancreatic carcinoma" ("neop"))
(235974 "Pancreatic carcinoma" ("neop"))
(238461 "Anaplastic thyroid carcinoma" ("neop"))
(238462 "Medullary carcinoma of thyroid" ("neop"))
(278726 "Small cell lung cancer extensive stage" ("neop"))
(376358 "Malignant neoplasm of prostate" ("neop"))
(376545 "Hematologic Neoplasms" ("neop"))
(494165 "Secondary malignant neoplasm of liver" ("neop"))
(494165 "Secondary malignant neoplasm of liver" ("neop"))
(555198 "Malignant Glioma" ("neop"))
(677930 "Primary Neoplasm" ("neop"))
(699791 "Stomach Carcinoma" ("neop"))
(750952 "Biliary Tract Cancer" ("neop"))
(751606 "Adult Acute Lymphocytic Leukemia" ("neop"))
(860582 "Peritoneal metastases" ("neop"))
(877373 "Advanced cancer" ("neop"))
(879615 "Stromal Neoplasm" ("neop"))
(887833 "Carcinoma, Pancreatic Ductal" ("neop"))
(920028 "Leukaemia recurrent" ("neop"))
(1266137 "Gastrointestinal stromal sarcoma" ("neop"))
(1279296 "Chronic leukemia (category)" ("neop"))
(1370868 "refractory CML" ("neop"))
(2395 "Alzheimer's Disease" ("dsyn"))
(8679 "Chronic Disease" ("dsyn"))
(5699 "Blast Phase" ("neop"))
(11847 "Diabetes" ("dsyn"))
(16059 "Fibrosis" ("patf"))
(11860 "Diabetes Mellitus, Non-Insulin-Dependent" ("dsyn"))
(6826 "Malignant Neoplasms" ("neop"))
(37274 "skin disorder" ("dsyn"))
(21655 "Insulin Resistance" ("patf"))
(206141 "Idiopathic Hypereosinophilic Syndrome" ("dsyn"))
(6826 "Malignant Neoplasms" ("neop"))
(878773 "Overactive Bladder" ("dsyn"))
(332448 "Infiltration" ("patf"))
(1167698 "Leukaemic retinopathy" ("dsyn"))
(7129 "Merkel cell carcinoma" ("neop"))
(1258104 "Diffuse Scleroderma" ("dsyn"))
(920563 "insulin sensitivity" ("patf"))
(7131 "Carcinoma, Non-Small-Cell Lung" ("neop"))
(7134 "Renal Cell Carcinoma" ("neop"))
(17185 "Gastrointestinal Neoplasms" ("neop"))
(17636 "Glioblastoma" ("neop"))
(23418 "leukemia" ("neop"))
(23418 "leukemia" ("neop"))
(23449 "Leukemia, Lymphocytic, Acute" ("neop"))
(23467 "Leukemia, Myelocytic, Acute" ("neop"))
(23473 "Myeloid Leukemia, Chronic" ("neop"))
(23473 "Myeloid Leukemia, Chronic" ("neop"))
(23474 "Leukemia, Myeloid, Chronic-Phase" ("neop"))
(24221 "Lymphangioma" ("neop"))
(25149 "medulloblastoma" ("neop"))
(25202 "melanoma" ("neop"))
(26948 "Mycosis Fungoides" ("neop"))
(27627 "Neoplasm Metastasis" ("neop"))
(27651 "Neoplasm" ("neop"))
(27831 "Neurofibromatosis 1" ("neop"))
(27859 "Acoustic Neuroma" ("neop"))
(35335 "Retinoblastoma" ("neop"))
(85669 "Acute leukemia" ("neop"))
(152276 "Granulocytic Sarcoma" ("neop"))
(153658 "Malignant neoplasm of endocrine gland" ("neop"))
(153690 "Secondary malignant neoplasm of bone" ("neop"))
(220633 "Intraocular melanoma" ("neop"))
(238198 "Gastrointestinal Stromal Tumors" ("neop"))
(238198 "Gastrointestinal Stromal Tumors" ("neop"))
(242596 "Neoplasm, Residual" ("neop"))
(279543
"Philadelphia chromosome positive chronic myelogenous leukemia"
("neop"))
(279671 "Cervical Squamous Cell Carcinoma" ("neop"))
(280100 "Solid tumor" ("neop"))
(334486 "Sarcoma, Endometrial Stromal, Low-Grade" ("neop"))
(334569 "Odontogenic myxoma" ("neop"))
(346429 "Multiple malignancy" ("neop"))
(392784 "Dermatofibrosarcoma Protuberans" ("neop"))
(677886 "Epithelial ovarian cancer" ("neop"))
(856536 "Philadelphia chromosome positive" ("neop"))
(1261473 "sarcoma" ("neop"))
(1261473 "sarcoma" ("neop"))
(1336869 "Unresectable Malignant Neoplasm" ("neop"))
(1370723 "Stromal sarcoma" ("neop")))))
;;
;; *final-disease-candidates*
;;
;; The disease candidates produced.
;;
;; Of particular interest to us is:
;;
;; (4096 "Asthma" ("dsyn"))
;;
;; The 111 answers include
;;
;; (11849 "Diabetes Mellitus" ("dsyn"))
;;
;; since SemMedDB doesn't "know" that
;;
#|
'((10054 "Coronary Arteriosclerosis" ("dsyn"))
(41107 "Trisomy" ("dsyn"))
(25517 "Metabolic Diseases" ("dsyn"))
(15695 "Fatty Liver" ("dsyn"))
(752304 "Hypoxic-Ischemic Encephalopathy" ("dsyn"))
(17732 "Glucose Intolerance" ("dsyn"))
(158981 "Neonatal diabetes mellitus" ("dsyn"))
(6267 "Bronchiectasis" ("dsyn"))
(11616 "Contact Dermatitis" ("dsyn"))
(1519680 "Tumor Immunity" ("dsyn"))
(242231 "Coronary Stenosis" ("dsyn"))
(729353 "Subfertility" ("dsyn"))
(9447 "Common Variable Immunodeficiency" ("dsyn"))
(30920 "Peptic Ulcer" ("dsyn"))
(87086 "Thrombus" ("dsyn"))
(1857 "AIDS related complex" ("dsyn"))
(14038 "Encephalitis" ("dsyn"))
(35334 "Retinitis Pigmentosa" ("dsyn"))
(19163 "Hepatitis B" ("dsyn"))
(38525 "Subarachnoid Hemorrhage" ("dsyn"))
(221757 "alpha 1-Antitrypsin Deficiency" ("dsyn"))
(948089 "Acute coronary syndrome" ("dsyn"))
(231341 "Premature aging syndrome" ("dsyn"))
(14553 "Absence Epilepsy" ("dsyn"))
(19151 "Hepatic Encephalopathy" ("dsyn"))
(20437 "Hypercalcemia" ("dsyn"))
(178664 "Glomerulosclerosis" ("dsyn"))
(4623 "Bacterial Infections" ("dsyn"))
(15397 "Eye diseases" ("dsyn"))
(21051 "Immunologic Deficiency Syndromes" ("dsyn"))
(26848 "Myopathy" ("dsyn"))
(35304 "Retinal Degeneration" ("dsyn"))
(38220 "Status Epilepticus" ("dsyn"))
(85084 "Motor Neuron Disease" ("dsyn"))
(339573 "Primary open angle glaucoma" ("dsyn"))
(1285162 "Degenerative disorder" ("dsyn"))
(1536085 "Geographic atrophy" ("dsyn"))
(20459 "Hyperinsulinism" ("dsyn"))
(9319 "Colitis" ("dsyn"))
(14544 "Epilepsy" ("dsyn"))
(17601 "Glaucoma" ("dsyn"))
(19158 "Hepatitis" ("dsyn"))
(20550 "Hyperthyroidism" ("dsyn"))
(20615 "hypoglycemia" ("dsyn"))
(24141 "Lupus Erythematosus, Systemic" ("dsyn"))
(30305 "Pancreatitis" ("dsyn"))
(33626 "Protein Deficiency" ("dsyn"))
(38454 "Cerebrovascular accident" ("dsyn"))
(151747 "Renal tubular disorder" ("dsyn"))
(270814 "Spastic syndrome" ("dsyn"))
(400966 "Non-alcoholic fatty liver" ("dsyn"))
(1175 "Acquired Immunodeficiency Syndrome" ("dsyn"))
(1824 "Agranulocytosis" ("dsyn"))
(2736 "Amyotrophic Lateral Sclerosis" ("dsyn"))
(4135 "Ataxia Telangiectasia" ("dsyn"))
(7222 "Cardiovascular Diseases" ("dsyn"))
(7785 "Cerebral Infarction" ("dsyn"))
(8312 "Primary biliary cirrhosis" ("dsyn"))
(8370 "Cholestasis" ("dsyn"))
(11615 "Dermatitis, Atopic" ("dsyn"))
(11849 "Diabetes Mellitus" ("dsyn"))
(11884 "Diabetic Retinopathy" ("dsyn"))
(13595 "Eczema" ("dsyn"))
(18799 "Heart Diseases" ("dsyn"))
(19693 "HIV Infections" ("dsyn"))
(20179 "Huntington Disease" ("dsyn"))
(21053 "Immune System Diseases" ("dsyn"))
(21359 "Infertility" ("dsyn"))
(21364 "Infertility, Male" ("dsyn"))
(22116 "Ischemia" ("dsyn"))
(22660 "Kidney Failure, Acute" ("dsyn"))
(23530 "Leukopenia" ("dsyn"))
(23895 "Liver diseases" ("dsyn"))
(24117 "Chronic Obstructive Airway Disease" ("dsyn"))
(24312 "Lymphopenia" ("dsyn"))
(27051 "Myocardial Infarction" ("dsyn"))
(27765 "nervous system disorder" ("dsyn"))
(29408 "Degenerative polyarthritis" ("dsyn"))
(29456 "Osteoporosis" ("dsyn"))
(30567 "Parkinson Disease" ("dsyn"))
(32914 "Pre-Eclampsia" ("dsyn"))
(35305 "Retinal Detachment" ("dsyn"))
(36690 "Septicemia" ("dsyn"))
(38644 "Sudden infant death syndrome" ("dsyn"))
(42024 "Urinary Incontinence" ("dsyn"))
(42341 "Varicocele" ("dsyn"))
(42721 "Viral hepatitis" ("dsyn"))
(42769 "Virus Diseases" ("dsyn"))
(86543 "Cataract" ("anab" "dsyn"))
(151650 "Renal fibrosis" ("dsyn"))
(151744 "Myocardial Ischemia" ("dsyn"))
(158266 "Degenerative disc disease NOS" ("dsyn"))
(162871 "Aortic Aneurysm, Abdominal" ("dsyn"))
(206139 "Lichen Planus, Oral" ("dsyn"))
(238806 "BONE MASS" ("dsyn"))
(242350 "Erectile dysfunction" ("dsyn"))
(242383 "Age related macular degeneration" ("dsyn"))
(242422 "Parkinsonian Disorders" ("dsyn"))
(268731 "Renal glomerular disease" ("dsyn"))
(270994 "Steroid-induced myopathy" ("dsyn"))
(339527 "Leber's amaurosis" ("dsyn"))
(340970 "Congenital neutropenia" ("dsyn"))
(343641 "Human papilloma virus infection" ("dsyn"))
(456909 "Blind Vision" ("dsyn"))
(524851 "Neurodegenerative Disorders" ("dsyn"))
(677607 "Hashimoto Disease" ("dsyn"))
(857357 "Hepatic pathology" ("dsyn"))
(917798 "Cerebral Ischemia" ("dsyn"))
(1281300 "Vascular degeneration" ("dsyn"))
(1456670 "Nerve Diseases" ("dsyn"))
(4096 "Asthma" ("dsyn")))
|#
(displayln
"Finished loading final disease cnadidates")
;; Combine two of the queries: which of the Diseases or Syndromes or
;; Neoplastic Processes or Pathologic Functions directly treated by
;; imatinib synonyms are *directly* caused by the genes directly
;; inhibited by the imatinib synonyms?
;;
;; Run this by calling (combine-two-query)
;;
(define (combine-two-query)
(map
(lambda (drug)
(let ((diseases (run* (q)
(fresh (disease e-drug/disease p-st-drug/disease p-ob-drug/disease e-drug/disease-rest
gene e-drug/gene p-st-drug/gene e-drug/gene-rest
e-gene/disease st-gene/disease ot-gene/disease e-gene/disease-rest)
(== disease q)
(conde
[(== "dsyn" p-ob-drug/disease)]
[(== "neop" p-ob-drug/disease)]
[(== "patf" p-ob-drug/disease)])
(== `(,drug ,disease "TREATS" ,p-st-drug/disease ,p-ob-drug/disease . ,e-drug/disease-rest) e-drug/disease)
(== `(,drug ,gene "INHIBITS" ,p-st-drug/gene "gngm" . ,e-drug/gene-rest) e-drug/gene)
(== `(,gene ,disease "CAUSES" ,st-gene/disease ,ot-gene/disease . ,e-gene/disease-rest) e-gene/disease)
(edgeo e-drug/disease)
(edgeo e-drug/gene)
(edgeo e-gene/disease)))))
(list (length (rem-dups diseases)) drug)))
'((935989 "imatinib" ("phsu" "orch"))
(939537 "Imatinib mesylate" ("orch" "phsu"))
(385728 "CGP 57148" ("phsu" "orch"))
(906802 "STI571" ("phsu" "orch"))
(935987 "Gleevec" ("orch" "phsu")))))
(displayln
"Finished loading combine-two-queries")
;; 286 genes are directly inhibited by some synonym for imitinib
(let ((all-genes
(map
(lambda (drug)
(let ((genes (run* (q)
(fresh (gene e-drug/gene p-drug/gene e-drug/gene-rest)
(== gene q)
(== `(,drug ,gene ,p-drug/gene . ,e-drug/gene-rest) e-drug/gene)
(== "INHIBITS" p-drug/gene)
(edgeo e-drug/gene)
(fresh (cui name concept-type*)
(== `(,cui ,name ,concept-type*) gene)
(membero "gngm" concept-type*))))))
(rem-dups genes)))
'((935989 "imatinib" ("phsu" "orch"))
(939537 "Imatinib mesylate" ("orch" "phsu"))
(385728 "CGP 57148" ("phsu" "orch"))
(906802 "STI571" ("phsu" "orch"))
(935987 "Gleevec" ("orch" "phsu"))))))
(length (apply union* all-genes)))
;; =>
;; 286
;; Once we have decided that asthma is a disease of interest, we might
;; want to see the paths between the 47 genes of interest (including
;; KIT and C-KIT) and the asthma.
;;
;; Query takes 2 minutes on a laptop, single-threaded. We should be
;; able to speed this up.
;;
;; The only specifc gene that is indirectly linked to asthma through
;; mast cell activation (as opposed to signal transduction, which
;; seems less specific) is KIT, through this chain:
;;
;; (((1416655 "KIT gene" ("bacs" "imft" "gngm" "aapp"))
;; (1155074 "mast cell activation" ("celf"))
;; "CAUSES"
;; "gngm"
;; "celf"
;; (12373338))
;; ((1155074 "mast cell activation" ("celf"))
;; (4096 "Asthma" ("dsyn"))
;; "AFFECTS"
;; "celf"
;; "dsyn"
;; (18209484 10352758))
;; ((4096 "Asthma" ("dsyn"))
;; (1155074 "mast cell activation" ("celf"))
;; "MANIFESTATION_OF"
;; "dsyn"
;; "celf"
;; (2741114)))
;;
;; The numbers 12373338, 18209484, 10352758, 2741114 can be turned
;; into PubMed URLs. For example, the URL for 12373338 is:
;;
;; https://www.ncbi.nlm.nih.gov/pubmed/12373338
;;
;; We can then focus on KIT to get the full chain from Gleevec/imatinib
;; and asthma. Obviously thi can be automated, and composing the queries
;; (or the cached answers from sub-queries) is straight-forward.
;;
;; Run this by calling (paths-of-interest)
;;
(define (paths-of-interest)
(map
(lambda (gene)
(let ((disorders
(run* (q)
(fresh (e1 e2 e3 celf disorder disorder-type rest1 rest2 rest3)
(== (list e1 e2 e3) q)
(fuzzy-concepto "asthma" disorder)
(conde
[(== "dsyn" disorder-type)]
[(== "neop" disorder-type)]
[(== "patf" disorder-type)])
(== `(,gene ,celf "CAUSES" "gngm" "celf" . ,rest1) e1)
(== `(,celf ,disorder "AFFECTS" "celf" ,disorder-type . ,rest2) e2)
(== `(,disorder ,celf "MANIFESTATION_OF" ,disorder-type "celf" . ,rest3) e3)
(edgeo e1)
(edgeo e3)
(edgeo e2)))))
(let ((disorders (rem-dups disorders)))
disorders)))
'((1428985 "PDGFD gene" ("aapp" "gngm"))
(919477 "LCK gene" ("aapp" "enzy" "gngm"))
(1136340 "Semaphorins" ("bacs" "gngm" "aapp"))
(1366876 "MAPK14 gene" ("gngm" "aapp" "enzy"))
(1364818 "APP gene" ("enzy" "gngm" "bacs" "aapp" "imft"))
(1333568 "FLT3 gene" ("gngm" "phsu" "bacs" "aapp"))
(79050 "c-abl Proto-Oncogenes" ("aapp" "gngm"))
(79413 "Genes, abl" ("gngm" "aapp"))
(812253 "CRKL gene" ("bacs" "aapp" "gngm"))
(915156 "Ephrin Receptor EphA8" ("gngm" "enzy" "aapp"))
(2716 "Amyloid" ("bacs" "aapp" "gngm"))
(3241 "Antibodies" ("gngm" "aapp" "imft"))
(33640 "PROTEIN KINASE" ("gngm" "enzy" "aapp"))
(33681 "Protein Tyrosine Kinase" ("enzy" "gngm" "aapp"))
(164786 "Proto-Oncogene Proteins c-akt" ("gngm" "aapp" "enzy"))
(33684 "Proteins" ("bacs" "gngm" "aapp"))
(246681 "platelet-derived growth factor BB" ("gngm" "phsu" "aapp"))
(290068
"Platelet-Derived Growth Factor beta Receptor"
("aapp" "gngm" "rcpt" "enzy"))
(812228 "AKT1 gene" ("aapp" "phsu" "enzy" "gngm" "bacs"))
(812375 "ELK3 gene" ("enzy" "gngm" "bacs" "aapp"))
(1335239 "PPBP gene" ("bacs" "aapp" "gngm"))
(1419240 "RAD51 gene" ("enzy" "gngm" "aapp"))
(1421416 "UVRAG gene" ("gngm" "phsu" "aapp"))
(1422009 "TP63 gene" ("rcpt" "phsu" "imft" "aapp" "gngm"))
(1424677 "CKAP4 gene" ("gngm" "aapp" "bacs" "phsu"))
(1425835 "KCNH8 gene" ("gngm" "aapp" "bacs"))
(1439347 "BTG1 gene" ("gngm" "aapp"))
(4891 "Fusion Proteins, bcr-abl" ("aapp" "gngm" "bacs"))
(1439337 "tyrosine kinase ABL1" ("aapp" "gngm" "enzy"))
(80092
"Macrophage Colony-Stimulating Factor Receptor"
("enzy" "aapp" "imft" "gngm"))
(879468 "CSF1R gene" ("aapp" "imft" "rcpt" "gngm" "enzy"))
(32200 "Platelet-Derived Growth Factor" ("gngm" "aapp" "bacs"))
(72470 "Proto-Oncogene Protein c-kit" ("aapp" "gngm" "rcpt" "imft"))
(206364 "Receptor Protein-Tyrosine Kinases" ("enzy" "rcpt" "gngm" "aapp"))
(290067
"Platelet-Derived Growth Factor alpha Receptor"
("rcpt" "aapp" "gngm" "enzy"))
(174680 "Cyclin D1" ("gngm" "bacs" "aapp"))
(812385 "BCR gene" ("gngm" "bacs" "enzy" "aapp"))
(1335202 "PDGFRB gene" ("bacs" "gngm" "rcpt" "enzy" "aapp"))
(597357 "receptor" ("aapp" "gngm" "rcpt"))
(31727 "Phosphotransferases" ("aapp" "gngm" "enzy"))
(1412097 "ABL1 gene" ("imft" "enzy" "gngm" "aapp" "bacs" "phsu"))
(71253 "Platelet-Derived Growth Factor Receptor" ("aapp" "gngm" "enzy"))
(1826328 "MTTP gene" ("aapp" "lipd" "gngm" "imft" "phsu" "bacs"))
(79427 "Tumor Suppressor Genes" ("gngm" "aapp"))
(105770 "beta catenin" ("aapp" "gngm" "bacs"))
(920288 "C-KIT Gene" ("gngm" "aapp"))
(1416655 "KIT gene" ("bacs" "imft" "gngm" "aapp")))))
;; =>
;; cpu time: 127629 real time: 128505 gc time: 1446
#|
'(()
((((919477 "LCK gene" ("aapp" "enzy" "gngm"))
(37083 "Signal Transduction" ("celf"))
"CAUSES"
"gngm"
"celf"
(24564241 1281217))
((37083 "Signal Transduction" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(24447081 22447942 19530997 19075672 18699801))
((4096 "Asthma" ("dsyn"))
(37083 "Signal Transduction" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(11197605 10087910))))
()
((((1366876 "MAPK14 gene" ("gngm" "aapp" "enzy"))
(37083 "Signal Transduction" ("celf"))
"CAUSES"
"gngm"
"celf"
(26467500))
((37083 "Signal Transduction" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(24447081 22447942 19530997 19075672 18699801))
((4096 "Asthma" ("dsyn"))
(37083 "Signal Transduction" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(11197605 10087910))))
((((1364818 "APP gene" ("enzy" "gngm" "bacs" "aapp" "imft"))
(37083 "Signal Transduction" ("celf"))
"CAUSES"
"gngm"
"celf"
(24188406
24188406
22841885
22841885
21978835
21978835
20597478
20597478
18256384
12176746
12176746))
((37083 "Signal Transduction" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(24447081 22447942 19530997 19075672 18699801))
((4096 "Asthma" ("dsyn"))
(37083 "Signal Transduction" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(11197605 10087910))))
((((1333568 "FLT3 gene" ("gngm" "phsu" "bacs" "aapp"))
(37083 "Signal Transduction" ("celf"))
"CAUSES"
"gngm"
"celf"
(23340802 23340802))
((37083 "Signal Transduction" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(24447081 22447942 19530997 19075672 18699801))
((4096 "Asthma" ("dsyn"))
(37083 "Signal Transduction" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(11197605 10087910))))
()
()
()
((((915156 "Ephrin Receptor EphA8" ("gngm" "enzy" "aapp"))
(37083 "Signal Transduction" ("celf"))
"CAUSES"
"gngm"
"celf"
(16789903 11409908 7835966))
((37083 "Signal Transduction" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(24447081 22447942 19530997 19075672 18699801))
((4096 "Asthma" ("dsyn"))
(37083 "Signal Transduction" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(11197605 10087910))))
((((2716 "Amyloid" ("bacs" "aapp" "gngm"))
(37083 "Signal Transduction" ("celf"))
"CAUSES"
"gngm"
"celf"
(26758977 25633229))
((37083 "Signal Transduction" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(24447081 22447942 19530997 19075672 18699801))
((4096 "Asthma" ("dsyn"))
(37083 "Signal Transduction" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(11197605 10087910))))
((((3241 "Antibodies" ("gngm" "aapp" "imft"))
(37083 "Signal Transduction" ("celf"))
"CAUSES"
"gngm"
"celf"
(22262845
19170657
19048108
17503113
15163542
14620151
14580993
12949238
12482196
12482196
12324469
9450748))
((37083 "Signal Transduction" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(24447081 22447942 19530997 19075672 18699801))
((4096 "Asthma" ("dsyn"))
(37083 "Signal Transduction" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(11197605 10087910)))
(((3241 "Antibodies" ("gngm" "aapp" "imft"))
(1155074 "mast cell activation" ("celf"))
"CAUSES"
"gngm"
"celf"
(25539676 16461989))
((1155074 "mast cell activation" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(18209484 10352758))
((4096 "Asthma" ("dsyn"))
(1155074 "mast cell activation" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(2741114))))
((((33640 "PROTEIN KINASE" ("gngm" "enzy" "aapp"))
(37083 "Signal Transduction" ("celf"))
"CAUSES"
"gngm"
"celf"
(22357971 19290922 18492778 16790031 16790031 16415076))
((37083 "Signal Transduction" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(24447081 22447942 19530997 19075672 18699801))
((4096 "Asthma" ("dsyn"))
(37083 "Signal Transduction" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(11197605 10087910))))
((((33681 "Protein Tyrosine Kinase" ("enzy" "gngm" "aapp"))
(37083 "Signal Transduction" ("celf"))
"CAUSES"
"gngm"
"celf"
(17426060 12035499 7882988))
((37083 "Signal Transduction" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(24447081 22447942 19530997 19075672 18699801))
((4096 "Asthma" ("dsyn"))
(37083 "Signal Transduction" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(11197605 10087910))))
((((164786 "Proto-Oncogene Proteins c-akt" ("gngm" "aapp" "enzy"))
(37083 "Signal Transduction" ("celf"))
"CAUSES"
"gngm"
"celf"
(23222563))
((37083 "Signal Transduction" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(24447081 22447942 19530997 19075672 18699801))
((4096 "Asthma" ("dsyn"))
(37083 "Signal Transduction" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(11197605 10087910))))
((((33684 "Proteins" ("bacs" "gngm" "aapp"))
(37083 "Signal Transduction" ("celf"))
"CAUSES"
"gngm"
"celf"
(26023679
24850739
23682925
23660250
22498774
22319212
21601104
20036637
17203870
15180972
15180972
15053611
12670482
12477288
12194978
12112690
11175815
11073315
9676989
8616803
7902881))
((37083 "Signal Transduction" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(24447081 22447942 19530997 19075672 18699801))
((4096 "Asthma" ("dsyn"))
(37083 "Signal Transduction" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(11197605 10087910)))
(((33684 "Proteins" ("bacs" "gngm" "aapp"))
(1155074 "mast cell activation" ("celf"))
"CAUSES"
"gngm"
"celf"
(12393403))
((1155074 "mast cell activation" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(18209484 10352758))
((4096 "Asthma" ("dsyn"))
(1155074 "mast cell activation" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(2741114))))
((((246681 "platelet-derived growth factor BB" ("gngm" "phsu" "aapp"))
(37083 "Signal Transduction" ("celf"))
"CAUSES"
"gngm"
"celf"
(22095643 16883913 16557224 8619925))
((37083 "Signal Transduction" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(24447081 22447942 19530997 19075672 18699801))
((4096 "Asthma" ("dsyn"))
(37083 "Signal Transduction" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(11197605 10087910))))
((((290068
"Platelet-Derived Growth Factor beta Receptor"
("aapp" "gngm" "rcpt" "enzy"))
(37083 "Signal Transduction" ("celf"))
"CAUSES"
"gngm"
"celf"
(15650217 15590688 9916027))
((37083 "Signal Transduction" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(24447081 22447942 19530997 19075672 18699801))
((4096 "Asthma" ("dsyn"))
(37083 "Signal Transduction" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(11197605 10087910))))
((((812228 "AKT1 gene" ("aapp" "phsu" "enzy" "gngm" "bacs"))
(37083 "Signal Transduction" ("celf"))
"CAUSES"
"gngm"
"celf"
(23222563 14505491 12960248))
((37083 "Signal Transduction" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(24447081 22447942 19530997 19075672 18699801))
((4096 "Asthma" ("dsyn"))
(37083 "Signal Transduction" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(11197605 10087910))))
()
()
()
()
()
()
()
()
()
((((1439337 "tyrosine kinase ABL1" ("aapp" "gngm" "enzy"))
(37083 "Signal Transduction" ("celf"))
"CAUSES"
"gngm"
"celf"
(9517496))
((37083 "Signal Transduction" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(24447081 22447942 19530997 19075672 18699801))
((4096 "Asthma" ("dsyn"))
(37083 "Signal Transduction" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(11197605 10087910))))
((((80092
"Macrophage Colony-Stimulating Factor Receptor"
("enzy" "aapp" "imft" "gngm"))
(37083 "Signal Transduction" ("celf"))
"CAUSES"
"gngm"
"celf"
(27224507))
((37083 "Signal Transduction" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(24447081 22447942 19530997 19075672 18699801))
((4096 "Asthma" ("dsyn"))
(37083 "Signal Transduction" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(11197605 10087910))))
()
((((32200 "Platelet-Derived Growth Factor" ("gngm" "aapp" "bacs"))
(37083 "Signal Transduction" ("celf"))
"CAUSES"
"gngm"
"celf"
(23103565 19711112 19458196 17956356 7802667 2783138))
((37083 "Signal Transduction" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(24447081 22447942 19530997 19075672 18699801))
((4096 "Asthma" ("dsyn"))
(37083 "Signal Transduction" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(11197605 10087910))))
()
((((206364 "Receptor Protein-Tyrosine Kinases" ("enzy" "rcpt" "gngm" "aapp"))
(37083 "Signal Transduction" ("celf"))
"CAUSES"
"gngm"
"celf"
(24743893
20806817
17118962
16727886
15176971
13678963
11916364
11912280
11802165
9627110
9047384
7784069
7537742))
((37083 "Signal Transduction" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(24447081 22447942 19530997 19075672 18699801))
((4096 "Asthma" ("dsyn"))
(37083 "Signal Transduction" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(11197605 10087910))))
()
()
((((812385 "BCR gene" ("gngm" "bacs" "enzy" "aapp"))
(37083 "Signal Transduction" ("celf"))
"CAUSES"
"gngm"
"celf"
(22885698 15887041 15494014 15494014 11406357 11406357))
((37083 "Signal Transduction" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(24447081 22447942 19530997 19075672 18699801))
((4096 "Asthma" ("dsyn"))
(37083 "Signal Transduction" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(11197605 10087910))))
()
((((597357 "receptor" ("aapp" "gngm" "rcpt"))
(37083 "Signal Transduction" ("celf"))
"CAUSES"
"gngm"
"celf"
(27904762
27479325
27194789
26748340
26283964
26198787
26001588
25954136
25522385
25457352
25250214
24987288
24847082
24404331
24098092
23380704
22310710
22132325
22014238
21824992
21291419
21050922
20505987
20003820
19888967
19465516
19348466
19203114
19001047
18952824
18380671
18367502
17920519
17632123
17485341
17466390
17373355
17355284
17303405
17254012
16956790
16956790
16371473
15827888
15795223
15583862
15356058
14731813
14731813
12919066
12110144
11544033
10917832
10859220
10762594
10629036
10533704
10374695
9842573
9380811
9136757
8875430
7669492
7532590
7512770
1326354
1323348))
((37083 "Signal Transduction" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(24447081 22447942 19530997 19075672 18699801))
((4096 "Asthma" ("dsyn"))
(37083 "Signal Transduction" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(11197605 10087910))))
((((31727 "Phosphotransferases" ("aapp" "gngm" "enzy"))
(37083 "Signal Transduction" ("celf"))
"CAUSES"
"gngm"
"celf"
(27994757
26852687
25367076
24931696
23979726
23862981
22002603
21848862
21629734
20159963
19636563
17408432
12881713
11896598
11491654
11280802
11049052
1840317
1838150))
((37083 "Signal Transduction" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(24447081 22447942 19530997 19075672 18699801))
((4096 "Asthma" ("dsyn"))
(37083 "Signal Transduction" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(11197605 10087910)))
(((31727 "Phosphotransferases" ("aapp" "gngm" "enzy"))
(1155074 "mast cell activation" ("celf"))
"CAUSES"
"gngm"
"celf"
(20956018))
((1155074 "mast cell activation" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(18209484 10352758))
((4096 "Asthma" ("dsyn"))
(1155074 "mast cell activation" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(2741114))))
()
()
()
((((79427 "Tumor Suppressor Genes" ("gngm" "aapp"))
(37083 "Signal Transduction" ("celf"))
"CAUSES"
"gngm"
"celf"
(17230190 15735964))
((37083 "Signal Transduction" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(24447081 22447942 19530997 19075672 18699801))
((4096 "Asthma" ("dsyn"))
(37083 "Signal Transduction" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(11197605 10087910))))
((((105770 "beta catenin" ("aapp" "gngm" "bacs"))
(37083 "Signal Transduction" ("celf"))
"CAUSES"
"gngm"
"celf"
(25534229 20926645 19717519 10347231))
((37083 "Signal Transduction" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(24447081 22447942 19530997 19075672 18699801))
((4096 "Asthma" ("dsyn"))
(37083 "Signal Transduction" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(11197605 10087910))))
()
((((1416655 "KIT gene" ("bacs" "imft" "gngm" "aapp"))
(37083 "Signal Transduction" ("celf"))
"CAUSES"
"gngm"
"celf"
(18538998))
((37083 "Signal Transduction" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(24447081 22447942 19530997 19075672 18699801))
((4096 "Asthma" ("dsyn"))
(37083 "Signal Transduction" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(11197605 10087910)))
(((1416655 "KIT gene" ("bacs" "imft" "gngm" "aapp"))
(1155074 "mast cell activation" ("celf"))
"CAUSES"
"gngm"
"celf"
(12373338))
((1155074 "mast cell activation" ("celf"))
(4096 "Asthma" ("dsyn"))
"AFFECTS"
"celf"
"dsyn"
(18209484 10352758))
((4096 "Asthma" ("dsyn"))
(1155074 "mast cell activation" ("celf"))
"MANIFESTATION_OF"
"dsyn"
"celf"
(2741114)))))
|#
(displayln
"Finished loading paths-of-interest")
;; Genes inhibited by Gleevec
;;
;; Of the 52 results, at least a few appear to be classes of genes
;; rather than specific genes:
;;
;; (3241 "Antibodies" ("gngm" "aapp" "imft"))
;; (4891 "Fusion Proteins, bcr-abl" ("aapp" "gngm" "bacs"))
;; (31727 "Phosphotransferases" ("aapp" "gngm" "enzy"))
;; (33640 "PROTEIN KINASE" ("gngm" "enzy" "aapp"))
;; (33684 "Proteins" ("bacs" "gngm" "aapp"))
;; (79050 "c-abl Proto-Oncogenes" ("aapp" "gngm"))
;; (79413 "Genes, abl" ("gngm" "aapp"))
;; (79427 "Tumor Suppressor Genes" ("gngm" "aapp"))
;; (80298 "v-src Oncogenes" ("gngm" "aapp" "enzy" "aapp" "gngm" "bacs"))
;; (597357 "receptor" ("aapp" "gngm" "rcpt"))
;; (1136340 "Semaphorins" ("bacs" "gngm" "aapp"))
;;
;; Of course, is something like (33684 "Proteins" ("bacs" "gngm" "aapp"))
;; even considered a gene class?
;;
;; Oh wow--I had missed the first one of the c-kit names before!
;; So there are actually three synonyms, not two.
;;
;; (72470 "Proto-Oncogene Protein c-kit" ("aapp" "gngm" "rcpt" "imft"))
;; (920288 "C-KIT Gene" ("gngm" "aapp"))
;; (1416655 "KIT gene" ("bacs" "imft" "gngm" "aapp"))
;;
;; So, of the 52 results, ~10 are actually categories rather
;; than specific genes. Of the remaining ~40 specific genes, 3 of
;; them are synonyms/aliases for KIT.
;;
(time (rem-dups
(run* (q)
(fresh (drug gene e-drug/gene p-drug/gene e-drug/gene-rest)
(== gene q)
(== '(935987 "Gleevec" ("orch" "phsu")) drug)
(== `(,drug ,gene ,p-drug/gene . ,e-drug/gene-rest) e-drug/gene)
(== "INHIBITS" p-drug/gene)
(edgeo e-drug/gene)
(fresh (cui name concept-type*)
(== `(,cui ,name ,concept-type*) gene)
(membero "gngm" concept-type*))))))
;; =>
#|
'((2716 "Amyloid" ("bacs" "aapp" "gngm"))
(3241 "Antibodies" ("gngm" "aapp" "imft"))
(4891 "Fusion Proteins, bcr-abl" ("aapp" "gngm" "bacs"))
(31727 "Phosphotransferases" ("aapp" "gngm" "enzy"))
(32200 "Platelet-Derived Growth Factor" ("gngm" "aapp" "bacs"))
(33640 "PROTEIN KINASE" ("gngm" "enzy" "aapp"))
(33681 "Protein Tyrosine Kinase" ("enzy" "gngm" "aapp"))
(33684 "Proteins" ("bacs" "gngm" "aapp"))
(65344
"Lymphocyte Specific Protein Tyrosine Kinase p56(lck)"
("aapp" "gngm" "enzy"))
(71253 "Platelet-Derived Growth Factor Receptor" ("aapp" "gngm" "enzy"))
(72470 "Proto-Oncogene Protein c-kit" ("aapp" "gngm" "rcpt" "imft"))
(79050 "c-abl Proto-Oncogenes" ("aapp" "gngm"))
(79413 "Genes, abl" ("gngm" "aapp"))
(79427 "Tumor Suppressor Genes" ("gngm" "aapp"))
(80298 "v-src Oncogenes" ("gngm" "aapp" "enzy" "aapp" "gngm" "bacs"))
(80092
"Macrophage Colony-Stimulating Factor Receptor"
("enzy" "aapp" "imft" "gngm"))
(105770 "beta catenin" ("aapp" "gngm" "bacs"))
(138965 "protein-tyrosine kinase c-src" ("gngm" "aapp" "enzy"))
(164786 "Proto-Oncogene Proteins c-akt" ("gngm" "aapp" "enzy"))
(174680 "Cyclin D1" ("gngm" "bacs" "aapp"))
(206364 "Receptor Protein-Tyrosine Kinases" ("enzy" "rcpt" "gngm" "aapp"))
(246681 "platelet-derived growth factor BB" ("gngm" "phsu" "aapp"))
(287666 "Rad51 Recombinase" ("gngm" "aapp" "enzy"))
(290067
"Platelet-Derived Growth Factor alpha Receptor"
("rcpt" "aapp" "gngm" "enzy"))
(290068
"Platelet-Derived Growth Factor beta Receptor"
("aapp" "gngm" "rcpt" "enzy"))
(390431 "PDGF receptor tyrosine kinase" ("aapp" "gngm"))
(597357 "receptor" ("aapp" "gngm" "rcpt"))
(812228 "AKT1 gene" ("aapp" "phsu" "enzy" "gngm" "bacs"))
(812253 "CRKL gene" ("bacs" "aapp" "gngm"))
(812375 "ELK3 gene" ("enzy" "gngm" "bacs" "aapp"))
(812385 "BCR gene" ("gngm" "bacs" "enzy" "aapp"))
(915156 "Ephrin Receptor EphA8" ("gngm" "enzy" "aapp"))
(879468 "CSF1R gene" ("aapp" "imft" "rcpt" "gngm" "enzy"))
(919477 "LCK gene" ("aapp" "enzy" "gngm"))
(920288 "C-KIT Gene" ("gngm" "aapp"))
(1136340 "Semaphorins" ("bacs" "gngm" "aapp"))
(1333568 "FLT3 gene" ("gngm" "phsu" "bacs" "aapp"))
(1335202 "PDGFRB gene" ("bacs" "gngm" "rcpt" "enzy" "aapp"))
(1335239 "PPBP gene" ("bacs" "aapp" "gngm"))
(1364818 "APP gene" ("enzy" "gngm" "bacs" "aapp" "imft"))
(1366876 "MAPK14 gene" ("gngm" "aapp" "enzy"))
(1412097 "ABL1 gene" ("imft" "enzy" "gngm" "aapp" "bacs" "phsu"))
(1416655 "KIT gene" ("bacs" "imft" "gngm" "aapp"))
(1419240 "RAD51 gene" ("enzy" "gngm" "aapp"))
(1421416 "UVRAG gene" ("gngm" "phsu" "aapp"))
(1424677 "CKAP4 gene" ("gngm" "aapp" "bacs" "phsu"))
(1422009 "TP63 gene" ("rcpt" "phsu" "imft" "aapp" "gngm"))
(1425835 "KCNH8 gene" ("gngm" "aapp" "bacs"))
(1428985 "PDGFD gene" ("aapp" "gngm"))
(1439337 "tyrosine kinase ABL1" ("aapp" "gngm" "enzy"))
(1439347 "BTG1 gene" ("gngm" "aapp"))
(1826328 "MTTP gene" ("aapp" "lipd" "gngm" "imft" "phsu" "bacs")))
|#
;; interesting! A direct *causal* link between KIT/C-KIT and asthma
;; seems unknown. So we are not just trying to connect a drug and
;; disease, but also KIT and the disease.
;;
;; This does make sense, in that if such a direct connection were
;; known, SemMedDB would probably have a direct link between imatinib
;; and asthma.
(map
(lambda (gene)
(let ((disorders
(run* (q)
(fresh (e0 celf disorder pred disorder-type rest0)
(== e0 q)
(fuzzy-concepto "asthma" disorder)
(== `(,gene ,disorder ,pred "gngm" ,disorder-type . ,rest0) e0)
(edgeo e0)))))
(let ((disorders (rem-dups disorders)))
disorders)))
'((1416655 "KIT gene" ("bacs" "imft" "gngm" "aapp"))
(920288 "C-KIT Gene" ("gngm" "aapp"))
(72470 "Proto-Oncogene Protein c-kit" ("aapp" "gngm" "rcpt" "imft"))))
;; =>
#|
'(()
(((920288 "C-KIT Gene" ("gngm" "aapp"))
(155877 "Extrinsic asthma NOS" ("dsyn"))
"ASSOCIATED_WITH"
"gngm"
"dsyn"
(25337192 22505052)))
())
|#
(displayln
"Finished loading no causal relationship")
;; Here is a first attempt at pruning down the number of candidate
;; diseases, removing only those diseases known to be treated by our
;; specific drug of interest (Gleevec) rather than all forms of
;; imatinib.
;;
;; We found not only asthma, but a strong suggestion that Gleevec
;; might treat diabetes (something the query writer didn't know before
;; looking at these answers). It turns out that the connection
;; between Gleevec and diabetes *is* known, but without using an
;; ontology or other ways to connect concepts, not all
;; diabetes-related entries were automatically removed. Still, we
;; think this is interesting, since the connection to diabletes that
;; was discovered is *indirect*, and simulates the sort of discovery
;; we would hope for in practice.
;;
;;
;; Original comments follow:
;;
;;
;; remove from the 154 disorders (no neoplasms or pathologic functions)
;; of interest those 53 disorders, neoplasms, or pathologic functions
;; directly treated by Gleevec
;;
;; result is 151 diseases, including the useless "Disease" and "Syndrome" and "Degenerative disorder",
;; and including:
;; * at least 4 entries for epilepsy
;; * approximately 7 entries related to kidney/renal disease
;; * approximately 9 entries related to diabetes
;; etc.
;;
;; Seems like there are a number of groups of diseases within the 151
;; diseases. For example, diabetes is probably worth a look.
;;
;; And, of course, there is the 1 entry for asthma
;;
;; Wow!
;;
;; https://www.nbcnews.com/health/health-news/cancer-drug-gleevec-might-slow-type-1-diabetes-n771241
;;
;; https://www.medscape.com/viewarticle/882089
;;
;; http://www.ajmc.com/newsroom/scientists-find-accidental-cure-for-type-2-diabetes-imatinib
;;
;; March 29, 2016
;;
;; "The cancer drug imatinib—marketed as Gleevec and known as a game-changer for conditions like chronic myeloid leukemia—may prove the same in type 2 diabetes (T2D), according to a study published recently in Diabetes."
;;
;;
;; The article:
;;
;; http://diabetes.diabetesjournals.org/content/65/4/829
;;
;; Oh, SemMedDB does contain this information! The list of diseases Gleevec treats includes:
;;
;; (11847 "Diabetes" ("dsyn"))
;; (11860 "Diabetes Mellitus, Non-Insulin-Dependent" ("dsyn"))
;;
;; The problem, of course, is that without doing more reasoning using
;; an ontology or external information, or maybe getting lucky with
;; the ISA predicate, the query has no way of knowing that those 9
;; diabetes-related entries are actually related to the entry
;; (11847 "Diabetes" ("dsyn")).
;;
;; Still, I was pleased that *I* learned something from the query, and
;; that the signal was quite strong after all of that filtering.
;;
;; So, with more resoning, perhaps using an ontology, we should be
;; able to reduce the ~150 answers by removing (or at least ranking
;; lower) answers related to the diseases we know Gleevec treats.
;;
;; Seems that the full story is a bit complicated. There are papers
;; indicating that imatinib/Gleevec treats diabetes in mouse models.
;; At least one clinical trial on humans didn't seem to show
;; improvement.
(set-subtraction
'((10054 "Coronary Arteriosclerosis" ("dsyn"))
(41107 "Trisomy" ("dsyn"))
(25517 "Metabolic Diseases" ("dsyn"))
(15695 "Fatty Liver" ("dsyn"))
(752304 "Hypoxic-Ischemic Encephalopathy" ("dsyn"))
(17732 "Glucose Intolerance" ("dsyn"))
(158981 "Neonatal diabetes mellitus" ("dsyn"))
(6267 "Bronchiectasis" ("dsyn"))
(11616 "Contact Dermatitis" ("dsyn"))
(32285 "Pneumonia" ("dsyn"))
(1519680 "Tumor Immunity" ("dsyn"))
(242231 "Coronary Stenosis" ("dsyn"))
(729353 "Subfertility" ("dsyn"))
(9447 "Common Variable Immunodeficiency" ("dsyn"))
(33860 "Psoriasis" ("dsyn"))
(30920 "Peptic Ulcer" ("dsyn"))
(87086 "Thrombus" ("dsyn"))
(339510 "Vitelliform dystrophy" ("dsyn"))
(1857 "AIDS related complex" ("dsyn"))
(14038 "Encephalitis" ("dsyn"))
(35334 "Retinitis Pigmentosa" ("dsyn"))
(19163 "Hepatitis B" ("dsyn"))
(35435 "Rheumatism" ("dsyn"))
(38525 "Subarachnoid Hemorrhage" ("dsyn"))
(221757 "alpha 1-Antitrypsin Deficiency" ("dsyn"))
(948089 "Acute coronary syndrome" ("dsyn"))
(231341 "Premature aging syndrome" ("dsyn"))
(14553 "Absence Epilepsy" ("dsyn"))
(19151 "Hepatic Encephalopathy" ("dsyn"))
(20437 "Hypercalcemia" ("dsyn"))
(24899 "mastocytosis" ("dsyn"))
(178664 "Glomerulosclerosis" ("dsyn"))
(4153 "Atherosclerosis" ("dsyn"))
(4623 "Bacterial Infections" ("dsyn"))
(15397 "Eye diseases" ("dsyn"))
(21051 "Immunologic Deficiency Syndromes" ("dsyn"))
(26848 "Myopathy" ("dsyn"))
(35304 "Retinal Degeneration" ("dsyn"))
(35309 "Retinal Diseases" ("dsyn"))
(38220 "Status Epilepticus" ("dsyn"))
(85084 "Motor Neuron Disease" ("dsyn"))
(339573 "Primary open angle glaucoma" ("dsyn"))
(1285162 "Degenerative disorder" ("dsyn"))
(1290884 "Inflammatory disorder" ("dsyn"))
(1536085 "Geographic atrophy" ("dsyn"))
(18133 "Graft-vs-Host Disease" ("dsyn"))
(20459 "Hyperinsulinism" ("dsyn"))
(9319 "Colitis" ("dsyn"))
(11881 "Diabetic Nephropathy" ("dsyn"))
(14544 "Epilepsy" ("dsyn"))
(17601 "Glaucoma" ("dsyn"))
(19158 "Hepatitis" ("dsyn"))
(20456 "Hyperglycemia" ("dsyn"))
(20538 "Hypertensive disease" ("dsyn"))
(20550 "Hyperthyroidism" ("dsyn"))
(20615 "hypoglycemia" ("dsyn"))
(24141 "Lupus Erythematosus, Systemic" ("dsyn"))
(30305 "Pancreatitis" ("dsyn"))
(33626 "Protein Deficiency" ("dsyn"))
(36421 "Systemic Scleroderma" ("dsyn"))
(38454 "Cerebrovascular accident" ("dsyn"))
(151747 "Renal tubular disorder" ("dsyn"))
(239946 "Fibrosis, Liver" ("dsyn"))
(270814 "Spastic syndrome" ("dsyn"))
(400966 "Non-alcoholic fatty liver" ("dsyn"))
(878544 "Cardiomyopathies" ("dsyn"))
(948008 "Ischemic stroke" ("dsyn"))
(1175 "Acquired Immunodeficiency Syndrome" ("dsyn"))
(1824 "Agranulocytosis" ("dsyn"))
(2395 "Alzheimer's Disease" ("dsyn"))
(2736 "Amyotrophic Lateral Sclerosis" ("dsyn"))
(2871 "Anemia" ("dsyn"))
(3873 "Rheumatoid Arthritis" ("dsyn"))
(4135 "Ataxia Telangiectasia" ("dsyn"))
(4364 "Autoimmune Diseases" ("dsyn"))
(7193 "Cardiomyopathy, Dilated" ("dsyn"))
(7222 "Cardiovascular Diseases" ("dsyn"))
(7785 "Cerebral Infarction" ("dsyn"))
(8312 "Primary biliary cirrhosis" ("dsyn"))
(8370 "Cholestasis" ("dsyn"))
(11615 "Dermatitis, Atopic" ("dsyn"))
(11847 "Diabetes" ("dsyn"))
(11849 "Diabetes Mellitus" ("dsyn"))
(11854 "Diabetes Mellitus, Insulin-Dependent" ("dsyn"))
(11860 "Diabetes Mellitus, Non-Insulin-Dependent" ("dsyn"))
(11884 "Diabetic Retinopathy" ("dsyn"))
(13595 "Eczema" ("dsyn"))
(14175 "Endometriosis, site unspecified" ("dsyn"))
(17152 "Gastritis" ("dsyn"))
(17658 "Glomerulonephritis" ("dsyn"))
(18799 "Heart Diseases" ("dsyn"))
(18801 "Heart failure" ("dsyn"))
(19693 "HIV Infections" ("dsyn"))
(20179 "Huntington Disease" ("dsyn"))
(20542 "Hypertension, Pulmonary" ("dsyn"))
(21053 "Immune System Diseases" ("dsyn"))
(21311 "Infection" ("dsyn"))
(21359 "Infertility" ("dsyn"))
(21364 "Infertility, Male" ("dsyn"))
(21390 "Inflammatory Bowel Diseases" ("dsyn"))
(22116 "Ischemia" ("dsyn"))
(22658 "Kidney Diseases" ("dsyn"))
(22660 "Kidney Failure, Acute" ("dsyn"))
(23530 "Leukopenia" ("dsyn"))
(23895 "Liver diseases" ("dsyn"))
(24117 "Chronic Obstructive Airway Disease" ("dsyn"))
(24312 "Lymphopenia" ("dsyn"))
(26769 "Multiple Sclerosis" ("dsyn"))
(27051 "Myocardial Infarction" ("dsyn"))
(27765 "nervous system disorder" ("dsyn"))
(28754 "Obesity" ("dsyn"))
(29408 "Degenerative polyarthritis" ("dsyn"))
(29456 "Osteoporosis" ("dsyn"))
(30567 "Parkinson Disease" ("dsyn"))
(31763 "Photosensitization" ("dsyn"))
(32914 "Pre-Eclampsia" ("dsyn"))
(35305 "Retinal Detachment" ("dsyn"))
(36690 "Septicemia" ("dsyn"))
(38644 "Sudden infant death syndrome" ("dsyn"))
(39082 "Syndrome" ("dsyn"))
(40034 "Thrombocytopenia" ("dsyn"))
(41296 "Tuberculosis" ("dsyn"))
(42024 "Urinary Incontinence" ("dsyn"))
(42341 "Varicocele" ("dsyn"))
(42721 "Viral hepatitis" ("dsyn"))
(42769 "Virus Diseases" ("dsyn"))
(86543 "Cataract" ("anab" "dsyn"))
(151650 "Renal fibrosis" ("dsyn"))
(151744 "Myocardial Ischemia" ("dsyn"))
(158266 "Degenerative disc disease NOS" ("dsyn"))
(162557 "Liver Failure, Acute" ("dsyn"))
(162871 "Aortic Aneurysm, Abdominal" ("dsyn"))
(206139 "Lichen Planus, Oral" ("dsyn"))
(238806 "BONE MASS" ("dsyn"))
(242350 "Erectile dysfunction" ("dsyn"))
(242383 "Age related macular degeneration" ("dsyn"))
(242422 "Parkinsonian Disorders" ("dsyn"))
(268731 "Renal glomerular disease" ("dsyn"))
(270994 "Steroid-induced myopathy" ("dsyn"))
(339527 "Leber's amaurosis" ("dsyn"))
(340970 "Congenital neutropenia" ("dsyn"))
(343641 "Human papilloma virus infection" ("dsyn"))
(456909 "Blind Vision" ("dsyn"))
(524851 "Neurodegenerative Disorders" ("dsyn"))
(677607 "Hashimoto Disease" ("dsyn"))
(856169 "Endothelial dysfunction" ("dsyn"))
(857357 "Hepatic pathology" ("dsyn"))
(917798 "Cerebral Ischemia" ("dsyn"))
(1281300 "Vascular degeneration" ("dsyn"))
(1456670 "Nerve Diseases" ("dsyn"))
(4096 "Asthma" ("dsyn"))
(12634 "Disease" ("dsyn"))
(22661 "Kidney Failure, Chronic" ("dsyn"))
(23882 "Little's Disease" ("dsyn")))
'((2395 "Alzheimer's Disease" ("dsyn"))
(8679 "Chronic Disease" ("dsyn"))
(5699 "Blast Phase" ("neop"))
(11847 "Diabetes" ("dsyn"))
(16059 "Fibrosis" ("patf"))
(11860 "Diabetes Mellitus, Non-Insulin-Dependent" ("dsyn"))
(37274 "skin disorder" ("dsyn"))
(21655 "Insulin Resistance" ("patf"))
(206141 "Idiopathic Hypereosinophilic Syndrome" ("dsyn"))
(6826 "Malignant Neoplasms" ("neop"))
(878773 "Overactive Bladder" ("dsyn"))
(332448 "Infiltration" ("patf"))
(1167698 "Leukaemic retinopathy" ("dsyn"))
(7129 "Merkel cell carcinoma" ("neop"))
(1258104 "Diffuse Scleroderma" ("dsyn"))
(920563 "insulin sensitivity" ("patf"))
(7131 "Carcinoma, Non-Small-Cell Lung" ("neop"))
(7134 "Renal Cell Carcinoma" ("neop"))
(17185 "Gastrointestinal Neoplasms" ("neop"))
(17636 "Glioblastoma" ("neop"))
(23418 "leukemia" ("neop"))
(23449 "Leukemia, Lymphocytic, Acute" ("neop"))
(23467 "Leukemia, Myelocytic, Acute" ("neop"))
(23473 "Myeloid Leukemia, Chronic" ("neop"))
(23474 "Leukemia, Myeloid, Chronic-Phase" ("neop"))
(24221 "Lymphangioma" ("neop"))
(25149 "medulloblastoma" ("neop"))
(25202 "melanoma" ("neop"))
(26948 "Mycosis Fungoides" ("neop"))
(27627 "Neoplasm Metastasis" ("neop"))
(27651 "Neoplasm" ("neop"))
(27831 "Neurofibromatosis 1" ("neop"))
(27859 "Acoustic Neuroma" ("neop"))
(35335 "Retinoblastoma" ("neop"))
(85669 "Acute leukemia" ("neop"))
(152276 "Granulocytic Sarcoma" ("neop"))
(153658 "Malignant neoplasm of endocrine gland" ("neop"))
(153690 "Secondary malignant neoplasm of bone" ("neop"))
(220633 "Intraocular melanoma" ("neop"))
(238198 "Gastrointestinal Stromal Tumors" ("neop"))
(242596 "Neoplasm, Residual" ("neop"))
(279543
"Philadelphia chromosome positive chronic myelogenous leukemia"
("neop"))
(279671 "Cervical Squamous Cell Carcinoma" ("neop"))
(280100 "Solid tumor" ("neop"))
(334486 "Sarcoma, Endometrial Stromal, Low-Grade" ("neop"))
(334569 "Odontogenic myxoma" ("neop"))
(346429 "Multiple malignancy" ("neop"))
(392784 "Dermatofibrosarcoma Protuberans" ("neop"))
(677886 "Epithelial ovarian cancer" ("neop"))
(856536 "Philadelphia chromosome positive" ("neop"))
(1261473 "sarcoma" ("neop"))
(1336869 "Unresectable Malignant Neoplasm" ("neop"))
(1370723 "Stromal sarcoma" ("neop"))))
;; =>
#|
'((10054 "Coronary Arteriosclerosis" ("dsyn"))
(41107 "Trisomy" ("dsyn"))
(25517 "Metabolic Diseases" ("dsyn"))
(15695 "Fatty Liver" ("dsyn"))
(752304 "Hypoxic-Ischemic Encephalopathy" ("dsyn"))
(17732 "Glucose Intolerance" ("dsyn"))
(158981 "Neonatal diabetes mellitus" ("dsyn"))
(6267 "Bronchiectasis" ("dsyn"))
(11616 "Contact Dermatitis" ("dsyn"))
(32285 "Pneumonia" ("dsyn"))
(1519680 "Tumor Immunity" ("dsyn"))
(242231 "Coronary Stenosis" ("dsyn"))
(729353 "Subfertility" ("dsyn"))
(9447 "Common Variable Immunodeficiency" ("dsyn"))
(33860 "Psoriasis" ("dsyn"))
(30920 "Peptic Ulcer" ("dsyn"))
(87086 "Thrombus" ("dsyn"))
(339510 "Vitelliform dystrophy" ("dsyn"))
(1857 "AIDS related complex" ("dsyn"))
(14038 "Encephalitis" ("dsyn"))
(35334 "Retinitis Pigmentosa" ("dsyn"))
(19163 "Hepatitis B" ("dsyn"))
(35435 "Rheumatism" ("dsyn"))
(38525 "Subarachnoid Hemorrhage" ("dsyn"))
(221757 "alpha 1-Antitrypsin Deficiency" ("dsyn"))
(948089 "Acute coronary syndrome" ("dsyn"))
(231341 "Premature aging syndrome" ("dsyn"))
(14553 "Absence Epilepsy" ("dsyn"))
(19151 "Hepatic Encephalopathy" ("dsyn"))
(20437 "Hypercalcemia" ("dsyn"))
(24899 "mastocytosis" ("dsyn"))
(178664 "Glomerulosclerosis" ("dsyn"))
(4153 "Atherosclerosis" ("dsyn"))
(4623 "Bacterial Infections" ("dsyn"))
(15397 "Eye diseases" ("dsyn"))
(21051 "Immunologic Deficiency Syndromes" ("dsyn"))
(26848 "Myopathy" ("dsyn"))
(35304 "Retinal Degeneration" ("dsyn"))
(35309 "Retinal Diseases" ("dsyn"))
(38220 "Status Epilepticus" ("dsyn"))
(85084 "Motor Neuron Disease" ("dsyn"))
(339573 "Primary open angle glaucoma" ("dsyn"))
(1285162 "Degenerative disorder" ("dsyn"))
(1290884 "Inflammatory disorder" ("dsyn"))
(1536085 "Geographic atrophy" ("dsyn"))
(18133 "Graft-vs-Host Disease" ("dsyn"))
(20459 "Hyperinsulinism" ("dsyn"))
(9319 "Colitis" ("dsyn"))
(11881 "Diabetic Nephropathy" ("dsyn"))
(14544 "Epilepsy" ("dsyn"))
(17601 "Glaucoma" ("dsyn"))
(19158 "Hepatitis" ("dsyn"))
(20456 "Hyperglycemia" ("dsyn"))
(20538 "Hypertensive disease" ("dsyn"))
(20550 "Hyperthyroidism" ("dsyn"))
(20615 "hypoglycemia" ("dsyn"))
(24141 "Lupus Erythematosus, Systemic" ("dsyn"))
(30305 "Pancreatitis" ("dsyn"))
(33626 "Protein Deficiency" ("dsyn"))
(36421 "Systemic Scleroderma" ("dsyn"))
(38454 "Cerebrovascular accident" ("dsyn"))
(151747 "Renal tubular disorder" ("dsyn"))
(239946 "Fibrosis, Liver" ("dsyn"))
(270814 "Spastic syndrome" ("dsyn"))
(400966 "Non-alcoholic fatty liver" ("dsyn"))
(878544 "Cardiomyopathies" ("dsyn"))
(948008 "Ischemic stroke" ("dsyn"))
(1175 "Acquired Immunodeficiency Syndrome" ("dsyn"))
(1824 "Agranulocytosis" ("dsyn"))
(2736 "Amyotrophic Lateral Sclerosis" ("dsyn"))
(2871 "Anemia" ("dsyn"))
(3873 "Rheumatoid Arthritis" ("dsyn"))
(4135 "Ataxia Telangiectasia" ("dsyn"))
(4364 "Autoimmune Diseases" ("dsyn"))
(7193 "Cardiomyopathy, Dilated" ("dsyn"))
(7222 "Cardiovascular Diseases" ("dsyn"))
(7785 "Cerebral Infarction" ("dsyn"))
(8312 "Primary biliary cirrhosis" ("dsyn"))
(8370 "Cholestasis" ("dsyn"))
(11615 "Dermatitis, Atopic" ("dsyn"))
(11849 "Diabetes Mellitus" ("dsyn"))
(11854 "Diabetes Mellitus, Insulin-Dependent" ("dsyn"))
(11884 "Diabetic Retinopathy" ("dsyn"))
(13595 "Eczema" ("dsyn"))
(14175 "Endometriosis, site unspecified" ("dsyn"))
(17152 "Gastritis" ("dsyn"))
(17658 "Glomerulonephritis" ("dsyn"))
(18799 "Heart Diseases" ("dsyn"))
(18801 "Heart failure" ("dsyn"))
(19693 "HIV Infections" ("dsyn"))
(20179 "Huntington Disease" ("dsyn"))
(20542 "Hypertension, Pulmonary" ("dsyn"))
(21053 "Immune System Diseases" ("dsyn"))
(21311 "Infection" ("dsyn"))
(21359 "Infertility" ("dsyn"))
(21364 "Infertility, Male" ("dsyn"))
(21390 "Inflammatory Bowel Diseases" ("dsyn"))
(22116 "Ischemia" ("dsyn"))
(22658 "Kidney Diseases" ("dsyn"))
(22660 "Kidney Failure, Acute" ("dsyn"))
(23530 "Leukopenia" ("dsyn"))
(23895 "Liver diseases" ("dsyn"))
(24117 "Chronic Obstructive Airway Disease" ("dsyn"))
(24312 "Lymphopenia" ("dsyn"))
(26769 "Multiple Sclerosis" ("dsyn"))
(27051 "Myocardial Infarction" ("dsyn"))
(27765 "nervous system disorder" ("dsyn"))
(28754 "Obesity" ("dsyn"))
(29408 "Degenerative polyarthritis" ("dsyn"))
(29456 "Osteoporosis" ("dsyn"))
(30567 "Parkinson Disease" ("dsyn"))
(31763 "Photosensitization" ("dsyn"))
(32914 "Pre-Eclampsia" ("dsyn"))
(35305 "Retinal Detachment" ("dsyn"))
(36690 "Septicemia" ("dsyn"))
(38644 "Sudden infant death syndrome" ("dsyn"))
(39082 "Syndrome" ("dsyn"))
(40034 "Thrombocytopenia" ("dsyn"))
(41296 "Tuberculosis" ("dsyn"))
(42024 "Urinary Incontinence" ("dsyn"))
(42341 "Varicocele" ("dsyn"))
(42721 "Viral hepatitis" ("dsyn"))
(42769 "Virus Diseases" ("dsyn"))
(86543 "Cataract" ("anab" "dsyn"))
(151650 "Renal fibrosis" ("dsyn"))
(151744 "Myocardial Ischemia" ("dsyn"))
(158266 "Degenerative disc disease NOS" ("dsyn"))
(162557 "Liver Failure, Acute" ("dsyn"))
(162871 "Aortic Aneurysm, Abdominal" ("dsyn"))
(206139 "Lichen Planus, Oral" ("dsyn"))
(238806 "BONE MASS" ("dsyn"))
(242350 "Erectile dysfunction" ("dsyn"))
(242383 "Age related macular degeneration" ("dsyn"))
(242422 "Parkinsonian Disorders" ("dsyn"))
(268731 "Renal glomerular disease" ("dsyn"))
(270994 "Steroid-induced myopathy" ("dsyn"))
(339527 "Leber's amaurosis" ("dsyn"))
(340970 "Congenital neutropenia" ("dsyn"))
(343641 "Human papilloma virus infection" ("dsyn"))
(456909 "Blind Vision" ("dsyn"))
(524851 "Neurodegenerative Disorders" ("dsyn"))
(677607 "Hashimoto Disease" ("dsyn"))
(856169 "Endothelial dysfunction" ("dsyn"))
(857357 "Hepatic pathology" ("dsyn"))
(917798 "Cerebral Ischemia" ("dsyn"))
(1281300 "Vascular degeneration" ("dsyn"))
(1456670 "Nerve Diseases" ("dsyn"))
(4096 "Asthma" ("dsyn"))
(12634 "Disease" ("dsyn"))
(22661 "Kidney Failure, Chronic" ("dsyn"))
(23882 "Little's Disease" ("dsyn")))
|#
;; Check that the gene (such as KIT) that causes a celf that affects a
;; disorder is also know to directly cause that disorder? Seems like
;; this is a basic check we should do, to both increase confidence and
;; perhaps reduce answers.
;;
;; Restrict the disease to "dsyn" or "patf", but not "neop" (since in
;; the case of imatinib/Gleevec, we already know it treats cancer).
;;
;; Try across all 47 genes of interest.
;;
;; cpu time: 18586 real time: 18595 gc time: 286
;;
;; 93 answers
;;
;; includes (4096 "Asthma" ("dsyn")) and (11847 "Diabetes" ("dsyn"))
;;
;; run by typing (gene-causes-celf-affects-disorder)
;;
(define (gene-causes-celf-affects-disorder)
(apply
union*
(map
(lambda (gene)
(let ((disorders
(run* (q)
(fresh (e0 e1 e2 e3 celf disorder disorder-type rest0 rest1 rest2 rest3)
(== disorder q)
(conde
[(== "dsyn" disorder-type)]
; [(== "neop" disorder-type)]
[(== "patf" disorder-type)])
(== `(,gene ,disorder "CAUSES" "gngm" ,disorder-type . ,rest0) e0)
(== `(,gene ,celf "CAUSES" "gngm" "celf" . ,rest1) e1)
(== `(,celf ,disorder "AFFECTS" "celf" ,disorder-type . ,rest2) e2)
(== `(,disorder ,celf "MANIFESTATION_OF" ,disorder-type "celf" . ,rest3) e3)
(edgeo e0)
(edgeo e3)
(edgeo e1)
(edgeo e2)))))
(rem-dups disorders)))
'((1428985 "PDGFD gene" ("aapp" "gngm"))
(919477 "LCK gene" ("aapp" "enzy" "gngm"))
(1136340 "Semaphorins" ("bacs" "gngm" "aapp"))
(1366876 "MAPK14 gene" ("gngm" "aapp" "enzy"))
(1364818 "APP gene" ("enzy" "gngm" "bacs" "aapp" "imft"))
(1333568 "FLT3 gene" ("gngm" "phsu" "bacs" "aapp"))
(79050 "c-abl Proto-Oncogenes" ("aapp" "gngm"))
(79413 "Genes, abl" ("gngm" "aapp"))
(812253 "CRKL gene" ("bacs" "aapp" "gngm"))
(915156 "Ephrin Receptor EphA8" ("gngm" "enzy" "aapp"))
(2716 "Amyloid" ("bacs" "aapp" "gngm"))
(3241 "Antibodies" ("gngm" "aapp" "imft"))
(33640 "PROTEIN KINASE" ("gngm" "enzy" "aapp"))
(33681 "Protein Tyrosine Kinase" ("enzy" "gngm" "aapp"))
(164786 "Proto-Oncogene Proteins c-akt" ("gngm" "aapp" "enzy"))
(33684 "Proteins" ("bacs" "gngm" "aapp"))
(246681 "platelet-derived growth factor BB" ("gngm" "phsu" "aapp"))
(290068
"Platelet-Derived Growth Factor beta Receptor"
("aapp" "gngm" "rcpt" "enzy"))
(812228 "AKT1 gene" ("aapp" "phsu" "enzy" "gngm" "bacs"))
(812375 "ELK3 gene" ("enzy" "gngm" "bacs" "aapp"))
(1335239 "PPBP gene" ("bacs" "aapp" "gngm"))
(1419240 "RAD51 gene" ("enzy" "gngm" "aapp"))
(1421416 "UVRAG gene" ("gngm" "phsu" "aapp"))
(1422009 "TP63 gene" ("rcpt" "phsu" "imft" "aapp" "gngm"))
(1424677 "CKAP4 gene" ("gngm" "aapp" "bacs" "phsu"))
(1425835 "KCNH8 gene" ("gngm" "aapp" "bacs"))
(1439347 "BTG1 gene" ("gngm" "aapp"))
(4891 "Fusion Proteins, bcr-abl" ("aapp" "gngm" "bacs"))
(1439337 "tyrosine kinase ABL1" ("aapp" "gngm" "enzy"))
(80092
"Macrophage Colony-Stimulating Factor Receptor"
("enzy" "aapp" "imft" "gngm"))
(879468 "CSF1R gene" ("aapp" "imft" "rcpt" "gngm" "enzy"))
(32200 "Platelet-Derived Growth Factor" ("gngm" "aapp" "bacs"))
(72470 "Proto-Oncogene Protein c-kit" ("aapp" "gngm" "rcpt" "imft"))
(206364 "Receptor Protein-Tyrosine Kinases" ("enzy" "rcpt" "gngm" "aapp"))
(290067
"Platelet-Derived Growth Factor alpha Receptor"
("rcpt" "aapp" "gngm" "enzy"))
(174680 "Cyclin D1" ("gngm" "bacs" "aapp"))
(812385 "BCR gene" ("gngm" "bacs" "enzy" "aapp"))
(1335202 "PDGFRB gene" ("bacs" "gngm" "rcpt" "enzy" "aapp"))
(597357 "receptor" ("aapp" "gngm" "rcpt"))
(31727 "Phosphotransferases" ("aapp" "gngm" "enzy"))
(1412097 "ABL1 gene" ("imft" "enzy" "gngm" "aapp" "bacs" "phsu"))
(71253 "Platelet-Derived Growth Factor Receptor" ("aapp" "gngm" "enzy"))
(1826328 "MTTP gene" ("aapp" "lipd" "gngm" "imft" "phsu" "bacs"))
(79427 "Tumor Suppressor Genes" ("gngm" "aapp"))
(105770 "beta catenin" ("aapp" "gngm" "bacs"))
(920288 "C-KIT Gene" ("gngm" "aapp"))
(1416655 "KIT gene" ("bacs" "imft" "gngm" "aapp"))))))
;; =>
#|
'((7193 "Cardiomyopathy, Dilated" ("dsyn"))
(19158 "Hepatitis" ("dsyn"))
(30305 "Pancreatitis" ("dsyn"))
(3873 "Rheumatoid Arthritis" ("dsyn"))
(4153 "Atherosclerosis" ("dsyn"))
(24141 "Lupus Erythematosus, Systemic" ("dsyn"))
(270814 "Spastic syndrome" ("dsyn"))
(1290884 "Inflammatory disorder" ("dsyn"))
(1857 "AIDS related complex" ("dsyn"))
(17639 "Gliosis" ("patf"))
(7222 "Cardiovascular Diseases" ("dsyn"))
(21308 "Infarction" ("patf"))
(14038 "Encephalitis" ("dsyn"))
(19151 "Hepatic Encephalopathy" ("dsyn"))
(22116 "Ischemia" ("dsyn"))
(22658 "Kidney Diseases" ("dsyn"))
(333467 "Cytopathic effect" ("patf"))
(26848 "Myopathy" ("dsyn"))
(333641 "Atrophic" ("patf"))
(28754 "Obesity" ("dsyn"))
(162871 "Aortic Aneurysm, Abdominal" ("dsyn"))
(339510 "Vitelliform dystrophy" ("dsyn"))
(1395184 "depolarization" ("patf"))
(856169 "Endothelial dysfunction" ("dsyn"))
(1521846 "Permissiveness, Biological Function" ("patf"))
(18801 "Heart failure" ("dsyn"))
(2878 "Anemia, Hemolytic" ("dsyn"))
(18188 "Granuloma" ("patf"))
(36679 "Diastasis" ("patf"))
(17658 "Glomerulonephritis" ("dsyn"))
(4368 "Autoimmunity" ("patf"))
(24312 "Lymphopenia" ("dsyn"))
(21655 "Insulin Resistance" ("patf"))
(29456 "Osteoporosis" ("dsyn"))
(1155266 "Inflammatory Response" ("patf"))
(15376 "Extravasation" ("patf"))
(14175 "Endometriosis, site unspecified" ("dsyn"))
(27055 "Myocardial Reperfusion Injury" ("patf"))
(878544 "Cardiomyopathies" ("dsyn"))
(1383860 "Cardiac Hypertrophy" ("patf"))
(1519697 "Tumorigenicity" ("patf"))
(18133 "Graft-vs-Host Disease" ("dsyn"))
(36974 "Shock" ("patf"))
(21390 "Inflammatory Bowel Diseases" ("dsyn"))
(231341 "Premature aging syndrome" ("dsyn"))
(20564 "Hypertrophy" ("patf"))
(32914 "Pre-Eclampsia" ("dsyn"))
(332448 "Infiltration" ("patf"))
(20456 "Hyperglycemia" ("dsyn"))
(11164 "Degenerative abnormality" ("patf"))
(13604 "Edema" ("patf"))
(4096 "Asthma" ("dsyn"))
(4364 "Autoimmune Diseases" ("dsyn"))
(29396 "Ossification, Heterotopic" ("patf"))
(242656 "Disease Progression" ("patf"))
(21051 "Immunologic Deficiency Syndromes" ("dsyn"))
(242184 "Hypoxia" ("patf"))
(21311 "Infection" ("dsyn"))
(38454 "Cerebrovascular accident" ("dsyn"))
(41296 "Tuberculosis" ("dsyn"))
(9319 "Colitis" ("dsyn"))
(11615 "Dermatitis, Atopic" ("dsyn"))
(20517 "Hypersensitivity" ("patf"))
(32285 "Pneumonia" ("dsyn"))
(87086 "Thrombus" ("dsyn"))
(2395 "Alzheimer's Disease" ("dsyn"))
(30567 "Parkinson Disease" ("dsyn"))
(917798 "Cerebral Ischemia" ("dsyn"))
(27540 "Necrosis" ("patf"))
(30660 "Pathologic Processes" ("patf"))
(524851 "Neurodegenerative Disorders" ("dsyn"))
(9566 "Complication" ("patf"))
(27686 "Pathologic Neovascularization" ("patf"))
(21368 "Inflammation" ("patf"))
(20538 "Hypertensive disease" ("dsyn"))
(24117 "Chronic Obstructive Airway Disease" ("dsyn"))
(27765 "nervous system disorder" ("dsyn"))
(39082 "Syndrome" ("dsyn"))
(29408 "Degenerative polyarthritis" ("dsyn"))
(16059 "Fibrosis" ("patf"))
(333951 "Growth arrest" ("patf"))
(28778 "Obstruction" ("patf"))
(11847 "Diabetes" ("dsyn"))
(24899 "mastocytosis" ("dsyn"))
(27051 "Myocardial Infarction" ("dsyn"))
(879626 "Adverse effects" ("patf"))
(20507 "Hyperplasia" ("patf"))
(2871 "Anemia" ("dsyn"))
(277785 "Functional disorder" ("patf"))
(699748 "Pathogenesis" ("patf"))
(1510411 "metaplastic cell transformation" ("patf"))
(1140999 "Contraction" ("patf"))
(12634 "Disease" ("dsyn")))
|#
;; Now, remove all the diseases that imatinib variants are known to treat.
;;
;; 52 left, including asthma
(set-subtraction
'((7193 "Cardiomyopathy, Dilated" ("dsyn"))
(19158 "Hepatitis" ("dsyn"))
(30305 "Pancreatitis" ("dsyn"))
(3873 "Rheumatoid Arthritis" ("dsyn"))
(4153 "Atherosclerosis" ("dsyn"))
(24141 "Lupus Erythematosus, Systemic" ("dsyn"))
(270814 "Spastic syndrome" ("dsyn"))
(1290884 "Inflammatory disorder" ("dsyn"))
(1857 "AIDS related complex" ("dsyn"))
(17639 "Gliosis" ("patf"))
(7222 "Cardiovascular Diseases" ("dsyn"))
(21308 "Infarction" ("patf"))
(14038 "Encephalitis" ("dsyn"))
(19151 "Hepatic Encephalopathy" ("dsyn"))
(22116 "Ischemia" ("dsyn"))
(22658 "Kidney Diseases" ("dsyn"))
(333467 "Cytopathic effect" ("patf"))
(26848 "Myopathy" ("dsyn"))
(333641 "Atrophic" ("patf"))
(28754 "Obesity" ("dsyn"))
(162871 "Aortic Aneurysm, Abdominal" ("dsyn"))
(339510 "Vitelliform dystrophy" ("dsyn"))
(1395184 "depolarization" ("patf"))
(856169 "Endothelial dysfunction" ("dsyn"))
(1521846 "Permissiveness, Biological Function" ("patf"))
(18801 "Heart failure" ("dsyn"))
(2878 "Anemia, Hemolytic" ("dsyn"))
(18188 "Granuloma" ("patf"))
(36679 "Diastasis" ("patf"))
(17658 "Glomerulonephritis" ("dsyn"))
(4368 "Autoimmunity" ("patf"))
(24312 "Lymphopenia" ("dsyn"))
(21655 "Insulin Resistance" ("patf"))
(29456 "Osteoporosis" ("dsyn"))
(1155266 "Inflammatory Response" ("patf"))
(15376 "Extravasation" ("patf"))
(14175 "Endometriosis, site unspecified" ("dsyn"))
(27055 "Myocardial Reperfusion Injury" ("patf"))
(878544 "Cardiomyopathies" ("dsyn"))
(1383860 "Cardiac Hypertrophy" ("patf"))
(1519697 "Tumorigenicity" ("patf"))
(18133 "Graft-vs-Host Disease" ("dsyn"))
(36974 "Shock" ("patf"))
(21390 "Inflammatory Bowel Diseases" ("dsyn"))
(231341 "Premature aging syndrome" ("dsyn"))
(20564 "Hypertrophy" ("patf"))
(32914 "Pre-Eclampsia" ("dsyn"))
(332448 "Infiltration" ("patf"))
(20456 "Hyperglycemia" ("dsyn"))
(11164 "Degenerative abnormality" ("patf"))
(13604 "Edema" ("patf"))
(4096 "Asthma" ("dsyn"))
(4364 "Autoimmune Diseases" ("dsyn"))
(29396 "Ossification, Heterotopic" ("patf"))
(242656 "Disease Progression" ("patf"))
(21051 "Immunologic Deficiency Syndromes" ("dsyn"))
(242184 "Hypoxia" ("patf"))
(21311 "Infection" ("dsyn"))
(38454 "Cerebrovascular accident" ("dsyn"))
(41296 "Tuberculosis" ("dsyn"))
(9319 "Colitis" ("dsyn"))
(11615 "Dermatitis, Atopic" ("dsyn"))
(20517 "Hypersensitivity" ("patf"))
(32285 "Pneumonia" ("dsyn"))
(87086 "Thrombus" ("dsyn"))
(2395 "Alzheimer's Disease" ("dsyn"))
(30567 "Parkinson Disease" ("dsyn"))
(917798 "Cerebral Ischemia" ("dsyn"))
(27540 "Necrosis" ("patf"))
(30660 "Pathologic Processes" ("patf"))
(524851 "Neurodegenerative Disorders" ("dsyn"))
(9566 "Complication" ("patf"))
(27686 "Pathologic Neovascularization" ("patf"))
(21368 "Inflammation" ("patf"))
(20538 "Hypertensive disease" ("dsyn"))
(24117 "Chronic Obstructive Airway Disease" ("dsyn"))
(27765 "nervous system disorder" ("dsyn"))
(39082 "Syndrome" ("dsyn"))
(29408 "Degenerative polyarthritis" ("dsyn"))
(16059 "Fibrosis" ("patf"))
(333951 "Growth arrest" ("patf"))
(28778 "Obstruction" ("patf"))
(11847 "Diabetes" ("dsyn"))
(24899 "mastocytosis" ("dsyn"))
(27051 "Myocardial Infarction" ("dsyn"))
(879626 "Adverse effects" ("patf"))
(20507 "Hyperplasia" ("patf"))
(2871 "Anemia" ("dsyn"))
(277785 "Functional disorder" ("patf"))
(699748 "Pathogenesis" ("patf"))
(1510411 "metaplastic cell transformation" ("patf"))
(1140999 "Contraction" ("patf"))
(12634 "Disease" ("dsyn")))
'((2871 "Anemia" ("dsyn"))
(2874 "Aplastic Anemia" ("dsyn"))
(2895 "Sickle Cell Anemia" ("dsyn"))
(3047 "Animal Diseases" ("dsyn"))
(15376 "Extravasation" ("patf"))
(5684 "Malignant neoplasm of urinary bladder" ("neop"))
(4153 "Atherosclerosis" ("dsyn"))
(5684 "Malignant neoplasm of urinary bladder" ("neop"))
(5940 "Bone Diseases" ("dsyn"))
(18944 "Hematoma" ("patf"))
(7193 "Cardiomyopathy, Dilated" ("dsyn"))
(7682 "CNS disorder" ("dsyn"))
(20507 "Hyperplasia" ("patf"))
(6118 "Brain Neoplasms" ("neop"))
(21368 "Inflammation" ("patf"))
(8728 "Churg-Strauss Syndrome" ("dsyn"))
(6142 "Malignant neoplasm of breast" ("neop"))
(10403 "Cryoglobulinemia" ("dsyn"))
(11644 "Scleroderma" ("dsyn"))
(6142 "Malignant neoplasm of breast" ("neop"))
(29435 "Osteolysis" ("patf"))
(11854 "Diabetes Mellitus, Insulin-Dependent" ("dsyn"))
(36429 "Sclerosis" ("patf"))
(11881 "Diabetic Nephropathy" ("dsyn"))
(36974 "Shock" ("patf"))
(7095 "Carcinoid Tumor" ("neop"))
(14175 "Endometriosis, site unspecified" ("dsyn"))
(86565 "Liver Dysfunction" ("patf"))
(7095 "Carcinoid Tumor" ("neop"))
(15230 "Exanthema" ("dsyn"))
(151654 "Myocardial fibrosis" ("patf"))
(15230 "Exanthema" ("dsyn"))
(7097 "Carcinoma" ("neop"))
(15624 "Fanconi Syndrome" ("dsyn"))
(151746 "Abnormal renal function" ("patf"))
(17152 "Gastritis" ("dsyn"))
(7103 "Malignant neoplasm of endometrium" ("neop"))
(17658 "Glomerulonephritis" ("dsyn"))
(151746 "Abnormal renal function" ("patf"))
(7114 "Malignant neoplasm of skin" ("neop"))
(18801 "Heart failure" ("dsyn"))
(231178 "Chronic failure" ("patf"))
(19196 "Hepatitis C" ("dsyn"))
(20456 "Hyperglycemia" ("dsyn"))
(20538 "Hypertensive disease" ("dsyn"))
(21141 "Inappropriate ADH Syndrome" ("dsyn"))
(21390 "Inflammatory Bowel Diseases" ("dsyn"))
(22658 "Kidney Diseases" ("dsyn"))
(23882 "Little's Disease" ("dsyn"))
(23890 "Liver Cirrhosis" ("dsyn"))
(9404 "Colorectal Neoplasms" ("neop"))
(24115 "Lung diseases" ("dsyn"))
(333606 "Dystrophy" ("patf"))
(24440 "Macular Edema, Cystoid" ("dsyn"))
(443146 "Autoimmune" ("patf"))
(26769 "Multiple Sclerosis" ("dsyn"))
(27697 "Nephritis" ("dsyn"))
(549593 "kidney functional" ("patf"))
(27947 "Neutropenia" ("dsyn"))
(16048 "Fibromatosis" ("neop"))
(33838 "Kimura Disease" ("dsyn"))
(33860 "Psoriasis" ("dsyn"))
(34063 "Pulmonary Edema" ("dsyn"))
(744813 "Hepatic embolisation" ("patf"))
(35309 "Retinal Diseases" ("dsyn"))
(879626 "Adverse effects" ("patf"))
(35920 "Rubella" ("dsyn"))
(879626 "Adverse effects" ("patf"))
(18923 "Hemangiosarcoma" ("neop"))
(36992 "Short Bowel Syndrome" ("dsyn"))
(1265815 "Multiple ulcers" ("patf"))
(38013 "Ankylosing spondylitis" ("dsyn"))
(19204 "Primary carcinoma of the liver cells" ("neop"))
(1608322 "Leak NOS" ("patf"))
(39103 "Synovitis" ("dsyn"))
(19204 "Primary carcinoma of the liver cells" ("neop"))
(41296 "Tuberculosis" ("dsyn"))
(85786 "Hamman-Rich syndrome" ("dsyn"))
(23434 "Chronic Lymphocytic Leukemia" ("neop"))
(86438 "Hypogammaglobulinemia" ("dsyn"))
(151859 "Polyserositis" ("dsyn"))
(23448 "Lymphoblastic Leukemia" ("neop"))
(158168 "Villonodular synovitis" ("dsyn"))
(162557 "Liver Failure, Acute" ("dsyn"))
(162557 "Liver Failure, Acute" ("dsyn"))
(206062 "Lung Diseases, Interstitial" ("dsyn"))
(206143 "Loeffler's Endocarditis" ("dsyn"))
(236178 "Intraabdominal hemorrhage" ("dsyn"))
(238644 "anemia; profound" ("dsyn"))
(238790 "destruction; bone" ("dsyn"))
(239946 "Fibrosis, Liver" ("dsyn"))
(263664 "Generalized morphea" ("dsyn"))
(264939 "Systemic vasculitis" ("dsyn"))
(23475 "Leukemia, Myeloid, Philadelphia-Negative" ("neop"))
(272203 "Indolent Systemic Mastocytosis" ("dsyn"))
(276653 "Invasive pulmonary aspergillosis" ("dsyn"))
(277554 "Primary disease" ("dsyn"))
(277556 "Recurrent disease" ("dsyn"))
(334102 "Lymphangiomatosis" ("dsyn"))
(23484 "Leukemia, Plasmacytic" ("neop"))
(340548 "Pulmonary capillary hemangiomatosis" ("dsyn"))
(23601 "Leydig Cell Tumor" ("neop"))
(341213 "External gastric fistula" ("dsyn"))
(24301 "Lymphoma, Follicular" ("neop"))
(341439 "Chronic liver disease NOS" ("dsyn"))
(24623 "Malignant neoplasm of stomach" ("neop"))
(442867 "Malignant disease" ("dsyn"))
(549567 "Pigmentation Disorders" ("dsyn"))
(678236 "Rare Diseases" ("dsyn"))
(743496 "END ORGAN DAMAGE" ("dsyn"))
(25286 "meningioma" ("neop"))
(25500 "Mesothelioma" ("neop"))
(854467 "Myelosuppression" ("dsyn"))
(26764 "Multiple Myeloma" ("neop"))
(855227 "Purging" ("dsyn"))
(26986 "Dysmyelopoietic Syndromes" ("neop"))
(856169 "Endothelial dysfunction" ("dsyn"))
(878544 "Cardiomyopathies" ("dsyn"))
(920627 "Orphan Diseases" ("dsyn"))
(948008 "Ischemic stroke" ("dsyn"))
(948908 "Nephrotoxic serum nephritis" ("dsyn"))
(1273070 "Left ventricular diastolic dysfunction" ("dsyn"))
(1290884 "Inflammatory disorder" ("dsyn"))
(27832 "Neurofibromatosis 2" ("neop"))
(1299884 "Eosinophilic myositis" ("dsyn"))
(1306759 "Eosinophilic disorder" ("dsyn"))
(1306759 "Eosinophilic disorder" ("dsyn"))
(1332309 "Anti-Basement Membrane Glomerulonephritis" ("dsyn"))
(1533022 "Histiocytic proliferation" ("dsyn"))
(1565489 "Renal Insufficiency" ("dsyn"))
(36221 "Mast-Cell Sarcoma" ("neop"))
(41341 "Tuberous Sclerosis" ("neop"))
(79731 "B-Cell Lymphomas" ("neop"))
(79772 "T-Cell Lymphoma" ("neop"))
(153633 "Malignant neoplasm of brain" ("neop"))
(153633 "Malignant neoplasm of brain" ("neop"))
(162678 "Neurofibromatoses" ("neop"))
(205853 "Neoplasms, Epithelial" ("neop"))
(206647 "Dermatofibrosarcoma" ("neop"))
(206647 "Dermatofibrosarcoma" ("neop"))
(206657 "Sarcoma, Alveolar Soft Part" ("neop"))
(206754 "Neuroendocrine Tumors" ("neop"))
(206754 "Neuroendocrine Tumors" ("neop"))
(220650 "Metastatic malignant neoplasm to brain" ("neop"))
(238463 "Papillary thyroid carcinoma" ("neop"))
(242379 "Malignant neoplasm of lung" ("neop"))
(278517 "Non-small cell lung cancer recurrent" ("neop"))
(278695 "recurrent neuroblastoma" ("neop"))
(278704 "Malignant Childhood Neoplasm" ("neop"))
(278727 "Small cell lung cancer recurrent" ("neop"))
(279068 "childhood solid tumor" ("neop"))
(279087 "recurrent Kaposi's sarcoma" ("neop"))
(281361 "Adenocarcinoma pancreas" ("neop"))
(302592 "Cervix carcinoma" ("neop"))
(302592 "Cervix carcinoma" ("neop"))
(334410 "Leydig cell tumor, malignant" ("neop"))
(334695 "Endometrial Stromal Tumors" ("neop"))
(349636 "Pre B-cell acute lymphoblastic leukemia" ("neop"))
(553580 "Ewings sarcoma" ("neop"))
(677865 "Brain stem glioma" ("neop"))
(677865 "Brain stem glioma" ("neop"))
(685938 "Malignant neoplasm of gastrointestinal tract" ("neop"))
(686619 "Secondary malignant neoplasm of lymph node" ("neop"))
(854850 "Mycosis fungoides refractory" ("neop"))
(855054 "Fibrosarcoma metastatic" ("neop"))
(855211 "Seminoma of testis" ("neop"))
(948380 "Colorectal cancer metastatic" ("neop"))
(948380 "Colorectal cancer metastatic" ("neop"))
(1266042 "Chromophobe Renal Cell Carcinoma" ("neop"))
(1266101 "Thymic epithelial neoplasm" ("neop"))
(1266119 "Solitary fibrous tumor" ("neop"))
(1266120 "Solitary fibrous tumor, malignant" ("neop"))
(1300127 "Perivascular epithelial cell tumor" ("neop"))
(1306837 "Papillary Renal Cell Carcinoma" ("neop"))
(1318543 "Tenosynovial giant cell tumor" ("neop"))
(1319185 "Chiasmal glioma" ("neop"))
(1326912 "Tumorigenesis" ("neop"))
(1328504 "Hormone-refractory prostate cancer" ("neop"))
(1328504 "Hormone-refractory prostate cancer" ("neop"))
(1332884 "Central Nervous System Leukemia" ("neop"))
(1333614 "Fibrosarcomatous Dermatofibrosarcoma Protuberans" ("neop"))
(1334432 "Low Risk Gastrointestinal Stromal Tumor" ("neop"))
(1335996 "Small Intestinal Gastrointestinal Stromal Tumor" ("neop"))
(1378050 "Oncocytic Neoplasm" ("neop"))
(1411997 "Acute biphenotypic leukemia" ("neop"))
(1512409 "Hepatocarcinogenesis" ("neop"))
(1524028 "Intraepithelial Neoplasia of the Mouse Mammary Gland" ("neop"))
(3864 "Arthritis" ("dsyn"))
(3873 "Rheumatoid Arthritis" ("dsyn"))
(1418 "Adenocarcinoma" ("neop"))
(4364 "Autoimmune Diseases" ("dsyn"))
(6272 "Bronchiolitis Obliterans" ("dsyn"))
(9782 "Connective Tissue Diseases" ("dsyn"))
(10828 "Cytopenia" ("patf"))
(11603 "Dermatitis" ("dsyn"))
(11633 "Dermatomyositis" ("dsyn"))
(242656 "Disease Progression" ("patf"))
(14457 "Eosinophilia" ("dsyn"))
(14457 "Eosinophilia" ("dsyn"))
(242656 "Disease Progression" ("patf"))
(18133 "Graft-vs-Host Disease" ("dsyn"))
(7102 "Malignant tumor of colon" ("neop"))
(19618 "Histiocytosis" ("dsyn"))
(243083 "associated disease" ("patf"))
(19621 "Histiocytosis, Langerhans-Cell" ("dsyn"))
(7115 "Malignant neoplasm of thyroid" ("neop"))
(19624 "Histiocytosis, Non-Langerhans-Cell" ("dsyn"))
(277785 "Functional disorder" ("patf"))
(19625 "Sinus histiocytosis" ("dsyn"))
(20542 "Hypertension, Pulmonary" ("dsyn"))
(21311 "Infection" ("dsyn"))
(22661 "Kidney Failure, Chronic" ("dsyn"))
(399498 "Oral lichenoid reaction" ("patf"))
(24901 "Mastocytosis, Diffuse Cutaneous" ("dsyn"))
(26272 "Mixed Connective Tissue Disease" ("dsyn"))
(699748 "Pathogenesis" ("patf"))
(28754 "Obesity" ("dsyn"))
(7137 "Squamous cell carcinoma" ("neop"))
(31154 "Peritonitis" ("dsyn"))
(867389 "Chronic graft-versus-host disease" ("patf"))
(31763 "Photosensitization" ("dsyn"))
(7140 "Carcinosarcoma" ("neop"))
(32285 "Pneumonia" ("dsyn"))
(867389 "Chronic graft-versus-host disease" ("patf"))
(33687 "Proteinuria" ("dsyn"))
(7847 "Malignant neoplasm of cervix uteri" ("neop"))
(34069 "Pulmonary Fibrosis" ("dsyn"))
(34155 "Purpura, Thrombotic Thrombocytopenic" ("dsyn"))
(8479 "Chondrosarcoma" ("neop"))
(35435 "Rheumatism" ("dsyn"))
(8487 "Chordoma" ("neop"))
(36421 "Systemic Scleroderma" ("dsyn"))
(8487 "Chordoma" ("neop"))
(10606 "Adenoid Cystic Carcinoma" ("neop"))
(10606 "Adenoid Cystic Carcinoma" ("neop"))
(39082 "Syndrome" ("dsyn"))
(39106 "Pigmented villonodular synovitis" ("dsyn"))
(40034 "Thrombocytopenia" ("dsyn"))
(42384 "Vasculitis" ("dsyn"))
(18206 "granulosa cell tumor" ("neop"))
(152171 "Primary pulmonary hypertension" ("dsyn"))
(162835 "Hypopigmentation" ("dsyn"))
(206061 "Pneumonitis, Interstitial" ("dsyn"))
(23435 "Leukemia, B-Cell, Acute" ("neop"))
(267437 "Allergic diarrhea" ("dsyn"))
(282548 "Leukostasis" ("dsyn"))
(339143 "Thyroid associated opthalmopathies" ("dsyn"))
(339510 "Vitelliform dystrophy" ("dsyn"))
(341697 "Renal impairment" ("dsyn"))
(745091 "Hypereosinophilia" ("dsyn"))
(745091 "Hypereosinophilia" ("dsyn"))
(23470 "Myeloid Leukemia" ("neop"))
(745283 "INFECTIOUS PROCESS" ("dsyn"))
(23470 "Myeloid Leukemia" ("neop"))
(748159 "PULMONARY INVOLVEMENT" ("dsyn"))
(23472 "Leukemia, Myeloid, Aggressive-Phase" ("neop"))
(836924 "thrombocytosis" ("dsyn"))
(23472 "Leukemia, Myeloid, Aggressive-Phase" ("neop"))
(949690 "Spondylarthritis" ("dsyn"))
(1112486 "Aggressive Systemic Mastocytosis" ("dsyn"))
(1136033 "Cutaneous Mastocytosis" ("dsyn"))
(1142420 "Hepatitis B reactivation" ("dsyn"))
(1261469 "End stage renal failure" ("dsyn"))
(23479 "Leukemia, Myelomonocytic, Acute" ("neop"))
(1279945 "Acute interstitial pneumonia" ("dsyn"))
(1368107 "Aplastic bone marrow" ("dsyn"))
(1619734 "Pulmonary arterial hypertension" ("dsyn"))
(23487 "Acute Promyelocytic Leukemia" ("neop"))
(23487 "Acute Promyelocytic Leukemia" ("neop"))
(23494 "Leukemia, T-Cell, Chronic" ("neop"))
(23827 "liposarcoma" ("neop"))
(26987 "Myelofibrosis" ("neop"))
(29925 "Ovarian Carcinoma" ("neop"))
(29925 "Ovarian Carcinoma" ("neop"))
(32463 "Polycythemia Vera" ("neop"))
(32463 "Polycythemia Vera" ("neop"))
(35412 "Rhabdomyosarcoma" ("neop"))
(36220 "Kaposi Sarcoma" ("neop"))
(36631 "Seminoma" ("neop"))
(39101 "synovial sarcoma" ("neop"))
(40100 "Thymoma" ("neop"))
(79218 "Fibromatosis, Aggressive" ("neop"))
(79218 "Fibromatosis, Aggressive" ("neop"))
(151779 "[X]Malignant melanoma of skin, unspecified" ("neop"))
(205851 "Germ cell tumor" ("neop"))
(205969 "Thymic Carcinoma" ("neop"))
(205969 "Thymic Carcinoma" ("neop"))
(206630 "Endometrial Stromal Sarcoma" ("neop"))
(206693 "Medullary carcinoma" ("neop"))
(206698 "Cholangiocarcinoma" ("neop"))
(206728 "Plexiform Neurofibroma" ("neop"))
(206728 "Plexiform Neurofibroma" ("neop"))
(276535 "AIDS with Kaposi's sarcoma" ("neop"))
(278488 "Breast cancer metastatic" ("neop"))
(278488 "Breast cancer metastatic" ("neop"))
(278678 "Metastatic renal cell carcinoma" ("neop"))
(278694 "Disseminated neuroblastoma" ("neop"))
(278787 "relapsing chronic myelogenous leukemia" ("neop"))
(278787 "relapsing chronic myelogenous leukemia" ("neop"))
(278883 "Metastatic melanoma" ("neop"))
(278883 "Metastatic melanoma" ("neop"))
(279549
"Philadelphia chromosome negative chronic myelogenous leukemia"
("neop"))
(280449 "secondary acute myeloid leukemia" ("neop"))
(334664 "Mast Cell Neoplasm" ("neo
gitextract_bl5lyvi7/ ├── .github/ │ └── workflows/ │ └── request-10GB-CI.yml ├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── attic/ │ ├── code/ │ │ ├── README.md │ │ ├── concept.rkt │ │ ├── csv-semmed-ordered-unique-enum.rkt │ │ ├── csv-semmed-simplify.rkt │ │ ├── csv-semmed-validate-cuis.rkt │ │ ├── csv.rkt │ │ ├── db.rkt │ │ ├── edge.rkt │ │ ├── gui-simple.rkt │ │ ├── helpers.rkt │ │ ├── imatinib-query.rkt │ │ ├── microKanren/ │ │ │ ├── README.md │ │ │ ├── microKanren-test-programs.scm │ │ │ ├── microKanren-test.scm │ │ │ ├── microKanren.scm │ │ │ └── miniKanren-wrappers.scm │ │ ├── mk/ │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── arithmetic.scm │ │ │ ├── evalo.scm │ │ │ ├── mk.scm │ │ │ ├── test-all.scm │ │ │ ├── test-arithmetic.scm │ │ │ ├── test-check.scm │ │ │ ├── test-interp.scm │ │ │ ├── test-quines.scm │ │ │ ├── test-type-infer.scm │ │ │ └── type-infer.scm │ │ ├── mk-db.rkt │ │ ├── mk.rkt │ │ ├── process-db.rkt │ │ ├── programmatically-defined-relations.rkt │ │ ├── read.rkt │ │ ├── sample_semmed.csv │ │ ├── semmed/ │ │ │ ├── PREDICATE.scm │ │ │ ├── PREDICATE_OCCURRENCE_ORDERED.scm │ │ │ ├── README.md │ │ │ ├── SEMTYPE.scm │ │ │ ├── concept.scm │ │ │ └── cui-by-semtype.scm │ │ ├── semmed-index-predicate.rkt │ │ ├── study-dfo-raynaud.rkt │ │ ├── study-imatinib.rkt │ │ ├── study-sickle-malaria.rkt │ │ └── tacrine.rkt │ ├── medikanren/ │ │ ├── CACNA1A-full.rkt │ │ ├── DNM1L-full.rkt │ │ ├── NF1-full.rkt │ │ ├── brca1-full.rkt │ │ ├── brca1.rkt │ │ ├── create-all-hashtables.rkt │ │ ├── create-doid-cui-to-cid-hashtable.rkt │ │ ├── create-ensembl-cui-to-cid-hashtable.rkt │ │ ├── create-hashtable-common.rkt │ │ ├── create-hgnc-cui-to-cid-hashtable.rkt │ │ ├── create-hpo-cui-to-cid-hashtable.rkt │ │ ├── create-mondo-cui-to-cid-hashtable.rkt │ │ ├── create-omim-cui-to-cid-hashtable.rkt │ │ ├── create-umls-cui-to-cid-hashtable.rkt │ │ ├── create-uniprotkb-cui-to-cid-hashtable.rkt │ │ ├── dhx30-full.rkt │ │ ├── dhx30.rkt │ │ ├── examine-concepts.rkt │ │ ├── example-dhx30-monarch-lite.rkt │ │ ├── example-dhx30-scigraph.rkt │ │ ├── find-edges-by-pubmed-id.rkt │ │ ├── gui-simple-v3.rkt │ │ ├── sialic-full-will.rkt │ │ ├── sialic-full.rkt │ │ ├── test-POST.rkt │ │ ├── w1m2-direct-POST.rkt │ │ ├── web-server.rkt │ │ ├── workflow-web-server.rkt │ │ └── workflow1.rkt │ ├── pharos/ │ │ ├── .gitignore │ │ ├── README.md │ │ ├── csv.rkt │ │ ├── db.rkt │ │ ├── interact-sqlite3 │ │ ├── mk-db.rkt │ │ ├── mk-parse.rkt │ │ ├── mk.rkt │ │ ├── mysql2sqlite/ │ │ │ ├── LICENSE │ │ │ ├── mysql2sqlite │ │ │ ├── mysql2sqlite.README │ │ │ └── unit_tests.sh │ │ ├── pharos-mysql-to-sqlite3-to-db │ │ ├── read.rkt │ │ ├── repr.rkt │ │ ├── sql-schema-parse.rkt │ │ ├── sql-tokenize.rkt │ │ └── sqlite-to-db.rkt │ └── yaml/ │ ├── biolink-model.scm │ ├── example1.scm │ ├── example1.yaml │ ├── yaml.scm │ └── yaml2sexp.py ├── contrib/ │ ├── README.md │ ├── medikanren/ │ │ ├── 2020_NCATS_relay/ │ │ │ ├── INTEGRATED-QUERY/ │ │ │ │ └── textmining->rtx2.rkt │ │ │ ├── kg-maps/ │ │ │ │ ├── rtx2_2020_09_16/ │ │ │ │ │ ├── rtx2_2020_09_16-map.html │ │ │ │ │ ├── rtx2_2020_09_16-stats.txt │ │ │ │ │ ├── rtx2_2020_09_16-subject_predicate_object_count.tsv │ │ │ │ │ ├── rtx2_2020_09_16.dot │ │ │ │ │ ├── rtx2_2020_09_16.txt │ │ │ │ │ ├── shorest-path-graph-visual-hover.html │ │ │ │ │ ├── shortest_path.rkt │ │ │ │ │ └── shortest_path_with_visual.rkt │ │ │ │ ├── sri-reference-kg-0.2.0/ │ │ │ │ │ ├── sri-reference-kg-0.2.0-map.html │ │ │ │ │ ├── sri-reference-kg-0.2.0-subject_predicate_object_count.tsv │ │ │ │ │ └── sri-reference-kg-0.2.0.dot │ │ │ │ ├── sri_semmeddb/ │ │ │ │ │ ├── sri_semmeddb-map.html │ │ │ │ │ ├── sri_semmeddb-stats.txt │ │ │ │ │ ├── sri_semmeddb-subject_predicate_object_count.tsv │ │ │ │ │ └── sri_semmeddb.dot │ │ │ │ └── textminingprovider/ │ │ │ │ ├── co-occur/ │ │ │ │ │ ├── co-occur-map.html │ │ │ │ │ ├── co-occur-stats.txt │ │ │ │ │ ├── co-occur-subject_predicate_object_count.tsv │ │ │ │ │ └── co-occur.dot │ │ │ │ ├── pr-owl/ │ │ │ │ │ ├── pr-owl-map.html │ │ │ │ │ ├── pr-owl-stats.txt │ │ │ │ │ ├── pr-owl-subject_predicate_object_count.tsv │ │ │ │ │ └── pr-owl.dot │ │ │ │ └── textminingprovider/ │ │ │ │ ├── textminingprovider-map.html │ │ │ │ ├── textminingprovider-stats.txt │ │ │ │ ├── textminingprovider-subject_predicate_object_count.tsv │ │ │ │ └── textminingprovider.dot │ │ │ ├── kg_statistics_table_generator.R │ │ │ ├── rtx2-KG-query.rkt │ │ │ └── textmining-KG-query.rkt │ │ ├── README.md │ │ ├── X-Y-C.rkt │ │ ├── auto_query_symptom.rkt │ │ ├── example-dhx30-rtx.rkt │ │ ├── example-dhx30-semmed.rkt │ │ ├── example-tacrine-semmed.rkt │ │ ├── genes-perturbed.rkt │ │ ├── get-all-hgncs-from-raw-data.rkt │ │ ├── make-kg-edge-covid19.rkt │ │ ├── make-kg-edge-general.rkt │ │ ├── make-kg-edge-sri-reference-kg.rkt │ │ ├── make-kg-edge.rkt │ │ ├── make-kg-node-general.rkt │ │ ├── make-kg-node-sri-reference-kg.rkt │ │ ├── make-kg-node.rkt │ │ ├── marissa/ │ │ │ ├── migraine-case.rkt │ │ │ └── patient-case-workflow.rkt │ │ ├── marvin.rkt │ │ ├── pieces-parts/ │ │ │ ├── CHAMP1_RNA_seq_original.rkt │ │ │ ├── README_VISJS.md │ │ │ ├── Thi-useful-functions.rkt │ │ │ ├── causal-discovery.rkt │ │ │ ├── chemical->drug-filter.rkt │ │ │ ├── drug-ranker.rkt │ │ │ ├── etl_for_new_KGs/ │ │ │ │ └── xmlparse.rkt │ │ │ ├── example-2-hop-rhobtb2-drug-safe.rkt │ │ │ ├── example-2-hop-rhobtb2.rkt │ │ │ ├── example-2-hop-tmprss2.rkt │ │ │ ├── example-ontology.rkt │ │ │ ├── example-synonymize.rkt │ │ │ ├── gene-budging.rkt │ │ │ ├── lib.rkt │ │ │ ├── make-map-fast.rkt │ │ │ ├── make-map.rkt │ │ │ ├── make-provenance-map-fast.rkt │ │ │ ├── new-query-lang/ │ │ │ │ └── select.rkt │ │ │ ├── non_drug_filter.rkt │ │ │ ├── postquery.rkt │ │ │ ├── pub-clustering.rkt │ │ │ ├── rank-regulators-exe.rkt │ │ │ ├── rank-regulators-gene-lists.rkt │ │ │ ├── rank-regulators.rkt │ │ │ ├── rank-side-effects.rkt │ │ │ ├── synonymization_algorithm.rkt │ │ │ ├── test-propagator.rkt │ │ │ ├── trace-pathways-by-tissue-type.rkt │ │ │ ├── trace-pathways-mjp.rkt │ │ │ ├── trace-pathways.rkt │ │ │ └── tutorial.rkt │ │ ├── preds.rkt │ │ ├── query-graph.rkt │ │ ├── simple-query.rkt │ │ ├── test-web-server.rkt │ │ └── use-cases/ │ │ ├── CHAMP1_RNA_seq.rkt │ │ └── PMI-20-10-Il1R1-case-reviews.rkt │ └── medikanren2/ │ ├── README.md │ ├── Thi/ │ │ ├── CHAMP1-drug-repurpose-June-15-2021.rkt │ │ ├── Hakon-DEG-list.rkt │ │ ├── Hakon-DEG-syns.rkt │ │ ├── IL1R1-med2-translate-rtx2-only-June-15-2021.rkt │ │ ├── IL1R1-med2-translate.rkt │ │ ├── PMI-21-34-NEXMIF-2hop.rkt │ │ ├── SLC16A11-explore.rkt │ │ ├── build-kgx-synonym.rkt │ │ ├── build-rtx-kg2.rkt │ │ ├── example-one-hop-IL1R1-drugs.rkt │ │ ├── example-one-hop-ORPHANET-ICD-9-10.rkt │ │ ├── example-one-hop-UniProt-cause-OMIM.rkt │ │ ├── example-two-hop-CHAMP1-drugs.rkt │ │ ├── example-two-hop-PMI-21-34-NEXMIF.rkt │ │ ├── query-low-level.rkt │ │ └── synonym-low-level.rkt │ ├── draw.rkt │ ├── gregr/ │ │ ├── benchmark-nausea.rkt │ │ ├── hao-demo.rkt │ │ ├── notes-on-reasoning.md │ │ ├── old/ │ │ │ ├── graph-builder-explorer.rkt │ │ │ ├── query-simple.rkt │ │ │ └── query-tree.rkt │ │ ├── owlrl.rkt │ │ ├── query-low-level.rkt │ │ └── test-dataflow-nausea.rkt │ ├── lw-reasoning-examples.rkt │ ├── neo/ │ │ ├── Andy/ │ │ │ └── simple-query.rkt │ │ ├── Kaiwen/ │ │ │ ├── auto-grow-example.rkt │ │ │ └── mayo-gene-list.rkt │ │ ├── Mayu/ │ │ │ ├── achromatopsia-query.rkt │ │ │ ├── alz-query-revisited-multi-db-query.rkt │ │ │ ├── genes-query.rkt │ │ │ ├── nfix-multi-db-query.rkt │ │ │ ├── simple-query.rkt │ │ │ ├── wills-new-multi-db-queries.rkt │ │ │ └── wills-new-rtx-kg2-queries.rkt │ │ ├── Will/ │ │ │ ├── adverse-effects.rkt │ │ │ ├── chemical-affects-gene.rkt │ │ │ └── simple-query.rkt │ │ └── utils.rkt │ ├── profiling.rkt │ └── trapi-tests.rkt ├── medikanren/ │ ├── .compile.sh │ ├── .gitignore │ ├── .install_pkgs.sh │ ├── .run_ci.sh │ ├── README.md │ ├── apps/ │ │ ├── gui-simple-v2.rkt │ │ └── translator-web-server.rkt │ ├── biolink-types-examples.scm │ ├── common.rkt │ ├── config.defaults.scm │ ├── configref.rkt │ ├── csv.rkt │ ├── db.rkt │ ├── hgnc-ids.txt │ ├── mk-db.rkt │ ├── mk.rkt │ ├── open-api/ │ │ ├── ISB-KG-api.rkt │ │ ├── TranslatorReasonersAPI.json │ │ ├── TranslatorReasonersAPI.yaml │ │ ├── api-query.rkt │ │ ├── html/ │ │ │ ├── .swagger-codegen/ │ │ │ │ └── VERSION │ │ │ ├── .swagger-codegen-ignore │ │ │ └── index.html │ │ ├── html2/ │ │ │ ├── .swagger-codegen/ │ │ │ │ └── VERSION │ │ │ ├── .swagger-codegen-ignore │ │ │ └── index.html │ │ ├── yaml-to-json.sh │ │ └── yaml2json.py │ ├── pieces-parts/ │ │ ├── NOTES-DB.md │ │ ├── NOTES.md │ │ ├── new-query-lang/ │ │ │ ├── may2.txt │ │ │ └── michael-query-language-design.txt │ │ ├── ontology.rkt │ │ ├── orange_graph.dot │ │ ├── propagator.rkt │ │ ├── query.rkt │ │ ├── synonymize.rkt │ │ └── visjs.html │ ├── repr.rkt │ ├── string-search.rkt │ ├── test/ │ │ ├── external-http/ │ │ │ └── 2020_NCATS_relay/ │ │ │ ├── INTEGRATED-QUERY/ │ │ │ │ └── integrated-query.rkt │ │ │ ├── genetics-provider-query.rkt │ │ │ ├── molepro-api-query.rkt │ │ │ └── multiomics-api-query.rkt │ │ └── full-dbs/ │ │ ├── example-common.rkt │ │ └── test-common.rkt │ ├── test-behave.sh │ ├── tmp/ │ │ └── ignore │ ├── todo.txt │ ├── tsv.rkt │ ├── use-cases/ │ │ └── README.md │ └── util/ │ └── data-import/ │ ├── README.md │ ├── build-pubmed-edges.rkt │ ├── build-string-index.rkt │ ├── csv-graph-to-db.rkt │ ├── edges-to-csv.rkt │ ├── tsv-graph-to-db-lenient.rkt │ └── tsv-graph-to-db.rkt ├── medikanren2/ │ ├── .clean.sh │ ├── .compile.sh │ ├── .data-directory-ci │ ├── .gitignore │ ├── .install_pkgs.sh │ ├── .run_ci.sh │ ├── base.rkt │ ├── chembl_sample_edge.rkt │ ├── common.rkt │ ├── configref.rkt │ ├── connect_dbk_to_sql.rkt │ ├── db/ │ │ ├── clinical_kg.rkt │ │ ├── kgx-synonym.rkt │ │ ├── rtx2-20210204.rkt │ │ ├── rtx2-biolink_2_1_2021_07_28.rkt │ │ ├── rtx2-biolink_2_1_2021_08_04_condensed.rkt │ │ ├── semmed.rkt │ │ ├── sri-reference-kg-0.3.0.rkt │ │ ├── yeast-micro-sri-reference-kg-0.3.0.rkt │ │ └── yeast-sri-reference-kg-0.3.0.rkt │ ├── dbk/ │ │ ├── LICENSE │ │ ├── README.md │ │ ├── SNAPSHOT │ │ ├── bcat.rkt │ │ ├── dbk/ │ │ │ ├── abstract-syntax.rkt │ │ │ ├── codec.rkt │ │ │ ├── common.rkt │ │ │ ├── concrete-syntax-extended.rkt │ │ │ ├── concrete-syntax.rkt │ │ │ ├── config.rkt │ │ │ ├── constraint.rkt │ │ │ ├── data.rkt │ │ │ ├── dsv.rkt │ │ │ ├── enumerator.rkt │ │ │ ├── example-concrete-syntax-extended.rkt │ │ │ ├── heap.rkt │ │ │ ├── io.rkt │ │ │ ├── misc.rkt │ │ │ ├── mk.rkt │ │ │ ├── old/ │ │ │ │ ├── abstract-syntax.rkt │ │ │ │ ├── example/ │ │ │ │ │ ├── base.rkt │ │ │ │ │ ├── counters.rkt │ │ │ │ │ ├── path.rkt │ │ │ │ │ ├── quorum.rkt │ │ │ │ │ └── shortest-path.rkt │ │ │ │ ├── parse.rkt │ │ │ │ └── process.rkt │ │ │ ├── order.rkt │ │ │ ├── semantics.rkt │ │ │ ├── stream.rkt │ │ │ ├── syntax.rkt │ │ │ └── table.rkt │ │ ├── dbk.rkt │ │ ├── test/ │ │ │ ├── .gitignore │ │ │ ├── benchmark-sorting/ │ │ │ │ ├── radix-sort.rkt │ │ │ │ └── string-sort.rkt │ │ │ ├── benchmark1.rkt │ │ │ ├── test-dataflow.rkt │ │ │ ├── test-ingest-example-simple.rkt │ │ │ ├── test-ingest-example.rkt │ │ │ └── test-mk.rkt │ │ ├── toggle-git │ │ ├── toggle-git-backup │ │ ├── update │ │ └── update-snapshot │ ├── dbk.rkt │ ├── etc/ │ │ ├── config.defaults.scm │ │ ├── config.stage.dev.scm │ │ └── config.stage.prod.scm │ ├── ex_cohd.rkt │ ├── gui.rkt │ ├── ingest-pipeline-status.rkt │ ├── logging.rkt │ ├── logging2.rkt │ ├── lw-reasoning.rkt │ ├── mkconfigref.rkt │ ├── neo/ │ │ ├── dbKanren/ │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── bcat.rkt │ │ │ ├── csv2tsv.rkt │ │ │ ├── dbk/ │ │ │ │ ├── abstract-syntax.rkt │ │ │ │ ├── codec.rkt │ │ │ │ ├── common.rkt │ │ │ │ ├── concrete-syntax-extended.rkt │ │ │ │ ├── concrete-syntax.rkt │ │ │ │ ├── config.rkt │ │ │ │ ├── constraint.rkt │ │ │ │ ├── data.rkt │ │ │ │ ├── database.rkt │ │ │ │ ├── dsv.rkt │ │ │ │ ├── enumerator.rkt │ │ │ │ ├── example-concrete-syntax-extended.rkt │ │ │ │ ├── heap.rkt │ │ │ │ ├── io.rkt │ │ │ │ ├── logging.rkt │ │ │ │ ├── misc.rkt │ │ │ │ ├── mk.rkt │ │ │ │ ├── old/ │ │ │ │ │ ├── abstract-syntax.rkt │ │ │ │ │ ├── example/ │ │ │ │ │ │ ├── base.rkt │ │ │ │ │ │ ├── counters.rkt │ │ │ │ │ │ ├── path.rkt │ │ │ │ │ │ ├── quorum.rkt │ │ │ │ │ │ └── shortest-path.rkt │ │ │ │ │ ├── parse.rkt │ │ │ │ │ └── process.rkt │ │ │ │ ├── order.rkt │ │ │ │ ├── safe-unsafe.rkt │ │ │ │ ├── semantics.rkt │ │ │ │ ├── storage.rkt │ │ │ │ ├── stream.rkt │ │ │ │ ├── syntax.rkt │ │ │ │ └── table.rkt │ │ │ ├── dbk.rkt │ │ │ └── test/ │ │ │ ├── .gitignore │ │ │ ├── benchmark-sorting/ │ │ │ │ ├── radix-sort.rkt │ │ │ │ └── string-sort.rkt │ │ │ ├── benchmark1.rkt │ │ │ ├── chinook/ │ │ │ │ ├── .gitignore │ │ │ │ ├── README.md │ │ │ │ └── build.sh │ │ │ ├── datalog/ │ │ │ │ ├── basic-naive.rkt │ │ │ │ ├── compile.rkt │ │ │ │ ├── kanren-notation-micro.rkt │ │ │ │ ├── micro-plus.rkt │ │ │ │ ├── micro-with-sets.rkt │ │ │ │ ├── micro.rkt │ │ │ │ ├── test-basic.rkt │ │ │ │ ├── test-kanren-micro.rkt │ │ │ │ ├── test-unmanaged-micro-plus.rkt │ │ │ │ ├── test-unmanaged-micro.rkt │ │ │ │ ├── unmanaged-notation-micro-plus.rkt │ │ │ │ └── unmanaged-notation-micro.rkt │ │ │ ├── equivalence-database.rkt │ │ │ ├── microbenchmarks/ │ │ │ │ ├── integer-bytes-throughput.rkt │ │ │ │ ├── place1.rkt │ │ │ │ ├── place2.rkt │ │ │ │ └── shared.rkt │ │ │ ├── test-database-small.rkt │ │ │ ├── test-dataflow.rkt │ │ │ ├── test-equivalence-database.rkt │ │ │ ├── test-ingest-example-simple.rkt │ │ │ ├── test-ingest-example.rkt │ │ │ ├── test-low-level.rkt │ │ │ ├── test-mk.rkt │ │ │ ├── test-semantics.rkt │ │ │ └── test-storage.rkt │ │ ├── neo-biolink/ │ │ │ ├── biolink_2_4_8/ │ │ │ │ └── biolink-model.yaml │ │ │ ├── biolink_3_0_3/ │ │ │ │ └── biolink-model.yaml │ │ │ ├── biolink_3_1_1/ │ │ │ │ └── biolink-model.yaml │ │ │ ├── biolink_3_1_2/ │ │ │ │ └── biolink-model.yaml │ │ │ ├── biolink_3_5_2/ │ │ │ │ ├── biolink-model.yaml │ │ │ │ ├── semmed-exclude-list-model.yaml │ │ │ │ └── semmed-exclude-list.yaml │ │ │ └── biolink_4_2_1/ │ │ │ └── biolink-model.yaml │ │ ├── neo-command-line-interface/ │ │ │ ├── README.md │ │ │ ├── command-line-interface.rkt │ │ │ └── utils.rkt │ │ ├── neo-data/ │ │ │ ├── place_processed_data_here.txt │ │ │ ├── raw_downloads_from_kge_archive/ │ │ │ │ └── place_raw_2tsv_kge_downloads_here.txt │ │ │ └── raw_downloads_from_kge_archive_transformed_to_4tsv/ │ │ │ └── 4tsv_versions_of_kgs_will_be_generated_here.txt │ │ ├── neo-data-import/ │ │ │ ├── an_important_note_on_pre_processing_kgs.txt │ │ │ ├── bucket-setting/ │ │ │ │ ├── README.md │ │ │ │ ├── generate-publication-dist.py │ │ │ │ ├── predicate-publication-statistics.rkt │ │ │ │ ├── rtx-kg2-publication-distribution.rkt │ │ │ │ └── run.sh │ │ │ ├── build-mediKanren2-kg-from-4tsv/ │ │ │ │ ├── import-full-Robokop.rkt │ │ │ │ ├── import-rtx-kg2.rkt │ │ │ │ └── import-text_mining.rkt │ │ │ └── transform-2tsv-to-4tsv-kgs/ │ │ │ ├── transform-edge-jsonl.rkt │ │ │ ├── transform-edge-tsv.rkt │ │ │ ├── transform-full-Robokop.rkt │ │ │ ├── transform-generic.rkt │ │ │ ├── transform-node-jsonl.rkt │ │ │ ├── transform-node-tsv.rkt │ │ │ ├── transform-rtx-kg2.rkt │ │ │ ├── transform-text_mining.rkt │ │ │ ├── transform-utils.rkt │ │ │ └── transform.rkt │ │ ├── neo-low-level/ │ │ │ ├── make-query-low-level.rkt │ │ │ ├── query-low-level-equivalence.rkt │ │ │ ├── query-low-level-multi-db.rkt │ │ │ ├── query-low-level-node-normalization.rkt │ │ │ ├── query-low-level-robokop.rkt │ │ │ ├── query-low-level-rtx-kg2.rkt │ │ │ └── query-low-level-text-mining.rkt │ │ ├── neo-open-api/ │ │ │ ├── mediKanrenSmartAPI_1_4.json │ │ │ ├── mediKanrenSmartAPI_1_4.yaml │ │ │ ├── mediKanrenSmartAPI_1_5.json │ │ │ ├── mediKanrenSmartAPI_1_5.yaml │ │ │ ├── neo-api-query.rkt │ │ │ ├── unsecret-source-consume.yaml │ │ │ ├── unsecret_metaKG.json │ │ │ └── unsecret_metaKG_May_2023.json │ │ ├── neo-reasoning/ │ │ │ ├── neo-biolink-reasoning-low-level.rkt │ │ │ ├── neo-biolink-reasoning.rkt │ │ │ └── semmed-exclude.rkt │ │ ├── neo-server/ │ │ │ ├── experiments/ │ │ │ │ ├── experiment-1.rkt │ │ │ │ ├── experiment-2.rkt │ │ │ │ ├── experiment-3.rkt │ │ │ │ ├── experiment-4.rkt │ │ │ │ ├── experiment-5.rkt │ │ │ │ ├── experiment-6.rkt │ │ │ │ └── experiment-7.rkt │ │ │ ├── neo-server-utils.rkt │ │ │ └── neo-server.rkt │ │ ├── neo-tests/ │ │ │ └── test-mvps-TRAPI-response.rkt │ │ ├── neo-utils/ │ │ │ ├── neo-helpers-multi-db.rkt │ │ │ └── neo-helpers-without-db.rkt │ │ └── readme.md │ ├── open-api/ │ │ ├── ISB-KG-api.rkt │ │ ├── TranslatorReasonersAPI.json │ │ ├── TranslatorReasonersAPI.yaml │ │ ├── api-query.rkt │ │ ├── yaml-to-json.sh │ │ └── yaml2json.py │ ├── readme.md │ ├── server.rkt │ ├── string-search-config.rkt │ ├── string-search-impl.rkt │ ├── string-search-impl2.rkt │ ├── string-search.rkt │ ├── synonyms.rkt │ ├── test/ │ │ ├── 10GB-CI/ │ │ │ ├── require-common-spec.rkt │ │ │ ├── string-search-build-spec.rkt │ │ │ ├── string-search-spec.rkt │ │ │ ├── string-search-yeast-spec.rkt │ │ │ └── with-yeast-sri-reference-kg-spec.rkt │ │ ├── example_mk2_queries.rkt │ │ ├── query_clinical_kg.rkt │ │ ├── rtx2-20210204.rkt │ │ └── semmed.rkt │ ├── trapi-cli.rkt │ ├── trapi.rkt │ └── util/ │ ├── data-import-workaround/ │ │ └── remove_cr.pl │ └── storage-size-workaround/ │ └── s-cerevisiae-kg-ref-ll.py ├── stuff/ │ ├── cmd-helpers.rkt │ ├── install-data-files.rkt │ ├── run-shell-pipelines.rkt │ └── symlink-tree.rkt └── trace-pathways-by-tissue-type.rkt
SYMBOL INDEX (4 symbols across 3 files) FILE: attic/yaml/yaml2sexp.py function sexp (line 1) | def sexp(r, indent=0, dot=''): FILE: medikanren2/neo/neo-data-import/bucket-setting/generate-publication-dist.py function export_to_tsv (line 13) | def export_to_tsv(data, filename): FILE: medikanren2/util/storage-size-workaround/s-cerevisiae-kg-ref-ll.py function dictappend (line 38) | def dictappend(d,k,v): function path_prefix (line 105) | def path_prefix(prefix,rfile):
Copy disabled (too large)
Download .json
Condensed preview — 532 files, each showing path, character count, and a content snippet. Download the .json file for the full structured content (17,761K chars).
[
{
"path": ".github/workflows/request-10GB-CI.yml",
"chars": 821,
"preview": "name: Request 10GB-CI\n\non:\n push:\n pull_request:\n\njobs:\n request-10GB-CI:\n runs-on: ubuntu-latest\n steps:\n "
},
{
"path": ".gitignore",
"chars": 391,
"preview": ".DS_Store\n/ci_artifacts\n/code/semmed/publication-reference.scm\n/code/semmed/edge-by-object\n/code/semmed/edge-by-predicat"
},
{
"path": "LICENSE",
"chars": 1105,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2017 William E. Byrd and Gregory Rosenblatt\n\nPermission is hereby granted, free of "
},
{
"path": "Makefile",
"chars": 790,
"preview": "\nadirRepo := $(shell cd $(dir $(firstword $(MAKEFILE_LIST))) && pwd)\n# https://stackoverflow.com/questions/322936/common"
},
{
"path": "README.md",
"chars": 633,
"preview": "# mediKanren\n\n*** FOR RESEARCH PURPOSES ONLY ***\n\nProof-of-concept for reasoning over medical knowledge graphs, using mi"
},
{
"path": "attic/code/README.md",
"chars": 2782,
"preview": "# mediKanren\n\n*** FOR RESEARCH PURPOSES ONLY ***\n\nProof-of-concept for reasoning over the SemMedDB knowledge base, using"
},
{
"path": "attic/code/concept.rkt",
"chars": 240,
"preview": "#lang racket/base\n(provide\n concept-cui\n concept-name\n concept-type\n )\n\n(define (concept-cui concept) (vector-ref co"
},
{
"path": "attic/code/csv-semmed-ordered-unique-enum.rkt",
"chars": 3471,
"preview": "#lang racket/base\n(require\n \"csv.rkt\"\n (except-in racket/control set)\n racket/set)\n\n;; This is the pre-normalization "
},
{
"path": "attic/code/csv-semmed-simplify.rkt",
"chars": 9999,
"preview": "#lang racket/base\n(require\n \"csv.rkt\"\n \"edge.rkt\"\n \"read.rkt\"\n (except-in racket/control set)\n racket/file\n racket"
},
{
"path": "attic/code/csv-semmed-validate-cuis.rkt",
"chars": 932,
"preview": "#lang racket/base\n(require\n \"csv.rkt\"\n racket/list\n )\n\n(define argv (current-command-line-arguments))\n(define argv-ex"
},
{
"path": "attic/code/csv.rkt",
"chars": 2101,
"preview": "#lang racket/base\n(provide\n csv-records\n set-field-separator!\n )\n\n\n;; Informal CSV Grammar\n;RECORD-SEPARATOR ::= \\r\\n"
},
{
"path": "attic/code/db.rkt",
"chars": 6968,
"preview": "#lang racket/base\n(provide\n id=>predicate\n predicate=>id\n id=>semtype\n semtype=>id\n semtype-id=>cui*\n concept*\n c"
},
{
"path": "attic/code/edge.rkt",
"chars": 2373,
"preview": "#lang racket/base\n(provide\n bytes->edge\n edge->bytes\n edge-byte-size\n edge-dst\n edge-src\n edge-predicate\n edge-sr"
},
{
"path": "attic/code/gui-simple.rkt",
"chars": 44358,
"preview": "#lang racket\n\n(require\n racket/sandbox\n racket/gui/base\n racket/engine\n racket/date\n \"db.rkt\"\n \"mk-db.rkt\"\n \"conc"
},
{
"path": "attic/code/helpers.rkt",
"chars": 456,
"preview": "#lang racket/base\n(provide\n membero\n not-membero\n )\n\n(require\n \"mk.rkt\"\n )\n\n\n\n;; list membership\n(define membero\n "
},
{
"path": "attic/code/imatinib-query.rkt",
"chars": 134598,
"preview": "#lang racket\n;; We are using Racket as our base language.\n\n;; Load the mediKanren logic engine, and the Racket-formatted"
},
{
"path": "attic/code/microKanren/README.md",
"chars": 1101,
"preview": "Kanren\n==========\n\nCopyright (C) 2013 Jason Hemann and Daniel P. Friedman\n\nPermission is hereby granted, free of charge,"
},
{
"path": "attic/code/microKanren/microKanren-test-programs.scm",
"chars": 2857,
"preview": "\n(define-syntax test-check\n (syntax-rules ()\n ((_ title tested-expression expected-result)\n (begin\n (print"
},
{
"path": "attic/code/microKanren/microKanren-test.scm",
"chars": 2170,
"preview": "(load \"microKanren-test-programs.scm\")\n\n(test-check \"second-set t1\"\n (let (($ ((call/fresh (lambda (q) (== q 5))) empty"
},
{
"path": "attic/code/microKanren/microKanren.scm",
"chars": 1479,
"preview": ";; Jason Hemann and Dan Friedman\n;; microKanren, final implementation from paper\n\n(define (var c) (vector c))\n(define (v"
},
{
"path": "attic/code/microKanren/miniKanren-wrappers.scm",
"chars": 5124,
"preview": "\n;;;; How to make a simple miniKanren (substitution only)\n\n(define-syntax Zzz\n (syntax-rules ()\n ((_ g) (lambda (s/c"
},
{
"path": "attic/code/mk/LICENSE",
"chars": 1172,
"preview": "The MIT License (MIT)\n\nOriginal work Copyright (c) 2015 William E. Byrd and Michael Ballantyne\nModified work Copyright ("
},
{
"path": "attic/code/mk/README.md",
"chars": 893,
"preview": "# miniKanren-with-symbolic-constraints\n\nA revision of https://github.com/webyrd/miniKanren-with-symbolic-constraints/ fo"
},
{
"path": "attic/code/mk/arithmetic.scm",
"chars": 7151,
"preview": "(load \"mk.scm\")\n;; Relational arithmetic\n\n(define appendo\n (lambda (l s out)\n (conde\n [(== '() l) (== s out)]\n "
},
{
"path": "attic/code/mk/evalo.scm",
"chars": 1474,
"preview": "(load \"mk.scm\")\n\n(define evalo\n (lambda (exp val)\n (eval-expo exp '() val)))\n\n(define eval-expo\n (lambda (exp env v"
},
{
"path": "attic/code/mk/mk.scm",
"chars": 46337,
"preview": "; Old trie implementation, due to Abdulaziz Ghuloum. Used for substitution\n; and constraint store.\n\n ;;; subst ::= (emp"
},
{
"path": "attic/code/mk/test-all.scm",
"chars": 219,
"preview": "(printf \"test-type-infer\\n\")\n(load \"test-type-infer.scm\")\n\n(printf \"test-interp\\n\")\n(load \"test-interp.scm\")\n\n(printf \"t"
},
{
"path": "attic/code/mk/test-arithmetic.scm",
"chars": 6070,
"preview": "(load \"test-check.scm\")\n(load \"arithmetic.scm\")\n\n(test \"test 1\"\n (run* (q) (*o (build-num 2) (build-num 3) q))\n '(((0 "
},
{
"path": "attic/code/mk/test-check.scm",
"chars": 391,
"preview": "(define-syntax test\n (syntax-rules ()\n ((_ title tested-expression expected-result)\n (begin\n (printf \"Test"
},
{
"path": "attic/code/mk/test-interp.scm",
"chars": 3181,
"preview": "(load \"test-check.scm\")\n(load \"mk.scm\")\n\n(define eval-expo\n (lambda (exp env val)\n (conde\n ((fresh (rator rand "
},
{
"path": "attic/code/mk/test-quines.scm",
"chars": 25251,
"preview": "(load \"test-check.scm\")\n(load \"evalo.scm\")\n\n(test \"1 quine\"\n (run 1 (q) (evalo q q))\n '((((lambda (_.0) (list _.0 (lis"
},
{
"path": "attic/code/mk/test-type-infer.scm",
"chars": 1454,
"preview": "(load \"test-check.scm\")\n(load \"type-infer.scm\")\n\n(test \"types\"\n (run 10 (q) (fresh (t exp) (!- exp '() t) (== `(,exp ="
},
{
"path": "attic/code/mk/type-infer.scm",
"chars": 802,
"preview": "(load \"mk.scm\")\n\n(define !-\n (lambda (exp env t)\n (conde\n [(symbolo exp) (lookupo exp env t)]\n [(fresh (x "
},
{
"path": "attic/code/mk-db.rkt",
"chars": 5289,
"preview": "#lang racket/base\n(provide\n (all-from-out \"mk.rkt\")\n concepto\n fuzzy-concepto\n concept-semtypeo\n cuio\n cui*o\n edg"
},
{
"path": "attic/code/mk.rkt",
"chars": 33076,
"preview": "#lang racket/base\n\n(require racket/list\n racket/include\n racket/stream\n )\n\n(provide\n run run* r"
},
{
"path": "attic/code/process-db.rkt",
"chars": 1657,
"preview": "#lang racket\n\n;; Racket code to process the osteoporosis database, turning it into classy (but unnormalized) s-expressio"
},
{
"path": "attic/code/programmatically-defined-relations.rkt",
"chars": 5925,
"preview": "#lang racket\n(provide\n appendo\n decreases\n decreases*\n increases\n increases*\n lengtho\n length>=o\n not-nilo\n pat"
},
{
"path": "attic/code/read.rkt",
"chars": 444,
"preview": "#lang racket/base\n(provide\n read-all\n read-all/stream\n read-all-from-file\n )\n\n(require\n racket/stream\n )\n\n(define "
},
{
"path": "attic/code/sample_semmed.csv",
"chars": 87213,
"preview": "PREDICATION_ID,SENTENCE_ID,PMID,PREDICATE,SUBJECT_CUI,SUBJECT_NAME,SUBJECT_SEMTYPE,SUBJECT_NOVELTY,OBJECT_CUI,OBJECT_NAM"
},
{
"path": "attic/code/semmed/PREDICATE.scm",
"chars": 893,
"preview": "\"1176\"\n\"ADMINISTERED_TO\"\n\"AFFECTS\"\n\"ASSOCIATED_WITH\"\n\"AUGMENTS\"\n\"CAUSES\"\n\"COEXISTS_WITH\"\n\"COMPLICATES\"\n\"CONVERTS_TO\"\n\"DI"
},
{
"path": "attic/code/semmed/PREDICATE_OCCURRENCE_ORDERED.scm",
"chars": 893,
"preview": "\"ISA\"\n\"PART_OF\"\n\"PROCESS_OF\"\n\"TREATS\"\n\"LOCATION_OF\"\n\"METHOD_OF\"\n\"INTERACTS_WITH\"\n\"COEXISTS_WITH\"\n\"DIAGNOSES\"\n\"CAUSES\"\n\"A"
},
{
"path": "attic/code/semmed/README.md",
"chars": 1024,
"preview": "The data can be generated with these commands:\n\n```\nracket csv-semmed-ordered-unique-enum.rkt semmedVER30_A_clean.csv se"
},
{
"path": "attic/code/semmed/SEMTYPE.scm",
"chars": 935,
"preview": "\"0\"\n\"aapp\"\n\"acab\"\n\"acty\"\n\"aggp\"\n\"alga\"\n\"amas\"\n\"amph\"\n\"anab\"\n\"anim\"\n\"anst\"\n\"antb\"\n\"arch\"\n\"bacs\"\n\"bact\"\n\"bdsu\"\n\"bdsy\"\n\"bhv"
},
{
"path": "attic/code/semmed/cui-by-semtype.scm",
"chars": 2508967,
"preview": "(0 3146964)\n(1 52 84 107 132 152 165 184 189 246 254 257 291 324 340 359 366 378 392 404 412 413 435 490 500 507 530 578"
},
{
"path": "attic/code/semmed-index-predicate.rkt",
"chars": 2296,
"preview": "#lang racket/base\n(require\n \"edge.rkt\"\n racket/file\n )\n\n(define argv (current-command-line-arguments))\n(define argv-e"
},
{
"path": "attic/code/study-dfo-raynaud.rkt",
"chars": 1373,
"preview": "#lang racket\n(require\n \"db.rkt\"\n \"concept.rkt\"\n \"edge.rkt\"\n )\n\n(define dfo* (fuzzy-name*->concept* concept* '(\"fish\""
},
{
"path": "attic/code/study-imatinib.rkt",
"chars": 562502,
"preview": "#lang racket\n(require\n \"mk-db.rkt\"\n )\n\n(displayln\n \"Finished loading mk-db.rkt.\")\n\n;; we want a direct link bewteen i"
},
{
"path": "attic/code/study-sickle-malaria.rkt",
"chars": 19681,
"preview": "#lang racket\n(require\n \"mk-db.rkt\"\n )\n\n(displayln\n \"Finished loading mk-db.rkt (which probably took longer than the q"
},
{
"path": "attic/code/tacrine.rkt",
"chars": 21313,
"preview": "#lang racket\n;; We are using Racket as our base language.\n\n;; Load the mediKanren logic engine, and the Racket-formatted"
},
{
"path": "attic/medikanren/CACNA1A-full.rkt",
"chars": 3453,
"preview": "#lang racket\n(provide\n (all-from-out \"mk.rkt\")\n (all-from-out \"mk-db.rkt\")\n\n membero\n rem-dups\n edgeo\n ~name-conce"
},
{
"path": "attic/medikanren/DNM1L-full.rkt",
"chars": 46890,
"preview": "#lang racket\n(provide\n (all-from-out \"mk.rkt\")\n (all-from-out \"mk-db.rkt\")\n\n membero\n rem-dups\n edgeo\n ~name-conce"
},
{
"path": "attic/medikanren/NF1-full.rkt",
"chars": 9804,
"preview": "#lang racket\n(provide\n (all-from-out \"mk.rkt\")\n (all-from-out \"mk-db.rkt\")\n\n membero\n rem-dups\n edgeo\n ~name-conce"
},
{
"path": "attic/medikanren/brca1-full.rkt",
"chars": 2105,
"preview": "#lang racket\n(provide\n (all-from-out \"mk.rkt\")\n (all-from-out \"mk-db.rkt\")\n\n membero\n edgeo\n ~name-concepto)\n\n\n(req"
},
{
"path": "attic/medikanren/brca1.rkt",
"chars": 1332,
"preview": "#lang racket\n(require\n \"mk-db.rkt\"\n )\n\n;; list membership\n(define membero\n (lambda (x ls)\n (fresh (y rest)\n ("
},
{
"path": "attic/medikanren/create-all-hashtables.rkt",
"chars": 1049,
"preview": "#lang racket\n\n(require\n \"create-hashtable-common.rkt\"\n \"create-doid-cui-to-cid-hashtable.rkt\"\n \"create-ensembl-cui-to"
},
{
"path": "attic/medikanren/create-doid-cui-to-cid-hashtable.rkt",
"chars": 775,
"preview": "#lang racket\n\n(require\n \"create-hashtable-common.rkt\")\n\n(provide\n (all-defined-out))\n\n\n(define doid-ht (make-hash))\n(d"
},
{
"path": "attic/medikanren/create-ensembl-cui-to-cid-hashtable.rkt",
"chars": 2860,
"preview": "#lang racket\n\n(require\n \"create-hashtable-common.rkt\")\n\n(provide\n (all-defined-out))\n\n(define ensembl-ht (make-hash))\n"
},
{
"path": "attic/medikanren/create-hashtable-common.rkt",
"chars": 4063,
"preview": "#lang racket\n\n(require\n )\n\n(provide\n SEMMED\n RTX\n ROBOKOP\n ORANGE\n HASHTABLE_SAVE_DIRECTORY\n filled-hashtable?\n "
},
{
"path": "attic/medikanren/create-hgnc-cui-to-cid-hashtable.rkt",
"chars": 785,
"preview": "#lang racket\n\n(require\n \"create-hashtable-common.rkt\")\n\n(provide\n (all-defined-out))\n\n\n(define hgnc-ht (make-hash))\n(d"
},
{
"path": "attic/medikanren/create-hpo-cui-to-cid-hashtable.rkt",
"chars": 755,
"preview": "#lang racket\n\n(require\n \"create-hashtable-common.rkt\")\n\n(provide\n (all-defined-out))\n\n\n(define hpo-ht (make-hash))\n(de"
},
{
"path": "attic/medikanren/create-mondo-cui-to-cid-hashtable.rkt",
"chars": 812,
"preview": "#lang racket\n\n(require\n \"create-hashtable-common.rkt\")\n\n(provide\n (all-defined-out))\n\n(define mondo-ht (make-hash))\n(d"
},
{
"path": "attic/medikanren/create-omim-cui-to-cid-hashtable.rkt",
"chars": 1327,
"preview": "#lang racket\n\n(require\n \"create-hashtable-common.rkt\")\n\n(provide\n (all-defined-out))\n\n(define omim-ht (make-hash))\n(de"
},
{
"path": "attic/medikanren/create-umls-cui-to-cid-hashtable.rkt",
"chars": 799,
"preview": "#lang racket\n\n(require\n \"create-hashtable-common.rkt\")\n\n(provide\n (all-defined-out))\n\n\n(define umls-ht (make-hash))\n(d"
},
{
"path": "attic/medikanren/create-uniprotkb-cui-to-cid-hashtable.rkt",
"chars": 3298,
"preview": "#lang racket\n\n(require\n \"create-hashtable-common.rkt\")\n\n(provide\n (all-defined-out))\n\n\n(define uniprotkb-ht (make-hash"
},
{
"path": "attic/medikanren/dhx30-full.rkt",
"chars": 2696,
"preview": "#lang racket\n(provide\n (all-from-out \"mk.rkt\")\n (all-from-out \"mk-db.rkt\")\n\n membero\n edgeo\n ~name-concepto\n\n semm"
},
{
"path": "attic/medikanren/dhx30.rkt",
"chars": 2403,
"preview": "#lang racket\n(require\n \"mk-db.rkt\"\n )\n\n;; list membership\n(define membero\n (lambda (x ls)\n (fresh (y rest)\n ("
},
{
"path": "attic/medikanren/examine-concepts.rkt",
"chars": 5030,
"preview": "#lang racket\n\n(provide\n\n concept-info\n concept-count-alist-sorted-by-tag-name\n concept-count-alist-sorted-by-tag-count\n "
},
{
"path": "attic/medikanren/example-dhx30-monarch-lite.rkt",
"chars": 5883,
"preview": "#lang racket\n(require\n \"mk-db.rkt\"\n )\n\n(define monarch-lite (time (make-db \"data/monarch-lite\")))\n\n(displayln \"categor"
},
{
"path": "attic/medikanren/example-dhx30-scigraph.rkt",
"chars": 5255,
"preview": "#lang racket\n(require\n \"mk-db.rkt\"\n )\n\n(define scigraph (time (make-db \"data/scigraph\")))\n\n;; list membership\n(define "
},
{
"path": "attic/medikanren/find-edges-by-pubmed-id.rkt",
"chars": 6504,
"preview": "#lang racket\n\n(provide\n (all-from-out \"../../medikanren/mk.rkt\")\n (all-from-out \"../../medikanren/db.rkt\")\n (all-from-ou"
},
{
"path": "attic/medikanren/gui-simple-v3.rkt",
"chars": 104973,
"preview": "#lang racket\n\n#|\nGUI bug:\n\nstart GUI\n\nCURIE search for HGNC 15840 in Concept 1\nclick on some predicate\n\nthen do CURIE se"
},
{
"path": "attic/medikanren/sialic-full-will.rkt",
"chars": 9450,
"preview": "#lang racket\n(provide\n (all-from-out \"mk.rkt\")\n (all-from-out \"mk-db.rkt\")\n\n membero\n edgeo\n ~name-concepto\n\n semm"
},
{
"path": "attic/medikanren/sialic-full.rkt",
"chars": 8580,
"preview": "#lang racket\n(provide\n (all-from-out \"mk.rkt\")\n (all-from-out \"mk-db.rkt\")\n\n membero\n edgeo\n ~name-concepto\n\n remd"
},
{
"path": "attic/medikanren/test-POST.rkt",
"chars": 6168,
"preview": "#lang racket\n(require net/http-client\n json)\n\n(define (named-cuis->json named-cuis)\n (define (node cui name)\n "
},
{
"path": "attic/medikanren/w1m2-direct-POST.rkt",
"chars": 756,
"preview": "#lang racket\n(require net/http-client\n json)\n\n(define data (jsexpr->bytes\n '(\n ;(\""
},
{
"path": "attic/medikanren/web-server.rkt",
"chars": 13262,
"preview": "#lang racket/base\n(require\n \"common.rkt\"\n racket/match\n racket/port\n racket/pretty\n racket/string\n web-server/serv"
},
{
"path": "attic/medikanren/workflow-web-server.rkt",
"chars": 6951,
"preview": "#lang racket\n(require \"workflow1.rkt\"\n web-server/servlet\n web-server/servlet-env\n web-server/ma"
},
{
"path": "attic/medikanren/workflow1.rkt",
"chars": 18531,
"preview": ";;; Workflow 1\n\n#|\nconcept format (subject or object), without dbname at front:\n\n`(,cid ,cui ,name (,catid . ,cat) . ,pr"
},
{
"path": "attic/pharos/.gitignore",
"chars": 49,
"preview": "/data\n/schema.sql\n/schema-tokens.scm\n/schema.scm\n"
},
{
"path": "attic/pharos/README.md",
"chars": 2091,
"preview": "# mediKanren Pharos Interface\n\nThis is a mediKanren interface into the data provided by Pharos: https://pharos.nih.gov/i"
},
{
"path": "attic/pharos/csv.rkt",
"chars": 2089,
"preview": "#lang racket/base\n(provide\n csv-records\n set-field-separator!\n )\n\n;; Informal CSV Grammar\n;RECORD-SEPARATOR ::= \\r\\n "
},
{
"path": "attic/pharos/db.rkt",
"chars": 4590,
"preview": "#lang racket\n(provide\n db-info\n table-info->metadata\n table-info->detail-stream\n )\n\n(require\n \"read.rkt\"\n \"repr.rk"
},
{
"path": "attic/pharos/interact-sqlite3",
"chars": 191,
"preview": "#!/bin/bash\nset -eufo pipefail\n\nhere=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\n\nsqlite_db=\"file:$here/data/pha"
},
{
"path": "attic/pharos/mk-db.rkt",
"chars": 1604,
"preview": "#lang racket\n(provide\n pharos-metao\n pharoso\n )\n\n(require\n \"db.rkt\"\n \"mk.rkt\"\n )\n\n(define db (db-info \"data/db\"))\n"
},
{
"path": "attic/pharos/mk-parse.rkt",
"chars": 3261,
"preview": "#lang racket/base\n(provide\n fresh/p\n\n fail/p\n unit/p\n end\n\n single\n single-not\n one-of\n none-of\n\n many*\n many+"
},
{
"path": "attic/pharos/mk.rkt",
"chars": 33076,
"preview": "#lang racket/base\n\n(require racket/list\n racket/include\n racket/stream\n )\n\n(provide\n run run* r"
},
{
"path": "attic/pharos/mysql2sqlite/LICENSE",
"chars": 1089,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2015 esperlu, 2016 dumblob\n\nPermission is hereby granted, free of charge, to any pe"
},
{
"path": "attic/pharos/mysql2sqlite/mysql2sqlite",
"chars": 8675,
"preview": "#!/usr/bin/awk -f\n\n# Authors: @esperlu, @artemyk, @gkuenning, @dumblob\n\n# FIXME detect empty input file and issue a warn"
},
{
"path": "attic/pharos/mysql2sqlite/mysql2sqlite.README",
"chars": 2685,
"preview": "# mysql2sqlite\n\nConverts MySQL dump to SQLite3 compatible dump (including MySQL `KEY xxxxx` statements from the `CREATE`"
},
{
"path": "attic/pharos/mysql2sqlite/unit_tests.sh",
"chars": 2831,
"preview": "#/bin/sh\n\nM2S=./mysql2sqlite\nS=sqlite3\n\ntype \"$S\" >/dev/null 2>&1 || {\n printf 'ERR command \"%s\" not available\\n' \"$S\" "
},
{
"path": "attic/pharos/pharos-mysql-to-sqlite3-to-db",
"chars": 338,
"preview": "#!/bin/bash\nset -eufo pipefail\n\nhere=\"$( cd \"$( dirname \"${BASH_SOURCE[0]}\" )\" && pwd )\"\n\nmysql_dump=\"$1\"\n\nmkdir -p \"$he"
},
{
"path": "attic/pharos/read.rkt",
"chars": 444,
"preview": "#lang racket/base\n(provide\n read-all\n read-all/stream\n read-all-from-file\n )\n\n(require\n racket/stream\n )\n\n(define "
},
{
"path": "attic/pharos/repr.rkt",
"chars": 2392,
"preview": "#lang racket\n(provide\n integer->repr\n repr->integer\n decimal->repr\n repr->decimal\n string->repr\n repr->string\n da"
},
{
"path": "attic/pharos/sql-schema-parse.rkt",
"chars": 5286,
"preview": "#lang racket/base\n(require\n \"mk.rkt\"\n \"mk-parse.rkt\"\n )\n\n;; Parse SQL schema\n(define delimiters '(\",\" \")\") )\n(define "
},
{
"path": "attic/pharos/sql-tokenize.rkt",
"chars": 2510,
"preview": "#lang racket/base\n(require\n \"mk.rkt\"\n \"mk-parse.rkt\"\n racket/port\n )\n\n;; Tokenization\n(define chars-ws '(#\\space #\\t"
},
{
"path": "attic/pharos/sqlite-to-db.rkt",
"chars": 6285,
"preview": "#lang racket/base\n(require\n \"csv.rkt\"\n \"repr.rkt\"\n racket/file\n racket/list\n racket/set\n racket/string\n racket/sy"
},
{
"path": "attic/yaml/biolink-model.scm",
"chars": 205646,
"preview": "(define biolink-model\n'(\n (\n \"id\"\n . \"https://w3id.org/biolink/biolink-model\"\n )\n (\n \"name\"\n . \"biolink_m"
},
{
"path": "attic/yaml/example1.scm",
"chars": 3480,
"preview": "(define example1\n'(\n (\n \"id\"\n . \"http://example.org/sample/example1\"\n )\n (\n \"name\"\n . \"synopsis2\"\n )\n ("
},
{
"path": "attic/yaml/example1.yaml",
"chars": 1696,
"preview": "id: http://example.org/sample/example1\nname: synopsis2\nprefixes:\n foaf: http://xmlns.com/foaf/0.1/\n samp: http://e"
},
{
"path": "attic/yaml/yaml.scm",
"chars": 15546,
"preview": "#|\n\nTODOs\n\n* handle 'abstract' or 'mixin' associations -- mixin and abstract classes can never be instantiated!\n\n|#\n\n\n(l"
},
{
"path": "attic/yaml/yaml2sexp.py",
"chars": 887,
"preview": "def sexp(r, indent=0, dot=''):\n i = indent*' '\n j = (indent+2)*' '\n if type(r) == dict:\n if dot=='':\n print(i"
},
{
"path": "contrib/README.md",
"chars": 362,
"preview": "# Synopsis\n\nContributed use cases, queries and applications are now located in this directory, separate from medikanren "
},
{
"path": "contrib/medikanren/2020_NCATS_relay/INTEGRATED-QUERY/textmining->rtx2.rkt",
"chars": 1724,
"preview": "#lang racket\n(provide (all-defined-out))\n(require \"../../../../medikanren/pieces-parts/query.rkt\" \n rack"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/rtx2_2020_09_16/rtx2_2020_09_16-map.html",
"chars": 128059,
"preview": "<html>\n<head>\n <title>RTX2 KG Map</title>\n <script src=\"https://unpkg.com/vis-network/standalone/umd/vis-network.min.j"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/rtx2_2020_09_16/rtx2_2020_09_16-stats.txt",
"chars": 70,
"preview": "predicates: 848\ncategories: 54\nconcepts: 10,527,134\nedges: 53,589,306\n"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/rtx2_2020_09_16/rtx2_2020_09_16-subject_predicate_object_count.tsv",
"chars": 76569,
"preview": "subject CURIE prefix\tobject CURIE prefix\tpredicate\tedge count\nRXNORM\tRXNORM\trxcui:precise_ingredient_of\t6138\nEFO\tUMLS\txr"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/rtx2_2020_09_16/rtx2_2020_09_16.dot",
"chars": 127394,
"preview": "digraph{graph [ bgcolor=lightgray, fontname=Arial, fontcolor=blue, fontsize=12 ]; node [ fontname=Arial, fontcolor=blue,"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/rtx2_2020_09_16/rtx2_2020_09_16.txt",
"chars": 124729,
"preview": "\"AEO\" -> \"AEO\" [label=\"part_of (22)\"];\n\"AEO\" -> \"AEO\" [label=\"subclass_of (89)\"];\n\"AEO\" -> \"CARO\" [label=\"subclass_of (5"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/rtx2_2020_09_16/shorest-path-graph-visual-hover.html",
"chars": 2072,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n <head>\n <title>Vis Shortest Path Map</title>\n <meta charset=\"UTF-8\">\n <scrip"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/rtx2_2020_09_16/shortest_path.rkt",
"chars": 26012,
"preview": "#lang racket\n(provide (all-defined-out))\n(require csv-reading\n racket/hash\n racket/set\n racket/m"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/rtx2_2020_09_16/shortest_path_with_visual.rkt",
"chars": 26959,
"preview": "#lang racket\n(provide (all-defined-out))\n(require csv-reading\n racket/hash\n racket/set\n racket/m"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/sri-reference-kg-0.2.0/sri-reference-kg-0.2.0-map.html",
"chars": 77993,
"preview": "<html>\n<head>\n <title>SRI Reference 0.2.0 KG Map</title>\n <script src=\"https://unpkg.com/vis-network/standalone/umd/vi"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/sri-reference-kg-0.2.0/sri-reference-kg-0.2.0-subject_predicate_object_count.tsv",
"chars": 48790,
"preview": "subject CURIE prefix\tobject CURIE prefix\tpredicate\tedge count\nSGD\tSO\tbiolink:subclass_of\t6439\nWormBase\tWormBase\tbiolink:"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/sri-reference-kg-0.2.0/sri-reference-kg-0.2.0.dot",
"chars": 77313,
"preview": "digraph{graph [ bgcolor=lightgray, fontname=Arial, fontcolor=blue, fontsize=12 ]; node [ fontname=Arial, fontcolor=blue,"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/sri_semmeddb/sri_semmeddb-map.html",
"chars": 2162,
"preview": "<html>\n<head>\n <title>SRI Import of SemmedDB KG Map</title>\n <script src=\"https://unpkg.com/vis-network/standalone/umd"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/sri_semmeddb/sri_semmeddb-stats.txt",
"chars": 66,
"preview": "predicates: 21\ncategories: 12\nconcepts: 171,431\nedges: 14,180,763\n"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/sri_semmeddb/sri_semmeddb-subject_predicate_object_count.tsv",
"chars": 844,
"preview": "subject CURIE prefix\tobject CURIE prefix\tpredicate\tedge count\nUMLS\tUMLS\tbiolink:prevents\t143669\nUMLS\tUMLS\tbiolink:gene_a"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/sri_semmeddb/sri_semmeddb.dot",
"chars": 1479,
"preview": "digraph{graph [ bgcolor=lightgray, fontname=Arial, fontcolor=blue, fontsize=12 ]; node [ fontname=Arial, fontcolor=blue,"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/textminingprovider/co-occur/co-occur-map.html",
"chars": 4375,
"preview": "<html>\n<head>\n <title>TextMining Provider Co-occurrence KG Map</title>\n <script src=\"https://unpkg.com/vis-network/sta"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/textminingprovider/co-occur/co-occur-stats.txt",
"chars": 64,
"preview": "predicates: 1\ncategories: 12\nconcepts: 88,696\nedges: 96,684,414\n"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/textminingprovider/co-occur/co-occur-subject_predicate_object_count.tsv",
"chars": 2227,
"preview": "subject CURIE prefix\tobject CURIE prefix\tpredicate\tedge count\nMONDO\tSO\tbiolink:related_to\t1138140\nCHEBI\tMOP\tbiolink:rela"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/textminingprovider/co-occur/co-occur.dot",
"chars": 3681,
"preview": "digraph{graph [ bgcolor=lightgray, fontname=Arial, fontcolor=blue, fontsize=12 ]; node [ fontname=Arial, fontcolor=blue,"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/textminingprovider/pr-owl/pr-owl-map.html",
"chars": 6132,
"preview": "<html>\n<head>\n <title>TextMining Provider PR-OWL KG Map</title>\n <script src=\"https://unpkg.com/vis-network/standalone"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/textminingprovider/pr-owl/pr-owl-stats.txt",
"chars": 65,
"preview": "predicates: 15\ncategories: 11\nconcepts: 486,322\nedges: 1,003,564\n"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/textminingprovider/pr-owl/pr-owl-subject_predicate_object_count.tsv",
"chars": 3298,
"preview": "subject CURIE prefix\tobject CURIE prefix\tpredicate\tedge count\nPR\tGO\tbiolink:located_in\t2\nPR\tCHEBI\tbiolink:non_covalently"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/textminingprovider/pr-owl/pr-owl.dot",
"chars": 5445,
"preview": "digraph{graph [ bgcolor=lightgray, fontname=Arial, fontcolor=blue, fontsize=12 ]; node [ fontname=Arial, fontcolor=blue,"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/textminingprovider/textminingprovider/textminingprovider-map.html",
"chars": 1107,
"preview": "<html>\n<head>\n <title>TextMining Provider PR-OWL KG Map</title>\n <script src=\"https://unpkg.com/vis-network/standalone"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/textminingprovider/textminingprovider/textminingprovider-stats.txt",
"chars": 60,
"preview": "predicates: 2\ncategories: 3\nconcepts: 188,342\nedges: 87,798\n"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/textminingprovider/textminingprovider/textminingprovider-subject_predicate_object_count.tsv",
"chars": 184,
"preview": "subject CURIE prefix\tobject CURIE prefix\tpredicate\tedge count\nCHEBI\tPR\tbiolink:positively_regulates_entity_to_entity\t415"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg-maps/textminingprovider/textminingprovider/textminingprovider.dot",
"chars": 420,
"preview": "digraph{graph [ bgcolor=lightgray, fontname=Arial, fontcolor=blue, fontsize=12 ]; node [ fontname=Arial, fontcolor=blue,"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/kg_statistics_table_generator.R",
"chars": 647,
"preview": "### LIBRARIES\nlibrary(gt) \nlibrary(gtsummary)\nlibrary(lubridate)\nlibrary(tidyverse)\nlibrary(stringr)\nlibrary(readr)\n\nco_"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/rtx2-KG-query.rkt",
"chars": 1949,
"preview": "#lang racket\n(provide (all-defined-out))\n(require \"../../../medikanren/pieces-parts/query.rkt\" \n racket/"
},
{
"path": "contrib/medikanren/2020_NCATS_relay/textmining-KG-query.rkt",
"chars": 3269,
"preview": "#lang racket\n(provide (all-defined-out))\n(require \"../../../medikanren/pieces-parts/query.rkt\" \n racket/"
},
{
"path": "contrib/medikanren/README.md",
"chars": 74,
"preview": "# Synopsis\n\nContributions for medikanren version 1 go in this directory.\n\n"
},
{
"path": "contrib/medikanren/X-Y-C.rkt",
"chars": 26468,
"preview": ";;; X-Y-C queries\n;;; unknown-unknown-known concepts\n;;;\n;;; example:\n;;;\n;;; X - increases - G1 - increases - G2\n;;;\n;;"
},
{
"path": "contrib/medikanren/auto_query_symptom.rkt",
"chars": 15853,
"preview": "#lang racket\n(provide (all-defined-out)\n (all-from-out \"../../medikanren/common.rkt\" \"../../medikanren/pieces-pa"
},
{
"path": "contrib/medikanren/example-dhx30-rtx.rkt",
"chars": 2413,
"preview": "#lang racket\n(provide\n (all-from-out \"../../medikanren/mk.rkt\")\n (all-from-out \"../../medikanren/mk-db.rkt\")\n\n member"
},
{
"path": "contrib/medikanren/example-dhx30-semmed.rkt",
"chars": 3319,
"preview": "#lang racket\n(require\n \"../../medikanren/mk-db.rkt\"\n )\n\n(define semmed (make-db \"data/semmed\"))\n\n\n(displayln \"------- "
},
{
"path": "contrib/medikanren/example-tacrine-semmed.rkt",
"chars": 3911,
"preview": "#lang racket\n(require\n \"../../medikanren/pieces-parts/mk-db.rkt\"\n )\n\n(define semmed (make-db \"data/semmed\"))\n\n\n(displa"
},
{
"path": "contrib/medikanren/genes-perturbed.rkt",
"chars": 9728,
"preview": "#lang racket/base\n(provide (all-defined-out) (all-from-out \"../../medikanren/common.rkt\"))\n(require \"../../medikanren/co"
},
{
"path": "contrib/medikanren/get-all-hgncs-from-raw-data.rkt",
"chars": 2699,
"preview": "#lang racket\n(provide (all-defined-out)\n (all-from-out \"../../medikanren/pieces-parts/synonymize.rkt\"))\n(require"
},
{
"path": "contrib/medikanren/make-kg-edge-covid19.rkt",
"chars": 1773,
"preview": "#lang racket\n(provide (all-defined-out))\n\n#|\nname-file.edge.scm\n:ID :START :END\n\nex-row: 1 ENSEMBL:ENSG00000004059 ENSEM"
},
{
"path": "contrib/medikanren/make-kg-edge-general.rkt",
"chars": 1913,
"preview": "#lang racket\n(provide (all-defined-out))\n\n#|\nname-file.edge.scm\n:ID :START :END\n\nex-row: 1 ENSEMBL:ENSG00000004059 ENSEM"
},
{
"path": "contrib/medikanren/make-kg-edge-sri-reference-kg.rkt",
"chars": 2118,
"preview": "#lang racket\n(provide (all-defined-out))\n\n#|\nname-file.edge.scm\n:ID :START :END\n\nex-row: 1 ENSEMBL:ENSG00000004059 ENSEM"
},
{
"path": "contrib/medikanren/make-kg-edge.rkt",
"chars": 1892,
"preview": "#lang racket\n(provide (all-defined-out))\n\n#|\nname-file.edge.scm\n:ID :START :END\n\nex-row: 1 ENSEMBL:ENSG00000004059 ENSEM"
},
{
"path": "contrib/medikanren/make-kg-node-general.rkt",
"chars": 2055,
"preview": "#lang racket\n(provide (all-defined-out))\n\n#|\nname-file.node.scm\n:ID\n\nname-file.node-props.scm\n:ID propname value\n|#\n\n\n(d"
},
{
"path": "contrib/medikanren/make-kg-node-sri-reference-kg.rkt",
"chars": 1827,
"preview": "#lang racket\n(provide (all-defined-out))\n\n#|\nname-file.node.scm\n:ID\n\nname-file.node-props.scm\n:ID propname value\n|#\n\n\n(d"
},
{
"path": "contrib/medikanren/make-kg-node.rkt",
"chars": 1854,
"preview": "#lang racket\n(provide (all-defined-out))\n\n#|\nname-file.edge.scm\n:ID :START :END\n\nex-row: 1 ENSEMBL:ENSG00000004059 ENSEM"
},
{
"path": "contrib/medikanren/marissa/migraine-case.rkt",
"chars": 12599,
"preview": "#lang racket\n(require \"../../medikanren/pieces-parts/query.rkt\")\n\n#|\nThis file focuses on migraine conditions as an exam"
},
{
"path": "contrib/medikanren/marissa/patient-case-workflow.rkt",
"chars": 4270,
"preview": "#lang racket\n(require \"../../medikanren/pieces-parts/query.rkt\")\n\n(define (unwrap lst)\n (cond [(or (null? lst) (not (li"
},
{
"path": "contrib/medikanren/marvin.rkt",
"chars": 18471,
"preview": "#lang racket\n\n;;; Find drugs that budge a given gene/set of genes up or down\n\n;;; Prototype for more sophisticated autom"
},
{
"path": "contrib/medikanren/pieces-parts/CHAMP1_RNA_seq_original.rkt",
"chars": 28056,
"preview": "#lang racket\n(require\n \"../../../medikanren/pieces-parts/query.rkt\"\n \"Thi-useful-functions.rkt\")\n\n;;;;;;;;;;;;;;;;;;;;"
},
{
"path": "contrib/medikanren/pieces-parts/README_VISJS.md",
"chars": 1028,
"preview": "# VIS.JS Instructions\nAfter using make-map.rkt to create the DOT graph for whichever knowledge graph you would like to v"
},
{
"path": "contrib/medikanren/pieces-parts/Thi-useful-functions.rkt",
"chars": 9470,
"preview": "#lang racket\n(provide (all-defined-out))\n(require \"query.rkt\")\n\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;USEFUL F"
},
{
"path": "contrib/medikanren/pieces-parts/causal-discovery.rkt",
"chars": 2919,
"preview": "#lang racket\n(require\n \"../../../medikanren/db.rkt\"\n \"query.rkt\")\n\n;; Note: we should check if the 'negated' property"
},
{
"path": "contrib/medikanren/pieces-parts/chemical->drug-filter.rkt",
"chars": 5138,
"preview": "#lang racket\n(require \"../../../medikanren/pieces-parts/query.rkt\")\n\n\n;; chemical->drug-filter functions take a chemical"
},
{
"path": "contrib/medikanren/pieces-parts/drug-ranker.rkt",
"chars": 59986,
"preview": "#lang racket\n(provide (all-defined-out))\n(require \"../../../medikanren/pieces-parts/query.rkt\"\n racket/engine)\n;"
},
{
"path": "contrib/medikanren/pieces-parts/etl_for_new_KGs/xmlparse.rkt",
"chars": 4277,
"preview": "#lang racket\n(provide (all-defined-out))\n(require xml)\n\n#lang racket\n(provide (all-defined-out))\n(require xml)\n(require "
},
{
"path": "contrib/medikanren/pieces-parts/example-2-hop-rhobtb2-drug-safe.rkt",
"chars": 3504,
"preview": "(displayln \"\\nRunning 2-hop rhobtb2 query with drug safety constraint:\")\n(define q3 (time (query/graph\n "
},
{
"path": "contrib/medikanren/pieces-parts/example-2-hop-rhobtb2.rkt",
"chars": 12485,
"preview": "(displayln \"\\nRunning 2-hop rhobtb2 query with concept categories:\")\n(define q (time (query/graph\n ((X "
},
{
"path": "contrib/medikanren/pieces-parts/example-2-hop-tmprss2.rkt",
"chars": 228439,
"preview": "(displayln \"\\nRunning 2-hop tmprss2 down-up query with concept categories:\")\n(define q1 (time (query/graph\n "
},
{
"path": "contrib/medikanren/pieces-parts/example-ontology.rkt",
"chars": 16743,
"preview": ";; Expected outputs are block-commented after each expression.\n\n;; find ancestors of \"substance with phytoestrogen role\""
},
{
"path": "contrib/medikanren/pieces-parts/example-synonymize.rkt",
"chars": 2890,
"preview": ";; Find CURIE synonyms (and their descriptive names, for convenience) for the\n;; given CURIE.\n\n\n;; celecoxib\n(curie-syno"
},
{
"path": "contrib/medikanren/pieces-parts/gene-budging.rkt",
"chars": 11808,
"preview": "#lang racket\n(provide (all-defined-out))\n(require \"../../../medikanren/pieces-parts/query.rkt\"\n racket/engine)\n"
},
{
"path": "contrib/medikanren/pieces-parts/lib.rkt",
"chars": 715,
"preview": "(define (filter-edges a-drug predicates)\n (define q\n (time\n (query/graph\n ((X a-drug)\n (O #f))\n "
},
{
"path": "contrib/medikanren/pieces-parts/make-map-fast.rkt",
"chars": 17964,
"preview": "#lang racket\n\n(require\n racket/date\n racket/runtime-path)\n\n#|\n\nGenerate tab-separed value (TSV) files describing the map"
},
{
"path": "contrib/medikanren/pieces-parts/make-map.rkt",
"chars": 1371,
"preview": "#lang racket\n(require\n \"../../../medikanren/repr.rkt\"\n \"../../../medikanren/pieces-parts/common.rkt\"\n )\n\n(define db ("
},
{
"path": "contrib/medikanren/pieces-parts/make-provenance-map-fast.rkt",
"chars": 2534,
"preview": "#lang racket\n\n(require\n racket/runtime-path)\n\n;; Creates a map of the provenance of the edges of a KG, using the \"provi"
},
{
"path": "contrib/medikanren/pieces-parts/new-query-lang/select.rkt",
"chars": 1391,
"preview": "#lang racket\n\n(require\n (only-in \"query.rkt\"\n query/graph edges/ranked)\n )\n\n(define-syntax query\n (syntax-p"
},
{
"path": "contrib/medikanren/pieces-parts/non_drug_filter.rkt",
"chars": 18936,
"preview": "#lang racket\n(require\n \"../../../medikanren/pieces-parts/query.rkt\")\n\n;; define a number of helper functions for the fu"
},
{
"path": "contrib/medikanren/pieces-parts/postquery.rkt",
"chars": 7790,
"preview": "#lang racket/base\n\n(provide (all-defined-out))\n(require \"../../../medikanren/pieces-parts/query.rkt\")\n(require racket/l"
},
{
"path": "contrib/medikanren/pieces-parts/pub-clustering.rkt",
"chars": 3463,
"preview": "#lang racket\n(require \"../../../medikanren/pieces-parts/query.rkt\")\n \n(define spike-covid19 \"UniProtKB:P"
},
{
"path": "contrib/medikanren/pieces-parts/rank-regulators-exe.rkt",
"chars": 6961,
"preview": "#lang racket\n(require \"rank-regulators.rkt\"\n \"rank-regulators-gene-lists.rkt\")\n#|\nPurpose: The purpose of this p"
},
{
"path": "contrib/medikanren/pieces-parts/rank-regulators-gene-lists.rkt",
"chars": 105514,
"preview": "#lang racket\n(provide ards-genes\n NGLY1-underexpressed\n NGLY1-overexpressed)\n\n(define ards-genes '(\"ENSE"
},
{
"path": "contrib/medikanren/pieces-parts/rank-regulators.rkt",
"chars": 21716,
"preview": "#lang racket\n(require \"../../../medikanren/pieces-parts/query.rkt\"\n \"rank-regulators-gene-lists.rkt\"\n ra"
},
{
"path": "contrib/medikanren/pieces-parts/rank-side-effects.rkt",
"chars": 3627,
"preview": "#lang racket\n(require\n \"../../../medikanren/pieces-parts/query.rkt\")\n\n#|\ntakes: a drug curie as a string (a-drug), a li"
},
{
"path": "contrib/medikanren/pieces-parts/synonymization_algorithm.rkt",
"chars": 312,
"preview": "#lang racket\n(provide HGNC-CURIE->synonymized-concepts\n curie-aliases curie-synonyms curie-synonyms-raw curie-sy"
},
{
"path": "contrib/medikanren/pieces-parts/test-propagator.rkt",
"chars": 1006,
"preview": "#lang racket\n(provide\n (all-from-out \"../../../medikanren/pieces-parts/common.rkt\")\n (all-from-out \"../../../medikanre"
},
{
"path": "contrib/medikanren/pieces-parts/trace-pathways-by-tissue-type.rkt",
"chars": 41494,
"preview": "#lang racket\n(require \"../../../medikanren/pieces-parts/query.rkt\")\n\n(define gene-list (list->set '(\"ENSEMBL:ENSG0000016"
},
{
"path": "contrib/medikanren/pieces-parts/trace-pathways-mjp.rkt",
"chars": 44377,
"preview": "#lang racket\n(require \"../../../medikanren/pieces-parts/query.rkt\")\n\n(define gene-list (list->set '(\"ENSEMBL:ENSG0000016"
},
{
"path": "contrib/medikanren/pieces-parts/trace-pathways.rkt",
"chars": 42384,
"preview": "#lang racket\n(require \"../../../medikanren/pieces-parts/query.rkt\")\n\n(define gene-list (list->set '(\"ENSEMBL:ENSG0000016"
},
{
"path": "contrib/medikanren/pieces-parts/tutorial.rkt",
"chars": 15788,
"preview": "#lang racket\n(require\n \"../../../medikanren/db.rkt\"\n \"../../../medikanren/pieces-parts/query.rkt\")\n\n#|\nThis line binds"
},
{
"path": "contrib/medikanren/query-graph.rkt",
"chars": 7388,
"preview": "#lang racket/base\n(provide\n ? help\n graph path\n C P T\n show hide count unmodify\n graph? path? C? P? T? show? hide? "
},
{
"path": "contrib/medikanren/simple-query.rkt",
"chars": 2878,
"preview": "#lang racket\n\n(provide\n (all-from-out \"../../medikanren/mk.rkt\")\n (all-from-out \"../../medikanren/db.rkt\")\n (all-from"
},
{
"path": "contrib/medikanren/test-web-server.rkt",
"chars": 2540,
"preview": "#lang racket\n(require net/http-client)\n\n(define (read/string s) (with-input-from-string s (lambda () (read))))\n(define ("
},
{
"path": "contrib/medikanren/use-cases/CHAMP1_RNA_seq.rkt",
"chars": 28118,
"preview": "#lang racket\n(require\n \"../../../medikanren/pieces-parts/query.rkt\"\n \"../pieces-parts/Thi-useful-functions.rkt\")\n\n;;;;"
},
{
"path": "contrib/medikanren/use-cases/PMI-20-10-Il1R1-case-reviews.rkt",
"chars": 9695,
"preview": "#lang racket\n\n;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;*****Application of mediKanren in case review*****;;;;;;;;;;;;;;;;;;;;;;"
},
{
"path": "contrib/medikanren2/README.md",
"chars": 74,
"preview": "# Synopsis\n\nContributions for medikanren version 2 go in this directory.\n\n"
},
{
"path": "contrib/medikanren2/Thi/CHAMP1-drug-repurpose-June-15-2021.rkt",
"chars": 14291,
"preview": "#lang racket\n\n(require \"../../../medikanren2/common.rkt\")\n(require \"../../../medikanren2/db/rtx2-20210204.rkt\")\n(require"
},
{
"path": "contrib/medikanren2/Thi/Hakon-DEG-list.rkt",
"chars": 29819,
"preview": "#lang racket\n\n(provide (all-defined-out))\n\n(provide Hakon-CHAMP1-RNA-up\n Hakon-CHAMP1-RNA-down)\n\n\n;; Here are th"
},
{
"path": "contrib/medikanren2/Thi/Hakon-DEG-syns.rkt",
"chars": 56654,
"preview": "#lang racket\n\n(provide (all-defined-out))\n\n(provide Hakon-CHAMP1-RNA-up-syns\n Hakon-CHAMP1-RNA-down-syns)\n\n(defi"
},
{
"path": "contrib/medikanren2/Thi/IL1R1-med2-translate-rtx2-only-June-15-2021.rkt",
"chars": 10138,
"preview": "#lang racket\n\n(require \"../../../medikanren2/common.rkt\")\n(require \"../../../medikanren2/db/rtx2-20210204.rkt\")\n(require"
},
{
"path": "contrib/medikanren2/Thi/IL1R1-med2-translate.rkt",
"chars": 8597,
"preview": "#lang racket\n\n(require \"../../../medikanren2/common.rkt\")\n(require \"../../../medikanren2/db/rtx2-20210204.rkt\")\n\n\n; Goal"
},
{
"path": "contrib/medikanren2/Thi/PMI-21-34-NEXMIF-2hop.rkt",
"chars": 3536,
"preview": "#lang racket\n\n(require \"../../../medikanren2/common.rkt\")\n(require \"../../../medikanren2/db/rtx2-20210204.rkt\")\n(require"
},
{
"path": "contrib/medikanren2/Thi/SLC16A11-explore.rkt",
"chars": 3091,
"preview": "#lang racket\n\n(require \"../../../medikanren2/common.rkt\")\n; only load rtx2 data in config.scm\n\n(define hispanic \"UMLS:C0"
},
{
"path": "contrib/medikanren2/Thi/build-kgx-synonym.rkt",
"chars": 964,
"preview": "#lang racket/base\n(require \"../../../medikanren2/dbk/dbk/io.rkt\"\n \"../../../medikanren2/dbk/dbk/data.rkt\"\n "
},
{
"path": "contrib/medikanren2/Thi/build-rtx-kg2.rkt",
"chars": 1804,
"preview": "#lang racket/base\n(require\n \"../../../medikanren2/dbk/dbk/io.rkt\"\n \"../../../medikanren2/dbk/dbk/data.rkt\"\n \"../../.."
},
{
"path": "contrib/medikanren2/Thi/example-one-hop-IL1R1-drugs.rkt",
"chars": 6179,
"preview": "#lang racket/base\n(require\n \"query-low-level.rkt\"\n racket/pretty)\n\n(define drug-categories '(\"biolink:ChemicalSubstanc"
},
{
"path": "contrib/medikanren2/Thi/example-one-hop-ORPHANET-ICD-9-10.rkt",
"chars": 908,
"preview": "#lang racket/base\n(require\n \"query-low-level.rkt\"\n racket/pretty)\n\n(define close-match-preds '(\"biolink:close_match\"))"
},
{
"path": "contrib/medikanren2/Thi/example-one-hop-UniProt-cause-OMIM.rkt",
"chars": 231261,
"preview": "#lang racket/base\n(require\n \"query-low-level.rkt\"\n racket/pretty)\n\n(define disease-categories '(\"biolink:Disease\"\n "
}
]
// ... and 332 more files (download for full content)
About this extraction
This page contains the full source code of the webyrd/mediKanren GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 532 files (41.0 MB), approximately 4.2M tokens, and a symbol index with 4 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.