From 858dc8280a981bacaf526c613e05a843c2c70531 Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Fri, 23 Sep 2022 17:38:33 -0400 Subject: [PATCH 01/13] Added edges from two ARAX queries to see if we can enhance them. These are the two queries from https://github.com/ExposuresProvider/cam-kp-api/issues/536#issuecomment-1189445682 --- .../enhance-edge-tests/edges_44679.tsv | 127 ++++++ .../enhance-edge-tests/edges_52713.tsv | 367 ++++++++++++++++++ 2 files changed, 494 insertions(+) create mode 100644 src/it/resources/enhance-edge-tests/edges_44679.tsv create mode 100644 src/it/resources/enhance-edge-tests/edges_52713.tsv diff --git a/src/it/resources/enhance-edge-tests/edges_44679.tsv b/src/it/resources/enhance-edge-tests/edges_44679.tsv new file mode 100644 index 00000000..91237053 --- /dev/null +++ b/src/it/resources/enhance-edge-tests/edges_44679.tsv @@ -0,0 +1,127 @@ +MONDO:0009061 biolink:has_normalized_google_distance_with CHEMBL.COMPOUND:CHEMBL2010601 +CHEBI:17685 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEBI:22563 biolink:has_normalized_google_distance_with UniProtKB:P13569 +CHEBI:26369 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEBI:35660 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEBI:35703 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL1064 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL1072 biolink:has_normalized_google_distance_with UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL1078442 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL1079119 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL108 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL1081779 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL1109 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL1161632 biolink:has_normalized_google_distance_with UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL1188 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL1200492 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL1201391 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL1201486 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL1230989 biolink:has_normalized_google_distance_with UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL1237210 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL1272 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL1298 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL1344 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL1371 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL1389133 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL1400945 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL145403 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL1471 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL1487 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL1503 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL157101 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL1573 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL1623871 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL163 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL1631217 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL17157 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL1717 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL1735 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL1741 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL1771 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL177991 biolink:has_normalized_google_distance_with UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL193 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL2010601 biolink:has_normalized_google_distance_with UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL2074876 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL2074878 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL2103760 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL2103870 biolink:has_normalized_google_distance_with UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL2107465 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL2108102 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL2108184 biolink:has_normalized_google_distance_with UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL223228 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL256997 biolink:has_normalized_google_distance_with UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL269732 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL283196 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL296035 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL296480 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL316966 biolink:has_normalized_google_distance_with UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL3527071 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL3544914 biolink:has_normalized_google_distance_with UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL374478 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL405845 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL4101487 biolink:has_normalized_google_distance_with UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL4297849 biolink:has_normalized_google_distance_with UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL4298128 biolink:has_normalized_google_distance_with UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL472 biolink:has_normalized_google_distance_with UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL497411 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL52440 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL532 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL564085 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL584 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL638 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL646 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL655 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL661 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL814 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL861 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.TARGET:CHEMBL2364702 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.TARGET:CHEMBL340 biolink:has_normalized_google_distance_with UniProtKB:P08684 +CHEMBL.TARGET:CHEMBL348 biolink:has_normalized_google_distance_with UniProtKB:P13569 +DRUGBANK:DB14547 biolink:has_normalized_google_distance_with UniProtKB:P13569 +MESH:C117725 biolink:has_normalized_google_distance_with UniProtKB:P08684 +MESH:D001571 biolink:has_normalized_google_distance_with UniProtKB:P08684 +MESH:D005091 biolink:has_normalized_google_distance_with UniProtKB:P13569 +MESH:D006915 biolink:has_normalized_google_distance_with UniProtKB:P08684 +MESH:D007438 biolink:has_normalized_google_distance_with UniProtKB:P13569 +MESH:D014362 biolink:has_normalized_google_distance_with UniProtKB:P13569 +MESH:D014453 biolink:has_normalized_google_distance_with UniProtKB:P08684 +UMLS:C0360363 biolink:has_normalized_google_distance_with UniProtKB:P08684 +UMLS:C4744447 biolink:has_normalized_google_distance_with UniProtKB:P08684 +UniProtKB:O75795 biolink:has_normalized_google_distance_with UniProtKB:P08684 +UniProtKB:P07900 biolink:has_normalized_google_distance_with UniProtKB:P13569 +UniProtKB:P16662 biolink:has_normalized_google_distance_with UniProtKB:P08684 +UniProtKB:P19224 biolink:has_normalized_google_distance_with UniProtKB:P08684 +UniProtKB:P22310 biolink:has_normalized_google_distance_with UniProtKB:P08684 +UniProtKB:P24462 biolink:has_normalized_google_distance_with UniProtKB:P08684 +UniProtKB:P51589 biolink:has_normalized_google_distance_with UniProtKB:P08684 +UniProtKB:P54855 biolink:has_normalized_google_distance_with UniProtKB:P08684 +UniProtKB:Q9HB55 biolink:has_normalized_google_distance_with UniProtKB:P08684 +UniProtKB:Q9HBW0 biolink:has_normalized_google_distance_with UniProtKB:P13569 +UniProtKB:Q9NPD5 biolink:has_normalized_google_distance_with UniProtKB:P08684 +VANDF:4021891 biolink:has_normalized_google_distance_with UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL2010601 biolink:activity_increased_by UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL2010601 biolink:affects UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL2010601 biolink:affects_activity_of UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL2010601 biolink:correlated_with UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL2010601 biolink:correlated_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL2010601 biolink:entity_negatively_regulates_entity UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL2010601 biolink:entity_positively_regulates_entity UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL2010601 biolink:entity_positively_regulates_entity UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL2010601 biolink:increases_activity_of UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL2010601 biolink:increases_transport_of UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL2010601 biolink:increases_transport_of UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL2010601 biolink:interacts_with UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL2010601 biolink:molecularly_interacts_with UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL2010601 biolink:molecularly_interacts_with UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL2010601 biolink:physically_interacts_with UniProtKB:P13569 +MONDO:0009061 biolink:has_real_world_evidence_of_association_with CHEMBL.COMPOUND:CHEMBL2010601 +CHEMBL.COMPOUND:CHEMBL2010601 biolink:decreases_activity_of UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL2010601 biolink:decreases_activity_of UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL2010601 biolink:increases_activity_of UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL2010601 biolink:increases_activity_of UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL2010601 biolink:affects UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL2010601 biolink:entity_positively_regulates_entity UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL2010601 biolink:increases_activity_of UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL2010601 biolink:related_to UniProtKB:P08684 +CHEMBL.COMPOUND:CHEMBL2010601 biolink:related_to UniProtKB:P13569 +CHEMBL.COMPOUND:CHEMBL2010601 biolink:molecularly_interacts_with UniProtKB:P13569 diff --git a/src/it/resources/enhance-edge-tests/edges_52713.tsv b/src/it/resources/enhance-edge-tests/edges_52713.tsv new file mode 100644 index 00000000..60ec044c --- /dev/null +++ b/src/it/resources/enhance-edge-tests/edges_52713.tsv @@ -0,0 +1,367 @@ +UniProtKB:P56856 biolink:has_fisher_exact_test_p_value_with CHEMBL.COMPOUND:CHEMBL1201129 +UniProtKB:P82251 biolink:has_fisher_exact_test_p_value_with CHEMBL.COMPOUND:CHEMBL3559671 +CHEMBL.TARGET:CHEMBL1926496 biolink:has_fisher_exact_test_p_value_with CHEMBL.COMPOUND:CHEMBL3559671 +UniProtKB:Q9NZQ3 biolink:has_fisher_exact_test_p_value_with CHEMBL.COMPOUND:CHEMBL742 +CHEMBL.TARGET:CHEMBL5332 biolink:has_fisher_exact_test_p_value_with CHEMBL.COMPOUND:CHEMBL71595 +CHEMBL.TARGET:CHEMBL4884 biolink:has_fisher_exact_test_p_value_with CHEMBL.COMPOUND:CHEMBL71595 +CHEMBL.TARGET:CHEMBL1926496 biolink:has_fisher_exact_test_p_value_with CHEMBL.COMPOUND:CHEMBL71595 +UniProtKB:Q16651 biolink:has_fisher_exact_test_p_value_with CHEMBL.COMPOUND:CHEMBL71595 +UniProtKB:Q16651 biolink:has_fisher_exact_test_p_value_with CHEMBL.COMPOUND:CHEMBL521 +UniProtKB:P82251 biolink:has_fisher_exact_test_p_value_with CHEMBL.COMPOUND:CHEMBL1222152 +CHEMBL.TARGET:CHEMBL5332 biolink:has_fisher_exact_test_p_value_with CHEMBL.COMPOUND:CHEMBL53463 +UniProtKB:Q07837 biolink:has_fisher_exact_test_p_value_with CHEMBL.COMPOUND:CHEMBL1201129 +CHEMBL.TARGET:CHEMBL4884 biolink:has_fisher_exact_test_p_value_with CHEMBL.COMPOUND:CHEMBL53463 +UniProtKB:Q16651 biolink:has_fisher_exact_test_p_value_with CHEMBL.COMPOUND:CHEMBL1201129 +MESH:D048308 biolink:has_fisher_exact_test_p_value_with CHEMBL.COMPOUND:CHEMBL539 +UniProtKB:P56856 biolink:has_fisher_exact_test_p_value_with CHEMBL.COMPOUND:CHEMBL539 +UniProtKB:P82251 biolink:has_fisher_exact_test_p_value_with CHEMBL.COMPOUND:CHEMBL539 +UniProtKB:P56856 biolink:has_fisher_exact_test_p_value_with CHEMBL.COMPOUND:CHEMBL3559671 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_fisher_exact_test_p_value_with MONDO:0043875 +CHEMBL.COMPOUND:CHEMBL742 biolink:has_fisher_exact_test_p_value_with MONDO:0001208 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_fisher_exact_test_p_value_with MONDO:0005970 +CHEMBL.COMPOUND:CHEMBL742 biolink:has_fisher_exact_test_p_value_with MONDO:0005970 +CHEMBL.COMPOUND:CHEMBL539 biolink:has_fisher_exact_test_p_value_with MONDO:0004795 +CHEMBL.COMPOUND:CHEMBL71595 biolink:has_fisher_exact_test_p_value_with MONDO:0004795 +CHEMBL.COMPOUND:CHEMBL539 biolink:has_fisher_exact_test_p_value_with MONDO:0021666 +CHEMBL.COMPOUND:CHEMBL71595 biolink:has_fisher_exact_test_p_value_with MONDO:0021666 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_fisher_exact_test_p_value_with MONDO:0001853 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_fisher_exact_test_p_value_with MONDO:0005229 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_fisher_exact_test_p_value_with MONDO:0005229 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_fisher_exact_test_p_value_with MONDO:0043875 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_fisher_exact_test_p_value_with MONDO:0003127 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_fisher_exact_test_p_value_with MONDO:0003127 +CHEMBL.COMPOUND:CHEMBL71595 biolink:has_fisher_exact_test_p_value_with MONDO:0001639 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_fisher_exact_test_p_value_with MONDO:0001639 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_fisher_exact_test_p_value_with MESH:D012769 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_fisher_exact_test_p_value_with MESH:D012769 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_fisher_exact_test_p_value_with OMIM:MTHU050767 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_fisher_exact_test_p_value_with OMIM:MTHU050767 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_fisher_exact_test_p_value_with MONDO:0001475 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_fisher_exact_test_p_value_with OMIM:MTHU016228 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_fisher_exact_test_p_value_with OMIM:MTHU016228 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_fisher_exact_test_p_value_with OMIM:MTHU016228 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_fisher_exact_test_p_value_with MESH:D012770 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_fisher_exact_test_p_value_with MESH:D012770 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_fisher_exact_test_p_value_with UMLS:C0340753 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_fisher_exact_test_p_value_with UMLS:C0340753 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_fisher_exact_test_p_value_with MONDO:0001475 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_fisher_exact_test_p_value_with OMIM:MTHU037331 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_fisher_exact_test_p_value_with OMIM:MTHU037331 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_fisher_exact_test_p_value_with UMLS:C0546817 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_fisher_exact_test_p_value_with UMLS:C0546817 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_fisher_exact_test_p_value_with OMIM:MTHU037872 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_fisher_exact_test_p_value_with OMIM:MTHU054076 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_fisher_exact_test_p_value_with OMIM:MTHU054076 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_fisher_exact_test_p_value_with MONDO:0001475 +CHEMBL.COMPOUND:CHEMBL71595 biolink:has_fisher_exact_test_p_value_with UMLS:C0021092 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_fisher_exact_test_p_value_with OMIM:MTHU042079 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_fisher_exact_test_p_value_with OMIM:MTHU042079 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_fisher_exact_test_p_value_with UMLS:C0425251 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_fisher_exact_test_p_value_with UMLS:C0425251 +CHEMBL.COMPOUND:CHEMBL539 biolink:has_fisher_exact_test_p_value_with MESH:D004433 +CHEMBL.COMPOUND:CHEMBL71595 biolink:has_fisher_exact_test_p_value_with MESH:D004433 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_fisher_exact_test_p_value_with UMLS:C0398353 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_fisher_exact_test_p_value_with UMLS:C1384485 +CHEMBL.COMPOUND:CHEMBL521 biolink:has_fisher_exact_test_p_value_with UMLS:C1384485 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_fisher_exact_test_p_value_with UBERON:0000175 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_fisher_exact_test_p_value_with UBERON:0000175 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_fisher_exact_test_p_value_with UBERON:0000175 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_fisher_exact_test_p_value_with UMLS:C2364164 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_fisher_exact_test_p_value_with UMLS:C2364164 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_fisher_exact_test_p_value_with UMLS:C1704431 +CHEMBL.COMPOUND:CHEMBL71595 biolink:has_fisher_exact_test_p_value_with UMLS:C1704431 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_fisher_exact_test_p_value_with UMLS:C1704431 +CHEMBL.COMPOUND:CHEMBL742 biolink:has_fisher_exact_test_p_value_with UMLS:C0398353 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_fisher_exact_test_p_value_with UMLS:C1704431 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_fisher_exact_test_p_value_with UMLS:C1292123 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_fisher_exact_test_p_value_with UMLS:C1292123 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_fisher_exact_test_p_value_with OMIM:MTHU025803 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_fisher_exact_test_p_value_with OMIM:MTHU025803 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_fisher_exact_test_p_value_with MONDO:0001208 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_fisher_exact_test_p_value_with MONDO:0001208 +UBERON:0002048 biolink:has_normalized_google_distance_with UniProtKB:Q16651 +UBERON:0002107 biolink:has_normalized_google_distance_with UniProtKB:P82251 +UBERON:0002108 biolink:has_normalized_google_distance_with UniProtKB:Q07837 +UBERON:0000955 biolink:has_normalized_google_distance_with CHEMBL.TARGET:CHEMBL4884 +UBERON:0002107 biolink:has_normalized_google_distance_with CHEMBL.TARGET:CHEMBL4884 +UBERON:0002107 biolink:has_normalized_google_distance_with UniProtKB:Q16651 +UBERON:0000955 biolink:has_normalized_google_distance_with CHEMBL.TARGET:CHEMBL1926496 +UBERON:0002108 biolink:has_normalized_google_distance_with UniProtKB:P82251 +UBERON:0001264 biolink:has_normalized_google_distance_with CHEMBL.TARGET:CHEMBL1926496 +UBERON:0001264 biolink:has_normalized_google_distance_with UniProtKB:Q07837 +UBERON:0000948 biolink:has_normalized_google_distance_with CHEMBL.TARGET:CHEMBL1926496 +UBERON:0000948 biolink:has_normalized_google_distance_with MESH:D048308 +UBERON:0002113 biolink:has_normalized_google_distance_with UniProtKB:P82251 +UBERON:0001264 biolink:has_normalized_google_distance_with UniProtKB:Q16651 +UBERON:0001134 biolink:has_normalized_google_distance_with CHEMBL.TARGET:CHEMBL4884 +UBERON:0001134 biolink:has_normalized_google_distance_with MESH:D048308 +UBERON:0002048 biolink:has_normalized_google_distance_with CHEMBL.TARGET:CHEMBL5332 +UBERON:0002113 biolink:has_normalized_google_distance_with UniProtKB:Q9NZQ3 +UBERON:0002113 biolink:has_normalized_google_distance_with CHEMBL.TARGET:CHEMBL1926496 +UBERON:0002113 biolink:has_normalized_google_distance_with UniProtKB:Q07837 +UBERON:0001264 biolink:has_normalized_google_distance_with MESH:D048308 +UBERON:0001199 biolink:has_normalized_google_distance_with UniProtKB:P56856 +UBERON:0000948 biolink:has_normalized_google_distance_with UniProtKB:Q9NZQ3 +UBERON:0000948 biolink:has_normalized_google_distance_with CHEMBL.TARGET:CHEMBL5332 +UBERON:0002113 biolink:has_normalized_google_distance_with UniProtKB:Q16651 +UBERON:0002107 biolink:has_normalized_google_distance_with CHEMBL.TARGET:CHEMBL1926496 +UBERON:0002048 biolink:has_normalized_google_distance_with UniProtKB:P56856 +UBERON:0001134 biolink:has_normalized_google_distance_with UniProtKB:Q9NZQ3 +UBERON:0000955 biolink:has_normalized_google_distance_with UniProtKB:Q9NZQ3 +UBERON:0001134 biolink:has_normalized_google_distance_with CHEMBL.TARGET:CHEMBL5332 +UBERON:0002107 biolink:has_normalized_google_distance_with UniProtKB:Q9NZQ3 +UBERON:0000955 biolink:has_normalized_google_distance_with MESH:D048308 +UBERON:0000483 biolink:has_normalized_google_distance_with UniProtKB:P56856 +UBERON:0002048 biolink:has_normalized_google_distance_with CHEMBL.TARGET:CHEMBL1926496 +UBERON:0002113 biolink:has_normalized_google_distance_with CHEMBL.TARGET:CHEMBL5332 +UBERON:0002108 biolink:has_normalized_google_distance_with CHEMBL.TARGET:CHEMBL1926496 +UniProtKB:P82251 biolink:has_normalized_google_distance_with CHEMBL.COMPOUND:CHEMBL539 +UniProtKB:P82251 biolink:has_normalized_google_distance_with CHEMBL.COMPOUND:CHEMBL1222152 +UniProtKB:P56856 biolink:has_normalized_google_distance_with CHEMBL.COMPOUND:CHEMBL1201129 +CHEMBL.TARGET:CHEMBL5332 biolink:has_normalized_google_distance_with CHEMBL.COMPOUND:CHEMBL53463 +UniProtKB:Q16651 biolink:has_normalized_google_distance_with CHEMBL.COMPOUND:CHEMBL71595 +CHEMBL.TARGET:CHEMBL4884 biolink:has_normalized_google_distance_with CHEMBL.COMPOUND:CHEMBL53463 +UniProtKB:Q9NZQ3 biolink:has_normalized_google_distance_with CHEMBL.COMPOUND:CHEMBL742 +CHEMBL.TARGET:CHEMBL1926496 biolink:has_normalized_google_distance_with CHEMBL.COMPOUND:CHEMBL3559671 +UniProtKB:Q16651 biolink:has_normalized_google_distance_with CHEMBL.COMPOUND:CHEMBL1201129 +UniProtKB:P56856 biolink:has_normalized_google_distance_with CHEMBL.COMPOUND:CHEMBL539 +UniProtKB:P82251 biolink:has_normalized_google_distance_with CHEMBL.COMPOUND:CHEMBL3559671 +UniProtKB:P56856 biolink:has_normalized_google_distance_with CHEMBL.COMPOUND:CHEMBL3559671 +CHEMBL.TARGET:CHEMBL5332 biolink:has_normalized_google_distance_with CHEMBL.COMPOUND:CHEMBL71595 +UniProtKB:Q07837 biolink:has_normalized_google_distance_with CHEMBL.COMPOUND:CHEMBL1201129 +UniProtKB:Q16651 biolink:has_normalized_google_distance_with CHEMBL.COMPOUND:CHEMBL521 +CHEMBL.TARGET:CHEMBL4884 biolink:has_normalized_google_distance_with CHEMBL.COMPOUND:CHEMBL71595 +CHEMBL.TARGET:CHEMBL1926496 biolink:has_normalized_google_distance_with CHEMBL.COMPOUND:CHEMBL71595 +MESH:D048308 biolink:has_normalized_google_distance_with CHEMBL.COMPOUND:CHEMBL539 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_normalized_google_distance_with MONDO:0005229 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_normalized_google_distance_with UMLS:C0340753 +CHEMBL.COMPOUND:CHEMBL742 biolink:has_normalized_google_distance_with MONDO:0005970 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_normalized_google_distance_with UMLS:C0546817 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_normalized_google_distance_with OMIM:MTHU037872 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_normalized_google_distance_with UMLS:C0425251 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_normalized_google_distance_with MONDO:0001475 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_normalized_google_distance_with UMLS:C1704431 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_normalized_google_distance_with OMIM:MTHU016228 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_normalized_google_distance_with OMIM:MTHU016228 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_normalized_google_distance_with OMIM:MTHU042079 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_normalized_google_distance_with MESH:D012770 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_normalized_google_distance_with UMLS:C2364164 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_normalized_google_distance_with MESH:D012770 +CHEMBL.COMPOUND:CHEMBL742 biolink:has_normalized_google_distance_with UMLS:C0398353 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_normalized_google_distance_with UMLS:C0546817 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_normalized_google_distance_with MONDO:0001853 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_normalized_google_distance_with OMIM:MTHU050767 +CHEMBL.COMPOUND:CHEMBL742 biolink:has_normalized_google_distance_with MONDO:0001208 +CHEMBL.COMPOUND:CHEMBL71595 biolink:has_normalized_google_distance_with MESH:D004433 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_normalized_google_distance_with UMLS:C0340753 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_normalized_google_distance_with OMIM:MTHU054076 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_normalized_google_distance_with MONDO:0001208 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_normalized_google_distance_with OMIM:MTHU025803 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_normalized_google_distance_with MONDO:0005229 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_normalized_google_distance_with OMIM:MTHU037331 +CHEMBL.COMPOUND:CHEMBL71595 biolink:has_normalized_google_distance_with MONDO:0021666 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_normalized_google_distance_with UMLS:C0425251 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_normalized_google_distance_with UMLS:C1704431 +CHEMBL.COMPOUND:CHEMBL71595 biolink:has_normalized_google_distance_with MONDO:0004795 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_normalized_google_distance_with UMLS:C2364164 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_normalized_google_distance_with OMIM:MTHU042079 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_normalized_google_distance_with OMIM:MTHU016228 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_normalized_google_distance_with MONDO:0001639 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_normalized_google_distance_with UMLS:C1384485 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_normalized_google_distance_with MONDO:0001208 +CHEMBL.COMPOUND:CHEMBL71595 biolink:has_normalized_google_distance_with UMLS:C0021092 +CHEMBL.COMPOUND:CHEMBL71595 biolink:has_normalized_google_distance_with UMLS:C1704431 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_normalized_google_distance_with MONDO:0043875 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_normalized_google_distance_with MONDO:0003127 +CHEMBL.COMPOUND:CHEMBL539 biolink:has_normalized_google_distance_with MONDO:0004795 +CHEMBL.COMPOUND:CHEMBL539 biolink:has_normalized_google_distance_with MONDO:0021666 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_normalized_google_distance_with UMLS:C0398353 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_normalized_google_distance_with MONDO:0005970 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_normalized_google_distance_with MONDO:0003127 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_normalized_google_distance_with MESH:D012769 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_normalized_google_distance_with MONDO:0001475 +CHEMBL.COMPOUND:CHEMBL539 biolink:has_normalized_google_distance_with MESH:D004433 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_normalized_google_distance_with UBERON:0000175 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_normalized_google_distance_with UMLS:C1292123 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_normalized_google_distance_with UBERON:0000175 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_normalized_google_distance_with MONDO:0043875 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_normalized_google_distance_with UMLS:C1704431 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_normalized_google_distance_with OMIM:MTHU050767 +CHEMBL.COMPOUND:CHEMBL71595 biolink:has_normalized_google_distance_with MONDO:0001639 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_normalized_google_distance_with MESH:D012769 +CHEMBL.COMPOUND:CHEMBL521 biolink:has_normalized_google_distance_with UMLS:C1384485 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_normalized_google_distance_with UMLS:C1292123 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_normalized_google_distance_with UBERON:0000175 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_normalized_google_distance_with OMIM:MTHU037331 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_normalized_google_distance_with OMIM:MTHU025803 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_normalized_google_distance_with MONDO:0001475 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_normalized_google_distance_with OMIM:MTHU054076 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with MONDO:0001475 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with OMIM:MTHU054076 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with MONDO:0001208 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with OMIM:MTHU050767 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with UMLS:C0546817 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with UMLS:C0340753 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with MESH:D012770 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with MESH:D012769 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with OMIM:MTHU037331 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with MONDO:0001853 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with MONDO:0005970 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with MONDO:0043875 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with UMLS:C0398353 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with UMLS:C0425251 +CHEMBL.COMPOUND:CHEMBL539 biolink:entity_positively_regulates_entity UniProtKB:P56856 +CHEMBL.COMPOUND:CHEMBL539 biolink:entity_negatively_regulates_entity MESH:D048308 +CHEMBL.COMPOUND:CHEMBL539 biolink:entity_positively_regulates_entity UniProtKB:P82251 +CHEMBL.COMPOUND:CHEMBL539 biolink:has_real_world_evidence_of_association_with MESH:D004433 +CHEMBL.COMPOUND:CHEMBL539 biolink:has_real_world_evidence_of_association_with MONDO:0004795 +CHEMBL.COMPOUND:CHEMBL539 biolink:has_real_world_evidence_of_association_with MONDO:0021666 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_real_world_evidence_of_association_with OMIM:MTHU054076 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_real_world_evidence_of_association_with MONDO:0001208 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_real_world_evidence_of_association_with OMIM:MTHU050767 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_real_world_evidence_of_association_with UMLS:C0546817 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_real_world_evidence_of_association_with UMLS:C0340753 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_real_world_evidence_of_association_with MESH:D012770 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_real_world_evidence_of_association_with MESH:D012769 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_real_world_evidence_of_association_with OMIM:MTHU037331 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_real_world_evidence_of_association_with UMLS:C0425251 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:has_real_world_evidence_of_association_with UMLS:C1384485 +CHEMBL.COMPOUND:CHEMBL53463 biolink:entity_negatively_regulates_entity CHEMBL.TARGET:CHEMBL5332 +CHEMBL.COMPOUND:CHEMBL53463 biolink:entity_positively_regulates_entity CHEMBL.TARGET:CHEMBL4884 +CHEMBL.COMPOUND:CHEMBL53463 biolink:entity_positively_regulates_entity CHEMBL.TARGET:CHEMBL5332 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_real_world_evidence_of_association_with MONDO:0001475 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_real_world_evidence_of_association_with OMIM:MTHU016228 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_real_world_evidence_of_association_with MONDO:0043875 +CHEMBL.COMPOUND:CHEMBL521 biolink:entity_negatively_regulates_entity UniProtKB:Q16651 +CHEMBL.COMPOUND:CHEMBL521 biolink:entity_positively_regulates_entity UniProtKB:Q16651 +CHEMBL.COMPOUND:CHEMBL521 biolink:has_real_world_evidence_of_association_with UMLS:C1384485 +CHEMBL.COMPOUND:CHEMBL742 biolink:entity_negatively_regulates_entity UniProtKB:Q9NZQ3 +CHEMBL.COMPOUND:CHEMBL742 biolink:entity_positively_regulates_entity UniProtKB:Q9NZQ3 +CHEMBL.COMPOUND:CHEMBL742 biolink:has_real_world_evidence_of_association_with MONDO:0001208 +CHEMBL.COMPOUND:CHEMBL742 biolink:has_real_world_evidence_of_association_with MONDO:0001208 +CHEMBL.COMPOUND:CHEMBL742 biolink:has_real_world_evidence_of_association_with MONDO:0001208 +CHEMBL.COMPOUND:CHEMBL742 biolink:has_real_world_evidence_of_association_with MONDO:0005970 +CHEMBL.COMPOUND:CHEMBL742 biolink:has_real_world_evidence_of_association_with UMLS:C0398353 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_real_world_evidence_of_association_with OMIM:MTHU016228 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_real_world_evidence_of_association_with UBERON:0000175 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_real_world_evidence_of_association_with UMLS:C1704431 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_real_world_evidence_of_association_with OMIM:MTHU025803 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_real_world_evidence_of_association_with MONDO:0003127 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_real_world_evidence_of_association_with UMLS:C1292123 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:entity_negatively_regulates_entity UniProtKB:P56856 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:entity_negatively_regulates_entity UniProtKB:Q16651 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:entity_positively_regulates_entity UniProtKB:P56856 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:entity_positively_regulates_entity UniProtKB:Q16651 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:entity_positively_regulates_entity UniProtKB:Q07837 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_real_world_evidence_of_association_with MONDO:0001475 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_real_world_evidence_of_association_with OMIM:MTHU016228 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_real_world_evidence_of_association_with UBERON:0000175 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_real_world_evidence_of_association_with OMIM:MTHU042079 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_real_world_evidence_of_association_with UMLS:C1704431 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_real_world_evidence_of_association_with UMLS:C2364164 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_real_world_evidence_of_association_with OMIM:MTHU025803 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_real_world_evidence_of_association_with MONDO:0005229 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_real_world_evidence_of_association_with MONDO:0001475 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_real_world_evidence_of_association_with MONDO:0003127 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_real_world_evidence_of_association_with UMLS:C1292123 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:entity_negatively_regulates_entity UniProtKB:P82251 +CHEMBL.COMPOUND:CHEMBL1222152 biolink:entity_positively_regulates_entity UniProtKB:P82251 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:entity_negatively_regulates_entity UniProtKB:P82251 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:entity_negatively_regulates_entity UniProtKB:P56856 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:entity_negatively_regulates_entity CHEMBL.TARGET:CHEMBL1926496 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:entity_positively_regulates_entity UniProtKB:P56856 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:entity_positively_regulates_entity CHEMBL.TARGET:CHEMBL1926496 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with OMIM:MTHU016228 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with MONDO:0001208 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with UBERON:0000175 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with OMIM:MTHU042079 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with OMIM:MTHU037872 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with UMLS:C1704431 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with OMIM:MTHU050767 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with UMLS:C2364164 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with MESH:D012769 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with MONDO:0005229 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with MONDO:0001208 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with MONDO:0005229 +CHEMBL.COMPOUND:CHEMBL71595 biolink:entity_positively_regulates_entity UniProtKB:Q16651 +CHEMBL.COMPOUND:CHEMBL71595 biolink:entity_positively_regulates_entity CHEMBL.TARGET:CHEMBL4884 +CHEMBL.COMPOUND:CHEMBL71595 biolink:entity_positively_regulates_entity CHEMBL.TARGET:CHEMBL5332 +CHEMBL.COMPOUND:CHEMBL71595 biolink:entity_positively_regulates_entity CHEMBL.TARGET:CHEMBL1926496 +CHEMBL.COMPOUND:CHEMBL71595 biolink:has_real_world_evidence_of_association_with UMLS:C1704431 +CHEMBL.COMPOUND:CHEMBL71595 biolink:has_real_world_evidence_of_association_with MESH:D004433 +CHEMBL.COMPOUND:CHEMBL71595 biolink:has_real_world_evidence_of_association_with UMLS:C0021092 +CHEMBL.COMPOUND:CHEMBL71595 biolink:has_real_world_evidence_of_association_with MONDO:0001639 +CHEMBL.COMPOUND:CHEMBL71595 biolink:has_real_world_evidence_of_association_with MONDO:0004795 +CHEMBL.COMPOUND:CHEMBL71595 biolink:has_real_world_evidence_of_association_with MONDO:0021666 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_real_world_evidence_of_association_with MONDO:0001475 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_real_world_evidence_of_association_with OMIM:MTHU016228 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_real_world_evidence_of_association_with MONDO:0001475 +CHEMBL.COMPOUND:CHEMBL1201129 biolink:has_real_world_evidence_of_association_with MONDO:0003127 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with MONDO:0001639 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with MONDO:0001853 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_real_world_evidence_of_association_with UBERON:0000175 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_real_world_evidence_of_association_with MONDO:0003127 +CHEMBL.COMPOUND:CHEMBL521 biolink:has_real_world_evidence_of_association_with UMLS:C1384485 +CHEMBL.COMPOUND:CHEMBL53463 biolink:has_real_world_evidence_of_association_with MONDO:0043875 +CHEMBL.COMPOUND:CHEMBL539 biolink:has_real_world_evidence_of_association_with MONDO:0004795 +CHEMBL.COMPOUND:CHEMBL539 biolink:has_real_world_evidence_of_association_with MONDO:0021666 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with MONDO:0001208 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with UMLS:C1704431 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with UMLS:C2364164 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with MESH:D012769 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with MONDO:0005229 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with MONDO:0001208 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:has_real_world_evidence_of_association_with MONDO:0005229 +CHEMBL.COMPOUND:CHEMBL71595 biolink:has_real_world_evidence_of_association_with MESH:D004433 +CHEMBL.COMPOUND:CHEMBL71595 biolink:has_real_world_evidence_of_association_with UMLS:C0021092 +CHEMBL.COMPOUND:CHEMBL71595 biolink:has_real_world_evidence_of_association_with MONDO:0004795 +CHEMBL.COMPOUND:CHEMBL71595 biolink:has_real_world_evidence_of_association_with MONDO:0021666 +CHEMBL.COMPOUND:CHEMBL742 biolink:has_real_world_evidence_of_association_with MONDO:0001208 +CHEMBL.COMPOUND:CHEMBL742 biolink:has_real_world_evidence_of_association_with MONDO:0001208 +CHEMBL.COMPOUND:CHEMBL742 biolink:has_real_world_evidence_of_association_with MONDO:0005970 +CHEMBL.COMPOUND:CHEMBL742 biolink:has_real_world_evidence_of_association_with UMLS:C0398353 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:entity_negatively_regulates_entity CHEMBL.TARGET:CHEMBL1926496 +CHEMBL.COMPOUND:CHEMBL3559671 biolink:entity_positively_regulates_entity CHEMBL.TARGET:CHEMBL1926496 +CHEMBL.COMPOUND:CHEMBL521 biolink:entity_positively_regulates_entity UniProtKB:Q16651 +CHEMBL.COMPOUND:CHEMBL53463 biolink:entity_negatively_regulates_entity CHEMBL.TARGET:CHEMBL5332 +CHEMBL.COMPOUND:CHEMBL53463 biolink:entity_positively_regulates_entity CHEMBL.TARGET:CHEMBL4884 +CHEMBL.COMPOUND:CHEMBL53463 biolink:entity_positively_regulates_entity CHEMBL.TARGET:CHEMBL5332 +CHEMBL.COMPOUND:CHEMBL539 biolink:entity_negatively_regulates_entity MESH:D048308 +CHEMBL.COMPOUND:CHEMBL71595 biolink:entity_positively_regulates_entity CHEMBL.TARGET:CHEMBL4884 +CHEMBL.COMPOUND:CHEMBL71595 biolink:entity_positively_regulates_entity CHEMBL.TARGET:CHEMBL5332 +CHEMBL.TARGET:CHEMBL1926496 biolink:expressed_in UBERON:0000948 +CHEMBL.TARGET:CHEMBL1926496 biolink:expressed_in UBERON:0000955 +CHEMBL.TARGET:CHEMBL1926496 biolink:expressed_in UBERON:0001264 +CHEMBL.TARGET:CHEMBL1926496 biolink:expressed_in UBERON:0002048 +CHEMBL.TARGET:CHEMBL1926496 biolink:expressed_in UBERON:0002107 +CHEMBL.TARGET:CHEMBL1926496 biolink:expressed_in UBERON:0002108 +CHEMBL.TARGET:CHEMBL1926496 biolink:expressed_in UBERON:0002113 +CHEMBL.TARGET:CHEMBL4884 biolink:expressed_in UBERON:0000955 +CHEMBL.TARGET:CHEMBL4884 biolink:expressed_in UBERON:0001134 +CHEMBL.TARGET:CHEMBL4884 biolink:expressed_in UBERON:0002107 +CHEMBL.TARGET:CHEMBL5332 biolink:expressed_in UBERON:0000948 +CHEMBL.TARGET:CHEMBL5332 biolink:expressed_in UBERON:0001134 +CHEMBL.TARGET:CHEMBL5332 biolink:expressed_in UBERON:0002048 +CHEMBL.TARGET:CHEMBL5332 biolink:expressed_in UBERON:0002113 +MESH:D048308 biolink:expressed_in UBERON:0000948 +MESH:D048308 biolink:expressed_in UBERON:0000955 +MESH:D048308 biolink:expressed_in UBERON:0001134 +MESH:D048308 biolink:expressed_in UBERON:0001264 +UniProtKB:P56856 biolink:expressed_in UBERON:0000483 +UniProtKB:P56856 biolink:expressed_in UBERON:0001199 +UniProtKB:P56856 biolink:expressed_in UBERON:0002048 +UniProtKB:P82251 biolink:expressed_in UBERON:0002107 +UniProtKB:P82251 biolink:expressed_in UBERON:0002108 +UniProtKB:P82251 biolink:expressed_in UBERON:0002113 +UniProtKB:Q07837 biolink:expressed_in UBERON:0001264 +UniProtKB:Q07837 biolink:expressed_in UBERON:0002108 +UniProtKB:Q07837 biolink:expressed_in UBERON:0002113 +UniProtKB:Q16651 biolink:expressed_in UBERON:0001264 +UniProtKB:Q16651 biolink:expressed_in UBERON:0002048 +UniProtKB:Q16651 biolink:expressed_in UBERON:0002107 +UniProtKB:Q16651 biolink:expressed_in UBERON:0002113 +UniProtKB:Q9NZQ3 biolink:expressed_in UBERON:0000948 +UniProtKB:Q9NZQ3 biolink:expressed_in UBERON:0000955 +UniProtKB:Q9NZQ3 biolink:expressed_in UBERON:0001134 +UniProtKB:Q9NZQ3 biolink:expressed_in UBERON:0002107 +UniProtKB:Q9NZQ3 biolink:expressed_in UBERON:0002113 From fb3f18d746cfe5ea27024cd48f2b38c1012a11fc Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Thu, 29 Sep 2022 01:22:08 -0400 Subject: [PATCH 02/13] First stab at an EnhanceEdgesTest. --- .../org/renci/cam/it/EnhanceEdgesTest.scala | 203 ++++++++++++++++++ 1 file changed, 203 insertions(+) create mode 100644 src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala diff --git a/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala b/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala new file mode 100644 index 00000000..1c9a331b --- /dev/null +++ b/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala @@ -0,0 +1,203 @@ +package org.renci.cam.it + +import io.circe._ +import io.circe.generic.auto._ +import io.circe.generic.semiauto._ +import io.circe.syntax.EncoderOps +import org.http4s._ +import org.http4s.circe.jsonDecoder +import org.http4s.headers.{`Content-Type`, Accept} +import org.http4s.implicits._ +import org.renci.cam.Biolink.biolinkData +import org.renci.cam.HttpClient.HttpClient +import org.renci.cam.domain.{BiolinkClass, BiolinkPredicate, IRI, TRAPIAttribute, TRAPIMessage, TRAPIQuery, TRAPIQueryEdge, TRAPIQueryGraph, TRAPIQueryNode, TRAPIResponse} +import org.renci.cam.{AppConfig, Biolink, HttpClient, Implicits} +import zio.blocking.Blocking +import zio.config.ZConfig +import zio.config.typesafe.TypesafeConfig +import zio.interop.catz._ +import zio.test.Assertion._ +import zio.test._ +import zio.{Layer, Task, ZIO} + +import java.nio.file.{Path, Paths} +import scala.jdk.CollectionConverters._ + +object EnhanceEdgesTest extends DefaultRunnableSpec { + val exampleDir: Path = Paths.get("src/it/resources/enhance-edge-tests") + val exampleResultsDir: Path = Paths.get("src/it/resources/example-results") + + val endpointToTest: Uri = + sys.env.get("CAM_KP_ENDPOINT") match { + case None => uri"https://cam-kp-api.renci.org/1.3.0/query" + case Some(str) => Uri.fromString(str).toOption.get + } + + val limit: Int = sys.env.getOrElse("CAM_KP_LIMIT", 1000).toString.toInt + + def testEdge(subj: String, + pred: String, + obj: String): Spec[ZConfig[Biolink.BiolinkData] with HttpClient, TestFailure[Throwable], TestSuccess] = + testM(s"Testing ${subj} ${pred} ${obj}") { + for { + biolinkData <- biolinkData + httpClient <- HttpClient.client + + messageText = { + implicit val iriEncoder: Encoder[IRI] = Implicits.iriEncoder(biolinkData.prefixes) + implicit val iriKeyEncoder: KeyEncoder[IRI] = Implicits.iriKeyEncoder(biolinkData.prefixes) + implicit val biolinkClassEncoder: Encoder[BiolinkClass] = Implicits.biolinkClassEncoder + implicit val biolinkPredicateEncoder: Encoder[BiolinkPredicate] = + Implicits.biolinkPredicateEncoder(biolinkData.prefixes) + + val subjIRI = IRI(subj) + val objIRI = IRI(obj) + val queryGraph = TRAPIQueryGraph( + nodes = Map( + "n0" -> TRAPIQueryNode(ids = Some(List(subjIRI)), None, None, None), + "n1" -> TRAPIQueryNode(ids = Some(List(objIRI)), None, None, None) + ), + edges = Map( + "e0" -> TRAPIQueryEdge( + predicates = Some(List(BiolinkPredicate("related_to"))), + subject = "n0", + `object` = "n1" + )) + ) + val message = TRAPIMessage(Some(queryGraph), None, None) + + TRAPIQuery(message = message, log_level = None).asJson.deepDropNullValues.noSpaces + } + request = Request[Task](Method.POST, endpointToTest.withQueryParam("limit", limit.toString)) + .withHeaders(Accept(MediaType.application.json), `Content-Type`(MediaType.application.json)) + .withEntity(messageText) + response <- httpClient.expect[Json](request) + trapiResponse <- ZIO.fromEither( + { + implicit val decoderIRI: Decoder[IRI] = Implicits.iriDecoder(biolinkData.prefixes) + implicit val keyDecoderIRI: KeyDecoder[IRI] = Implicits.iriKeyDecoder(biolinkData.prefixes) + implicit val decoderBiolinkClass: Decoder[BiolinkClass] = Implicits.biolinkClassDecoder(biolinkData.classes) + implicit val decoderBiolinkPredicate: Decoder[BiolinkPredicate] = + Implicits.biolinkPredicateDecoder(biolinkData.predicates) + implicit lazy val decoderTRAPIAttribute: Decoder[TRAPIAttribute] = deriveDecoder[TRAPIAttribute] + + response.as[TRAPIResponse] + } + ) + results = trapiResponse.message.results + } yield assert(results)(Assertion.isSome(Assertion.isNonEmpty)) + } + + // Let's test one out. + val testOne = testEdge("UniProtKB:P56856", "biolink:has_fisher_exact_test_p_value_with", "CHEMBL.COMPOUND:CHEMBL1201129") + + /* + val testEachExampleFile: Spec[ZConfig[Biolink.BiolinkData] with HttpClient, TestFailure[Throwable], TestSuccess] = { + // List of example files to process. + val exampleFiles = Files + .walk(exampleDir) + .iterator() + .asScala + .filter(Files.isRegularFile(_)) + .filter(_.toString.toLowerCase.endsWith(".json")) + .toSeq + + suiteM("Test example files in the src/it/resources/examples directory") { + ZStream + .fromIterable(exampleFiles) + .map(exampleFile => + testM(s"Testing ${exampleDir.relativize(exampleFile)}") { + val exampleText = { + val source = Source.fromFile(exampleFile.toFile) + source.getLines().mkString("\n") + } + for { + httpClient <- HttpClient.client + biolinkData <- biolinkData + + // Read the example JSON file. + exampleJson <- ZIO.fromEither(io.circe.parser.parse(exampleText)) + example <- ZIO.fromEither( + { + implicit val decoderIRI: Decoder[IRI] = Implicits.iriDecoder(biolinkData.prefixes) + implicit val keyDecoderIRI: KeyDecoder[IRI] = Implicits.iriKeyDecoder(biolinkData.prefixes) + implicit val decoderBiolinkClass: Decoder[BiolinkClass] = Implicits.biolinkClassDecoder(biolinkData.classes) + implicit val decoderBiolinkPredicate: Decoder[BiolinkPredicate] = + Implicits.biolinkPredicateDecoder(biolinkData.predicates) + implicit lazy val decoderTRAPIAttribute: Decoder[TRAPIAttribute] = deriveDecoder[TRAPIAttribute] + + exampleJson.as[ExampleJsonFile] + } + ) + + descriptionOpt = example.description + limit = example.limit.getOrElse(0) + minExpectedResultsOpt = example.minExpectedResults + maxExpectedResultsOpt = example.maxExpectedResults + + // Prepare request for the CAM-KP-API endpoint. + messageText = { + implicit val iriEncoder: Encoder[IRI] = Implicits.iriEncoder(biolinkData.prefixes) + implicit val iriKeyEncoder: KeyEncoder[IRI] = Implicits.iriKeyEncoder(biolinkData.prefixes) + implicit val biolinkClassEncoder: Encoder[BiolinkClass] = Implicits.biolinkClassEncoder + implicit val biolinkPredicateEncoder: Encoder[BiolinkPredicate] = + Implicits.biolinkPredicateEncoder(biolinkData.prefixes) + + TRAPIQuery(message = example.message, log_level = None).asJson.deepDropNullValues.noSpaces + } + // _ = println(s"messageText = ${messageText}") + request = Request[Task](Method.POST, endpointToTest.withQueryParam("limit", limit.toString)) + .withHeaders(Accept(MediaType.application.json), `Content-Type`(MediaType.application.json)) + .withEntity(messageText) + response <- httpClient.expect[Json](request) + + // Write out the response in `src/it/resources/example-results` for debugging. + outputFilename = exampleResultsDir.resolve(exampleDir.relativize(exampleFile)) + _ = Files.createDirectories(outputFilename.getParent) + _ = Files.writeString(outputFilename, response.spaces2SortKeys) + + // Translate the response into a TRAPIResponse for testing. + trapiResponse <- ZIO.fromEither( + { + implicit val decoderIRI: Decoder[IRI] = Implicits.iriDecoder(biolinkData.prefixes) + implicit val keyDecoderIRI: KeyDecoder[IRI] = Implicits.iriKeyDecoder(biolinkData.prefixes) + implicit val decoderBiolinkClass: Decoder[BiolinkClass] = Implicits.biolinkClassDecoder(biolinkData.classes) + implicit val decoderBiolinkPredicate: Decoder[BiolinkPredicate] = + Implicits.biolinkPredicateDecoder(biolinkData.predicates) + implicit lazy val decoderTRAPIAttribute: Decoder[TRAPIAttribute] = deriveDecoder[TRAPIAttribute] + + response.as[TRAPIResponse] + } + ) + } yield assert(descriptionOpt)(isSome(isNonEmptyString)) && + assert(messageText)(isNonEmptyString) && + assert(trapiResponse.status)(isSome(equalTo("Success"))) && + // If a minExpectedResults is provided, make sure that the number of results is indeed greater than or equal to it. + (minExpectedResultsOpt match { + case None => assertCompletes + case Some(minExpectedResults) => + val resultCount = trapiResponse.message.results.getOrElse(List()).size + assert(resultCount)(isGreaterThanEqualTo(minExpectedResults)) + }) && + // If a maxExpectedResults is provided, make sure that the number of results is indeed less than or equal to it. + (maxExpectedResultsOpt match { + case None => assertCompletes + case Some(maxExpectedResults) => + val resultCount = trapiResponse.message.results.getOrElse(List()).size + assert(resultCount)(isLessThanEqualTo(maxExpectedResults)) + }) + }) + .runCollect + } + } + */ + + val configLayer: Layer[Throwable, ZConfig[AppConfig]] = TypesafeConfig.fromDefaultLoader(AppConfig.config) + val camkpapiLayer = Blocking.live >>> HttpClient.makeHttpClientLayer >+> Biolink.makeUtilitiesLayer + val testLayer = (configLayer ++ camkpapiLayer).mapError(TestFailure.die) + + def spec = suite("EnhanceEdgesTest")( + testOne + ).provideCustomLayer(testLayer) + +} From 364212dd44fa9a65e39eb92421c348c9ab83391f Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Fri, 30 Sep 2022 01:05:24 -0400 Subject: [PATCH 03/13] First stab at adding node normalization. --- .../org/renci/cam/it/EnhanceEdgesTest.scala | 111 +++++++++++++++++- 1 file changed, 108 insertions(+), 3 deletions(-) diff --git a/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala b/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala index 1c9a331b..3df295df 100644 --- a/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala +++ b/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala @@ -1,5 +1,6 @@ package org.renci.cam.it +import com.typesafe.scalalogging.LazyLogging import io.circe._ import io.circe.generic.auto._ import io.circe.generic.semiauto._ @@ -10,7 +11,7 @@ import org.http4s.headers.{`Content-Type`, Accept} import org.http4s.implicits._ import org.renci.cam.Biolink.biolinkData import org.renci.cam.HttpClient.HttpClient -import org.renci.cam.domain.{BiolinkClass, BiolinkPredicate, IRI, TRAPIAttribute, TRAPIMessage, TRAPIQuery, TRAPIQueryEdge, TRAPIQueryGraph, TRAPIQueryNode, TRAPIResponse} +import org.renci.cam.domain.{BiolinkClass, BiolinkPredicate, IRI, MetaKnowledgeGraph, TRAPIAttribute, TRAPIMessage, TRAPIQuery, TRAPIQueryEdge, TRAPIQueryGraph, TRAPIQueryNode, TRAPIResponse} import org.renci.cam.{AppConfig, Biolink, HttpClient, Implicits} import zio.blocking.Blocking import zio.config.ZConfig @@ -23,7 +24,7 @@ import zio.{Layer, Task, ZIO} import java.nio.file.{Path, Paths} import scala.jdk.CollectionConverters._ -object EnhanceEdgesTest extends DefaultRunnableSpec { +object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { val exampleDir: Path = Paths.get("src/it/resources/enhance-edge-tests") val exampleResultsDir: Path = Paths.get("src/it/resources/example-results") @@ -33,8 +34,107 @@ object EnhanceEdgesTest extends DefaultRunnableSpec { case Some(str) => Uri.fromString(str).toOption.get } + val endpointMetaKG: Uri = Uri.fromString(endpointToTest.toString.replaceFirst("/query$", "/meta_knowledge_graph")).toOption.get + + val endpointNodeNorm: Uri = + sys.env.get("NODE_NORM_ENDPOINT") match { + case None => uri"https://nodenormalization-sri.renci.org/1.3/get_normalized_nodes" + case Some(str) => Uri.fromString(str).toOption.get + } + val limit: Int = sys.env.getOrElse("CAM_KP_LIMIT", 1000).toString.toInt + val metaKG: MetaKnowledgeGraph = + zio.Runtime + .unsafeFromLayer(HttpClient.makeHttpClientLayer >+> Biolink.makeUtilitiesLayer) + .unsafeRun( + for { + httpClient <- HttpClient.client + biolinkData <- biolinkData + + request = Request[Task](Method.GET, endpointMetaKG) + .withHeaders(Accept(MediaType.application.json), `Content-Type`(MediaType.application.json)) + response <- httpClient.expect[Json](request) + metaKG <- ZIO.fromEither( + { + implicit val decoderIRI: Decoder[IRI] = Implicits.iriDecoder(biolinkData.prefixes) + implicit val keyDecoderIRI: KeyDecoder[IRI] = Implicits.iriKeyDecoder(biolinkData.prefixes) + implicit val decoderBiolinkClass: Decoder[BiolinkClass] = Implicits.biolinkClassDecoder(biolinkData.classes) + implicit val decoderBiolinkPredicate: Decoder[BiolinkPredicate] = + Implicits.biolinkPredicateDecoder(biolinkData.predicates) + implicit lazy val decoderTRAPIAttribute: Decoder[TRAPIAttribute] = deriveDecoder[TRAPIAttribute] + + response.as[MetaKnowledgeGraph] + } + ) + } yield metaKG + ) + + val acceptableIDs: Set[String] = metaKG.nodes.values.flatMap(_.id_prefixes).toSet + + def getCURIEPrefix(curie: IRI): String = { + val cs = curie.value.split(':') + if (cs.length == 0) curie.value + else cs(0) + } + + def getAcceptableCURIE(curie: IRI): Option[IRI] = { + val prefix = getCURIEPrefix(curie) + + if (acceptableIDs.contains(prefix)) { + logger.info(s"getAcceptableCURIE(${curie}): acceptable prefix ${prefix}") + Some(curie) + } else { + case class NodeNormIdentifier( + identifier: IRI, + label: String + ) + + case class NodeNormResponse( + id: NodeNormIdentifier, + equivalent_identifiers: List[NodeNormIdentifier], + `type`: List[IRI], + information_content: Float + ) + + zio.Runtime + .unsafeFromLayer(HttpClient.makeHttpClientLayer >+> Biolink.makeUtilitiesLayer) + .unsafeRun( + for { + httpClient <- HttpClient.client + biolinkData <- biolinkData + + request = Request[Task](Method.GET, endpointNodeNorm.+?("curie", curie.value)) + .withHeaders(Accept(MediaType.application.json), `Content-Type`(MediaType.application.json)) + response <- httpClient.expect[Json](request) + + result <- ZIO.fromOption((response \\ curie.value).headOption) + nnResponse <- ZIO.fromEither( + { + implicit val iriEncoder: Encoder[IRI] = Implicits.iriEncoder(biolinkData.prefixes) + implicit val iriKeyEncoder: KeyEncoder[IRI] = Implicits.iriKeyEncoder(biolinkData.prefixes) + implicit val biolinkClassEncoder: Encoder[BiolinkClass] = Implicits.biolinkClassEncoder + implicit val biolinkPredicateEncoder: Encoder[BiolinkPredicate] = + Implicits.biolinkPredicateEncoder(biolinkData.prefixes) + + implicit val decoderIRI: Decoder[IRI] = Implicits.iriDecoder(biolinkData.prefixes) + implicit val keyDecoderIRI: KeyDecoder[IRI] = Implicits.iriKeyDecoder(biolinkData.prefixes) + implicit val decoderBiolinkClass: Decoder[BiolinkClass] = Implicits.biolinkClassDecoder(biolinkData.classes) + implicit val decoderBiolinkPredicate: Decoder[BiolinkPredicate] = + Implicits.biolinkPredicateDecoder(biolinkData.predicates) + implicit lazy val decoderTRAPIAttribute: Decoder[TRAPIAttribute] = deriveDecoder[TRAPIAttribute] + + result.as[NodeNormResponse] + } + ) + } yield nnResponse.equivalent_identifiers + .filter(id => acceptableIDs.contains(getCURIEPrefix(id.identifier))) + .headOption + .map(_.identifier) + ) + } + } + def testEdge(subj: String, pred: String, obj: String): Spec[ZConfig[Biolink.BiolinkData] with HttpClient, TestFailure[Throwable], TestSuccess] = @@ -52,6 +152,7 @@ object EnhanceEdgesTest extends DefaultRunnableSpec { val subjIRI = IRI(subj) val objIRI = IRI(obj) + val queryGraph = TRAPIQueryGraph( nodes = Map( "n0" -> TRAPIQueryNode(ids = Some(List(subjIRI)), None, None, None), @@ -89,7 +190,11 @@ object EnhanceEdgesTest extends DefaultRunnableSpec { } // Let's test one out. - val testOne = testEdge("UniProtKB:P56856", "biolink:has_fisher_exact_test_p_value_with", "CHEMBL.COMPOUND:CHEMBL1201129") + val testOne = testEdge( + getAcceptableCURIE(IRI("UniProtKB:P56856")).map(_.value).getOrElse("UniProtKB:P56856"), + "biolink:has_fisher_exact_test_p_value_with", + getAcceptableCURIE(IRI("CHEMBL.COMPOUND:CHEMBL1201129")).map(_.value).getOrElse("CHEMBL.COMPOUND:CHEMBL1201129") + ) /* val testEachExampleFile: Spec[ZConfig[Biolink.BiolinkData] with HttpClient, TestFailure[Throwable], TestSuccess] = { From e28093aa5ced990adac94aaef9f16ccd3777a516 Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Fri, 30 Sep 2022 02:02:00 -0400 Subject: [PATCH 04/13] Added some debugging and improved code. --- .../org/renci/cam/it/EnhanceEdgesTest.scala | 33 ++++++++++++++----- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala b/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala index 3df295df..4e3b6c7d 100644 --- a/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala +++ b/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala @@ -44,7 +44,9 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { val limit: Int = sys.env.getOrElse("CAM_KP_LIMIT", 1000).toString.toInt - val metaKG: MetaKnowledgeGraph = + val metaKG: MetaKnowledgeGraph = { + logger.info("Retrieving MetaKnowledgeGraph") + zio.Runtime .unsafeFromLayer(HttpClient.makeHttpClientLayer >+> Biolink.makeUtilitiesLayer) .unsafeRun( @@ -59,16 +61,23 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { { implicit val decoderIRI: Decoder[IRI] = Implicits.iriDecoder(biolinkData.prefixes) implicit val keyDecoderIRI: KeyDecoder[IRI] = Implicits.iriKeyDecoder(biolinkData.prefixes) + implicit val iriKeyDecoder: KeyDecoder[BiolinkClass] = Implicits.biolinkClassKeyDecoder(biolinkData.classes) implicit val decoderBiolinkClass: Decoder[BiolinkClass] = Implicits.biolinkClassDecoder(biolinkData.classes) implicit val decoderBiolinkPredicate: Decoder[BiolinkPredicate] = Implicits.biolinkPredicateDecoder(biolinkData.predicates) implicit lazy val decoderTRAPIAttribute: Decoder[TRAPIAttribute] = deriveDecoder[TRAPIAttribute] + implicit lazy val decoderMetaKnowledgeGraph: Decoder[MetaKnowledgeGraph] = deriveDecoder[MetaKnowledgeGraph] response.as[MetaKnowledgeGraph] } ) - } yield metaKG + } yield { + logger.info("MetaKnowledgeGraph retrieved") + + metaKG + } ) + } val acceptableIDs: Set[String] = metaKG.nodes.values.flatMap(_.id_prefixes).toSet @@ -82,9 +91,11 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { val prefix = getCURIEPrefix(curie) if (acceptableIDs.contains(prefix)) { - logger.info(s"getAcceptableCURIE(${curie}): acceptable prefix ${prefix}") + logger.info(s"getAcceptableCURIE(${curie}): prefix ${prefix} acceptable") Some(curie) } else { + logger.info(s"getAcceptableCURIE(${curie}): prefix ${prefix} not acceptable") + case class NodeNormIdentifier( identifier: IRI, label: String @@ -97,7 +108,7 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { information_content: Float ) - zio.Runtime + val result = zio.Runtime .unsafeFromLayer(HttpClient.makeHttpClientLayer >+> Biolink.makeUtilitiesLayer) .unsafeRun( for { @@ -128,10 +139,12 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { } ) } yield nnResponse.equivalent_identifiers - .filter(id => acceptableIDs.contains(getCURIEPrefix(id.identifier))) - .headOption + .find(id => acceptableIDs.contains(getCURIEPrefix(id.identifier))) .map(_.identifier) ) + + logger.info(s"getAcceptableCURIE(${curie}): replaced with ${result}") + result } } @@ -190,11 +203,15 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { } // Let's test one out. - val testOne = testEdge( + val testOne = test("testOne") { + assert(getAcceptableCURIE(IRI("CHEMBL.COMPOUND:CHEMBL1201129")))(Assertion.isNone) + } + + /* testEdge( getAcceptableCURIE(IRI("UniProtKB:P56856")).map(_.value).getOrElse("UniProtKB:P56856"), "biolink:has_fisher_exact_test_p_value_with", getAcceptableCURIE(IRI("CHEMBL.COMPOUND:CHEMBL1201129")).map(_.value).getOrElse("CHEMBL.COMPOUND:CHEMBL1201129") - ) + ) */ /* val testEachExampleFile: Spec[ZConfig[Biolink.BiolinkData] with HttpClient, TestFailure[Throwable], TestSuccess] = { From 43e386bda7212e1fff9f82338b13ab04e3505a6c Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Fri, 30 Sep 2022 13:50:11 -0400 Subject: [PATCH 05/13] Trying to debug Request issue. --- .../org/renci/cam/it/EnhanceEdgesTest.scala | 41 +++++++++++-------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala b/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala index 4e3b6c7d..bdb221c3 100644 --- a/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala +++ b/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala @@ -7,7 +7,7 @@ import io.circe.generic.semiauto._ import io.circe.syntax.EncoderOps import org.http4s._ import org.http4s.circe.jsonDecoder -import org.http4s.headers.{`Content-Type`, Accept} +import org.http4s.headers.{Accept, `Content-Type`} import org.http4s.implicits._ import org.renci.cam.Biolink.biolinkData import org.renci.cam.HttpClient.HttpClient @@ -25,6 +25,16 @@ import java.nio.file.{Path, Paths} import scala.jdk.CollectionConverters._ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { + /* Set up test environment */ + val configLayer: Layer[Throwable, ZConfig[AppConfig]] = TypesafeConfig.fromDefaultLoader(AppConfig.config) + val camkpapiLayer = Blocking.live >>> HttpClient.makeHttpClientLayer >+> Biolink.makeUtilitiesLayer + val testLayer = (configLayer ++ camkpapiLayer).mapError(TestFailure.die) + + def spec = suite("EnhanceEdgesTest")( + testOne + ).provideCustomLayer(testLayer) + + /* Configure tests */ val exampleDir: Path = Paths.get("src/it/resources/enhance-edge-tests") val exampleResultsDir: Path = Paths.get("src/it/resources/example-results") @@ -44,19 +54,27 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { val limit: Int = sys.env.getOrElse("CAM_KP_LIMIT", 1000).toString.toInt + /* We will need the MetaKnowledgeGraph to normalize input nodes, so we load that here. */ + val zioRuntime = zio.Runtime.unsafeFromLayer(camkpapiLayer) val metaKG: MetaKnowledgeGraph = { logger.info("Retrieving MetaKnowledgeGraph") - - zio.Runtime - .unsafeFromLayer(HttpClient.makeHttpClientLayer >+> Biolink.makeUtilitiesLayer) + zioRuntime .unsafeRun( for { httpClient <- HttpClient.client biolinkData <- biolinkData + _ = logger.info(s"Ready to make request to ${endpointMetaKG}.") + request = Request[Task](Method.GET, endpointMetaKG) - .withHeaders(Accept(MediaType.application.json), `Content-Type`(MediaType.application.json)) + // .withHeaders(Accept(MediaType.application.json), `Content-Type`(MediaType.application.json)) + + _ = logger.info(s"Ready to make request ${request} to HTTP client ${httpClient}.") + response <- httpClient.expect[Json](request) + + _ = logger.info(s"Response received: ${response}") + metaKG <- ZIO.fromEither( { implicit val decoderIRI: Decoder[IRI] = Implicits.iriDecoder(biolinkData.prefixes) @@ -72,7 +90,7 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { } ) } yield { - logger.info("MetaKnowledgeGraph retrieved") + logger.info(s"MetaKnowledgeGraph retrieved: ${metaKG}") metaKG } @@ -108,9 +126,7 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { information_content: Float ) - val result = zio.Runtime - .unsafeFromLayer(HttpClient.makeHttpClientLayer >+> Biolink.makeUtilitiesLayer) - .unsafeRun( + val result = zioRuntime.unsafeRun( for { httpClient <- HttpClient.client biolinkData <- biolinkData @@ -314,12 +330,5 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { } */ - val configLayer: Layer[Throwable, ZConfig[AppConfig]] = TypesafeConfig.fromDefaultLoader(AppConfig.config) - val camkpapiLayer = Blocking.live >>> HttpClient.makeHttpClientLayer >+> Biolink.makeUtilitiesLayer - val testLayer = (configLayer ++ camkpapiLayer).mapError(TestFailure.die) - - def spec = suite("EnhanceEdgesTest")( - testOne - ).provideCustomLayer(testLayer) } From 4d752c801ec816cafbc32ba47dd560ff0edc2a23 Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Fri, 30 Sep 2022 14:16:06 -0400 Subject: [PATCH 06/13] Figured out a workaround for the MetaKG retrieval code. --- .../org/renci/cam/it/EnhanceEdgesTest.scala | 32 ++++++++----------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala b/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala index bdb221c3..2ac1cfe6 100644 --- a/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala +++ b/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala @@ -4,7 +4,8 @@ import com.typesafe.scalalogging.LazyLogging import io.circe._ import io.circe.generic.auto._ import io.circe.generic.semiauto._ -import io.circe.syntax.EncoderOps +import io.circe.parser._ +import io.circe.syntax.{EncoderOps, _} import org.http4s._ import org.http4s.circe.jsonDecoder import org.http4s.headers.{Accept, `Content-Type`} @@ -22,6 +23,7 @@ import zio.test._ import zio.{Layer, Task, ZIO} import java.nio.file.{Path, Paths} +import scala.io.Source import scala.jdk.CollectionConverters._ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { @@ -58,23 +60,17 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { val zioRuntime = zio.Runtime.unsafeFromLayer(camkpapiLayer) val metaKG: MetaKnowledgeGraph = { logger.info("Retrieving MetaKnowledgeGraph") + + // TODO: replace with ZIO I guess. + val metaKGSource = Source.fromURL(endpointMetaKG.toString()) + val metaKGString = metaKGSource.mkString + metaKGSource.close() + zioRuntime .unsafeRun( for { - httpClient <- HttpClient.client biolinkData <- biolinkData - _ = logger.info(s"Ready to make request to ${endpointMetaKG}.") - - request = Request[Task](Method.GET, endpointMetaKG) - // .withHeaders(Accept(MediaType.application.json), `Content-Type`(MediaType.application.json)) - - _ = logger.info(s"Ready to make request ${request} to HTTP client ${httpClient}.") - - response <- httpClient.expect[Json](request) - - _ = logger.info(s"Response received: ${response}") - metaKG <- ZIO.fromEither( { implicit val decoderIRI: Decoder[IRI] = Implicits.iriDecoder(biolinkData.prefixes) @@ -86,12 +82,10 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { implicit lazy val decoderTRAPIAttribute: Decoder[TRAPIAttribute] = deriveDecoder[TRAPIAttribute] implicit lazy val decoderMetaKnowledgeGraph: Decoder[MetaKnowledgeGraph] = deriveDecoder[MetaKnowledgeGraph] - response.as[MetaKnowledgeGraph] + decode[MetaKnowledgeGraph](metaKGString) } ) } yield { - logger.info(s"MetaKnowledgeGraph retrieved: ${metaKG}") - metaKG } ) @@ -116,14 +110,14 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { case class NodeNormIdentifier( identifier: IRI, - label: String + label: Option[String] ) case class NodeNormResponse( id: NodeNormIdentifier, equivalent_identifiers: List[NodeNormIdentifier], `type`: List[IRI], - information_content: Float + information_content: Option[Float] ) val result = zioRuntime.unsafeRun( @@ -154,7 +148,7 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { result.as[NodeNormResponse] } ) - } yield nnResponse.equivalent_identifiers + } yield (nnResponse.id :: nnResponse.equivalent_identifiers) .find(id => acceptableIDs.contains(getCURIEPrefix(id.identifier))) .map(_.identifier) ) From 8607e291ec9116fc2b8eb7625ef4d21aa0d31436 Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Fri, 30 Sep 2022 17:14:44 -0400 Subject: [PATCH 07/13] Fixed EnhanceEdgesTest to make it (mostly) work. --- .../org/renci/cam/it/EnhanceEdgesTest.scala | 196 +++++++----------- 1 file changed, 73 insertions(+), 123 deletions(-) diff --git a/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala b/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala index 2ac1cfe6..6c65bf1c 100644 --- a/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala +++ b/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala @@ -22,7 +22,7 @@ import zio.test.Assertion._ import zio.test._ import zio.{Layer, Task, ZIO} -import java.nio.file.{Path, Paths} +import java.nio.file.{Files, Path, Paths} import scala.io.Source import scala.jdk.CollectionConverters._ @@ -32,10 +32,6 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { val camkpapiLayer = Blocking.live >>> HttpClient.makeHttpClientLayer >+> Biolink.makeUtilitiesLayer val testLayer = (configLayer ++ camkpapiLayer).mapError(TestFailure.die) - def spec = suite("EnhanceEdgesTest")( - testOne - ).provideCustomLayer(testLayer) - /* Configure tests */ val exampleDir: Path = Paths.get("src/it/resources/enhance-edge-tests") val exampleResultsDir: Path = Paths.get("src/it/resources/example-results") @@ -93,13 +89,13 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { val acceptableIDs: Set[String] = metaKG.nodes.values.flatMap(_.id_prefixes).toSet - def getCURIEPrefix(curie: IRI): String = { - val cs = curie.value.split(':') - if (cs.length == 0) curie.value + def getCURIEPrefix(curie: String): String = { + val cs = curie.split(':') + if (cs.length == 0) curie else cs(0) } - def getAcceptableCURIE(curie: IRI): Option[IRI] = { + def getAcceptableCURIE(curie: String): Option[String] = { val prefix = getCURIEPrefix(curie) if (acceptableIDs.contains(prefix)) { @@ -109,27 +105,29 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { logger.info(s"getAcceptableCURIE(${curie}): prefix ${prefix} not acceptable") case class NodeNormIdentifier( - identifier: IRI, + identifier: String, label: Option[String] ) case class NodeNormResponse( - id: NodeNormIdentifier, + id: Option[NodeNormIdentifier], equivalent_identifiers: List[NodeNormIdentifier], - `type`: List[IRI], + `type`: List[BiolinkClass], information_content: Option[Float] ) + // TODO: move to ZIO (I guess). + val nodeNormSource = Source.fromURL(endpointNodeNorm.+?("curie", curie).toString()) + val nodeNormString = nodeNormSource.mkString + nodeNormSource.close() + val result = zioRuntime.unsafeRun( for { - httpClient <- HttpClient.client biolinkData <- biolinkData - request = Request[Task](Method.GET, endpointNodeNorm.+?("curie", curie.value)) - .withHeaders(Accept(MediaType.application.json), `Content-Type`(MediaType.application.json)) - response <- httpClient.expect[Json](request) - - result <- ZIO.fromOption((response \\ curie.value).headOption) + response <- ZIO.fromEither(decode[Json](nodeNormString)) + curieResult = (response \\ curie) + result <- ZIO.fromOption(curieResult.headOption) nnResponse <- ZIO.fromEither( { implicit val iriEncoder: Encoder[IRI] = Implicits.iriEncoder(biolinkData.prefixes) @@ -148,9 +146,17 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { result.as[NodeNormResponse] } ) - } yield (nnResponse.id :: nnResponse.equivalent_identifiers) - .find(id => acceptableIDs.contains(getCURIEPrefix(id.identifier))) - .map(_.identifier) + } yield { + if (curieResult.isEmpty) { + logger.warn(s"NodeNorm could not resolve ${curie}.") + None + } else nnResponse.equivalent_identifiers + .find(id => { + logger.info(s"Checking to see if ${id.identifier} (prefix: ${getCURIEPrefix(id.identifier)}) is in ${acceptableIDs}") + acceptableIDs.contains(getCURIEPrefix(id.identifier)) + }) + .map(_.identifier) + } ) logger.info(s"getAcceptableCURIE(${curie}): replaced with ${result}") @@ -166,15 +172,17 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { biolinkData <- biolinkData httpClient <- HttpClient.client - messageText = { + messageText: String = { implicit val iriEncoder: Encoder[IRI] = Implicits.iriEncoder(biolinkData.prefixes) implicit val iriKeyEncoder: KeyEncoder[IRI] = Implicits.iriKeyEncoder(biolinkData.prefixes) implicit val biolinkClassEncoder: Encoder[BiolinkClass] = Implicits.biolinkClassEncoder implicit val biolinkPredicateEncoder: Encoder[BiolinkPredicate] = Implicits.biolinkPredicateEncoder(biolinkData.prefixes) - val subjIRI = IRI(subj) - val objIRI = IRI(obj) + val subjIRI = IRI(getAcceptableCURIE(subj).getOrElse(subj)) + val objIRI = IRI(getAcceptableCURIE(obj).getOrElse(obj)) + + logger.info(s"Querying CAM-KP-API with subj=${subjIRI}, objIRI=${objIRI}") val queryGraph = TRAPIQueryGraph( nodes = Map( @@ -192,6 +200,7 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { TRAPIQuery(message = message, log_level = None).asJson.deepDropNullValues.noSpaces } + request = Request[Task](Method.POST, endpointToTest.withQueryParam("limit", limit.toString)) .withHeaders(Accept(MediaType.application.json), `Content-Type`(MediaType.application.json)) .withEntity(messageText) @@ -209,120 +218,61 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { } ) results = trapiResponse.message.results + resultsOrEmpty = results.getOrElse(Seq()) + _ = logger.info(s"Querying CAM-KP-API with query ${messageText} results in ${resultsOrEmpty.size} results: ${resultsOrEmpty}") } yield assert(results)(Assertion.isSome(Assertion.isNonEmpty)) } - // Let's test one out. - val testOne = test("testOne") { - assert(getAcceptableCURIE(IRI("CHEMBL.COMPOUND:CHEMBL1201129")))(Assertion.isNone) + // Let's test the acceptable CURIE lookup system. + val testCURIEs = suite("Test CURIEs to ensure we can convert them into acceptable IDs") { + val curiesToTest = Map( + "CHEMBL.COMPOUND:CHEMBL1201129" -> "CHEBI:50131", + "UniProtKB:P56856" -> "UniProtKB:P56856" + ) + + curiesToTest.map({ case (id, acceptableId) => + test(s"Test whether ${id} can be converted into acceptable ID ${acceptableId}") { + assert(getAcceptableCURIE(id))(Assertion.isSome(Assertion.equalTo(acceptableId))) + } + }).reduce(_ + _) } - /* testEdge( - getAcceptableCURIE(IRI("UniProtKB:P56856")).map(_.value).getOrElse("UniProtKB:P56856"), - "biolink:has_fisher_exact_test_p_value_with", - getAcceptableCURIE(IRI("CHEMBL.COMPOUND:CHEMBL1201129")).map(_.value).getOrElse("CHEMBL.COMPOUND:CHEMBL1201129") - ) */ - - /* - val testEachExampleFile: Spec[ZConfig[Biolink.BiolinkData] with HttpClient, TestFailure[Throwable], TestSuccess] = { + val testEachExampleFile = { // List of example files to process. val exampleFiles = Files .walk(exampleDir) .iterator() .asScala .filter(Files.isRegularFile(_)) - .filter(_.toString.toLowerCase.endsWith(".json")) + .filter(_.toString.toLowerCase.endsWith(".tsv")) .toSeq - suiteM("Test example files in the src/it/resources/examples directory") { - ZStream - .fromIterable(exampleFiles) - .map(exampleFile => - testM(s"Testing ${exampleDir.relativize(exampleFile)}") { - val exampleText = { - val source = Source.fromFile(exampleFile.toFile) - source.getLines().mkString("\n") - } - for { - httpClient <- HttpClient.client - biolinkData <- biolinkData - - // Read the example JSON file. - exampleJson <- ZIO.fromEither(io.circe.parser.parse(exampleText)) - example <- ZIO.fromEither( - { - implicit val decoderIRI: Decoder[IRI] = Implicits.iriDecoder(biolinkData.prefixes) - implicit val keyDecoderIRI: KeyDecoder[IRI] = Implicits.iriKeyDecoder(biolinkData.prefixes) - implicit val decoderBiolinkClass: Decoder[BiolinkClass] = Implicits.biolinkClassDecoder(biolinkData.classes) - implicit val decoderBiolinkPredicate: Decoder[BiolinkPredicate] = - Implicits.biolinkPredicateDecoder(biolinkData.predicates) - implicit lazy val decoderTRAPIAttribute: Decoder[TRAPIAttribute] = deriveDecoder[TRAPIAttribute] - - exampleJson.as[ExampleJsonFile] - } - ) - - descriptionOpt = example.description - limit = example.limit.getOrElse(0) - minExpectedResultsOpt = example.minExpectedResults - maxExpectedResultsOpt = example.maxExpectedResults - - // Prepare request for the CAM-KP-API endpoint. - messageText = { - implicit val iriEncoder: Encoder[IRI] = Implicits.iriEncoder(biolinkData.prefixes) - implicit val iriKeyEncoder: KeyEncoder[IRI] = Implicits.iriKeyEncoder(biolinkData.prefixes) - implicit val biolinkClassEncoder: Encoder[BiolinkClass] = Implicits.biolinkClassEncoder - implicit val biolinkPredicateEncoder: Encoder[BiolinkPredicate] = - Implicits.biolinkPredicateEncoder(biolinkData.prefixes) + suite("Test example files in the src/it/resources/examples directory") { + exampleFiles.map(exampleFile => + suite(s"Testing ${exampleDir.relativize(exampleFile)}") { + val outputFile = exampleDir.resolve(exampleFile.getFileName.toString.replaceFirst(".tsv$", ".txt")) - TRAPIQuery(message = example.message, log_level = None).asJson.deepDropNullValues.noSpaces - } - // _ = println(s"messageText = ${messageText}") - request = Request[Task](Method.POST, endpointToTest.withQueryParam("limit", limit.toString)) - .withHeaders(Accept(MediaType.application.json), `Content-Type`(MediaType.application.json)) - .withEntity(messageText) - response <- httpClient.expect[Json](request) - - // Write out the response in `src/it/resources/example-results` for debugging. - outputFilename = exampleResultsDir.resolve(exampleDir.relativize(exampleFile)) - _ = Files.createDirectories(outputFilename.getParent) - _ = Files.writeString(outputFilename, response.spaces2SortKeys) - - // Translate the response into a TRAPIResponse for testing. - trapiResponse <- ZIO.fromEither( - { - implicit val decoderIRI: Decoder[IRI] = Implicits.iriDecoder(biolinkData.prefixes) - implicit val keyDecoderIRI: KeyDecoder[IRI] = Implicits.iriKeyDecoder(biolinkData.prefixes) - implicit val decoderBiolinkClass: Decoder[BiolinkClass] = Implicits.biolinkClassDecoder(biolinkData.classes) - implicit val decoderBiolinkPredicate: Decoder[BiolinkPredicate] = - Implicits.biolinkPredicateDecoder(biolinkData.predicates) - implicit lazy val decoderTRAPIAttribute: Decoder[TRAPIAttribute] = deriveDecoder[TRAPIAttribute] - - response.as[TRAPIResponse] - } - ) - } yield assert(descriptionOpt)(isSome(isNonEmptyString)) && - assert(messageText)(isNonEmptyString) && - assert(trapiResponse.status)(isSome(equalTo("Success"))) && - // If a minExpectedResults is provided, make sure that the number of results is indeed greater than or equal to it. - (minExpectedResultsOpt match { - case None => assertCompletes - case Some(minExpectedResults) => - val resultCount = trapiResponse.message.results.getOrElse(List()).size - assert(resultCount)(isGreaterThanEqualTo(minExpectedResults)) - }) && - // If a maxExpectedResults is provided, make sure that the number of results is indeed less than or equal to it. - (maxExpectedResultsOpt match { - case None => assertCompletes - case Some(maxExpectedResults) => - val resultCount = trapiResponse.message.results.getOrElse(List()).size - assert(resultCount)(isLessThanEqualTo(maxExpectedResults)) - }) - }) - .runCollect + val exampleText = { + val source = Source.fromFile(exampleFile.toFile) + source.getLines() + } + + val tests = for { + // Read the example JSON file. + line <- exampleText + cols = line.split("\t") + } yield { + testEdge(cols(0), cols(1), cols(2)) + } + + tests.reduce(_ + _) + } + ).reduce(_ + _) } } - */ - + def spec: Spec[environment.TestEnvironment, TestFailure[Throwable], TestSuccess] = suite("EnhanceEdgesTest")( + testCURIEs, + testEachExampleFile + ).provideCustomLayer(testLayer) } From 518a46c59624fcf399c743e3b3a5b080d9ac329c Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Tue, 18 Oct 2022 18:01:33 -0400 Subject: [PATCH 08/13] Added ATP1A3 enhance edge test. --- .../resources/enhance-edge-tests/ATP1A3_ncatstranslator_233.tsv | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/it/resources/enhance-edge-tests/ATP1A3_ncatstranslator_233.tsv diff --git a/src/it/resources/enhance-edge-tests/ATP1A3_ncatstranslator_233.tsv b/src/it/resources/enhance-edge-tests/ATP1A3_ncatstranslator_233.tsv new file mode 100644 index 00000000..78a597e0 --- /dev/null +++ b/src/it/resources/enhance-edge-tests/ATP1A3_ncatstranslator_233.tsv @@ -0,0 +1 @@ +NCBIGene:478 biolink:related_to biolink:NamedThing From ea0d4ae16d99402ba4599ec957445f58881ebaa4 Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Tue, 18 Oct 2022 18:02:11 -0400 Subject: [PATCH 09/13] Filtered out empty lines from input. --- src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala b/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala index 6c65bf1c..0caad1ea 100644 --- a/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala +++ b/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala @@ -262,10 +262,11 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { line <- exampleText cols = line.split("\t") } yield { - testEdge(cols(0), cols(1), cols(2)) + if (line.trim.isEmpty) None + else Some(testEdge(cols(0), cols(1), cols(2))) } - tests.reduce(_ + _) + tests.flatten.reduce(_ + _) } ).reduce(_ + _) } From 683548940073c7648006b447dd19baee34e2f7d9 Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Tue, 18 Oct 2022 18:07:36 -0400 Subject: [PATCH 10/13] Improved error messages. --- src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala b/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala index 0caad1ea..515cda77 100644 --- a/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala +++ b/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala @@ -263,6 +263,10 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { cols = line.split("\t") } yield { if (line.trim.isEmpty) None + else if (cols.length != 3) { + logger.error(s"Unable to parse line '${line.trim}' from ${exampleFile}") + None + } else Some(testEdge(cols(0), cols(1), cols(2))) } From c0388a1716d6033c30c45f971bf0fd61f4d609e6 Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Tue, 18 Oct 2022 18:07:45 -0400 Subject: [PATCH 11/13] Fixed formatting of test files. --- .../resources/enhance-edge-tests/ATP1A3_ncatstranslator_233.tsv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/it/resources/enhance-edge-tests/ATP1A3_ncatstranslator_233.tsv b/src/it/resources/enhance-edge-tests/ATP1A3_ncatstranslator_233.tsv index 78a597e0..5c7c9cd4 100644 --- a/src/it/resources/enhance-edge-tests/ATP1A3_ncatstranslator_233.tsv +++ b/src/it/resources/enhance-edge-tests/ATP1A3_ncatstranslator_233.tsv @@ -1 +1 @@ -NCBIGene:478 biolink:related_to biolink:NamedThing +NCBIGene:478 biolink:related_to biolink:NamedThing From f1316669c6711c879178a0e1c571887d1c4adc82 Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Tue, 18 Oct 2022 18:19:31 -0400 Subject: [PATCH 12/13] Added type to method. --- src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala b/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala index 515cda77..4c0a5344 100644 --- a/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala +++ b/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala @@ -237,7 +237,7 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { }).reduce(_ + _) } - val testEachExampleFile = { + val testEachExampleFile: Spec[ZConfig[Biolink.BiolinkData] with HttpClient, TestFailure[Throwable], TestSuccess] = { // List of example files to process. val exampleFiles = Files .walk(exampleDir) From ef8ca6f3c1e61bf77985c640df7f3043af461fd2 Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Wed, 19 Oct 2022 22:42:47 -0400 Subject: [PATCH 13/13] Updated to two-hops. This was merged unexpectedly and hurridly, so it may not work. --- .../org/renci/cam/it/EnhanceEdgesTest.scala | 104 +++++++++--------- 1 file changed, 55 insertions(+), 49 deletions(-) diff --git a/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala b/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala index 4c0a5344..ffd779c1 100644 --- a/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala +++ b/src/it/scala/org/renci/cam/it/EnhanceEdgesTest.scala @@ -8,7 +8,7 @@ import io.circe.parser._ import io.circe.syntax.{EncoderOps, _} import org.http4s._ import org.http4s.circe.jsonDecoder -import org.http4s.headers.{Accept, `Content-Type`} +import org.http4s.headers.{`Content-Type`, Accept} import org.http4s.implicits._ import org.renci.cam.Biolink.biolinkData import org.renci.cam.HttpClient.HttpClient @@ -54,6 +54,7 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { /* We will need the MetaKnowledgeGraph to normalize input nodes, so we load that here. */ val zioRuntime = zio.Runtime.unsafeFromLayer(camkpapiLayer) + val metaKG: MetaKnowledgeGraph = { logger.info("Retrieving MetaKnowledgeGraph") @@ -81,9 +82,7 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { decode[MetaKnowledgeGraph](metaKGString) } ) - } yield { - metaKG - } + } yield metaKG ) } @@ -95,12 +94,12 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { else cs(0) } - def getAcceptableCURIE(curie: String): Option[String] = { + def getAcceptableCURIEs(curie: String): Seq[String] = { val prefix = getCURIEPrefix(curie) if (acceptableIDs.contains(prefix)) { logger.info(s"getAcceptableCURIE(${curie}): prefix ${prefix} acceptable") - Some(curie) + Seq(curie) } else { logger.info(s"getAcceptableCURIE(${curie}): prefix ${prefix} not acceptable") @@ -121,7 +120,8 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { val nodeNormString = nodeNormSource.mkString nodeNormSource.close() - val result = zioRuntime.unsafeRun( + val result = zioRuntime + .unsafeRun( for { biolinkData <- biolinkData @@ -146,18 +146,20 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { result.as[NodeNormResponse] } ) - } yield { + } yield if (curieResult.isEmpty) { logger.warn(s"NodeNorm could not resolve ${curie}.") None - } else nnResponse.equivalent_identifiers - .find(id => { - logger.info(s"Checking to see if ${id.identifier} (prefix: ${getCURIEPrefix(id.identifier)}) is in ${acceptableIDs}") - acceptableIDs.contains(getCURIEPrefix(id.identifier)) - }) - .map(_.identifier) - } + } else + nnResponse.equivalent_identifiers + .filter { id => + logger.info(s"Checking to see if ${id.identifier} (prefix: ${getCURIEPrefix(id.identifier)}) is in ${acceptableIDs}") + acceptableIDs.contains(getCURIEPrefix(id.identifier)) + } + .map(_.identifier) ) + .iterator + .toSeq logger.info(s"getAcceptableCURIE(${curie}): replaced with ${result}") result @@ -179,22 +181,29 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { implicit val biolinkPredicateEncoder: Encoder[BiolinkPredicate] = Implicits.biolinkPredicateEncoder(biolinkData.prefixes) - val subjIRI = IRI(getAcceptableCURIE(subj).getOrElse(subj)) - val objIRI = IRI(getAcceptableCURIE(obj).getOrElse(obj)) + val subjIRIs = getAcceptableCURIEs(subj).map(IRI(_)) + val objIRIs = getAcceptableCURIEs(obj).map(IRI(_)) - logger.info(s"Querying CAM-KP-API with subj=${subjIRI}, objIRI=${objIRI}") + logger.info(s"Querying CAM-KP-API with subj=${subjIRIs}, objIRI=${objIRIs}") val queryGraph = TRAPIQueryGraph( nodes = Map( - "n0" -> TRAPIQueryNode(ids = Some(List(subjIRI)), None, None, None), - "n1" -> TRAPIQueryNode(ids = Some(List(objIRI)), None, None, None) + "n0" -> TRAPIQueryNode(ids = Some(subjIRIs.toList), None, None, None), + "n1" -> TRAPIQueryNode(None, None, None, None), + "n2" -> TRAPIQueryNode(ids = Some(objIRIs.toList), None, None, None) ), edges = Map( "e0" -> TRAPIQueryEdge( predicates = Some(List(BiolinkPredicate("related_to"))), subject = "n0", `object` = "n1" - )) + ), + "e1" -> TRAPIQueryEdge( + predicates = Some(List(BiolinkPredicate("related_to"))), + subject = "n1", + `object` = "n2" + ) + ) ) val message = TRAPIMessage(Some(queryGraph), None, None) @@ -230,14 +239,16 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { "UniProtKB:P56856" -> "UniProtKB:P56856" ) - curiesToTest.map({ case (id, acceptableId) => - test(s"Test whether ${id} can be converted into acceptable ID ${acceptableId}") { - assert(getAcceptableCURIE(id))(Assertion.isSome(Assertion.equalTo(acceptableId))) + curiesToTest + .map { case (id, acceptableId) => + test(s"Test whether ${id} can be converted into acceptable ID ${acceptableId}") { + assert(getAcceptableCURIEs(id))(Assertion.equalTo(List(acceptableId))) + } } - }).reduce(_ + _) + .reduce(_ + _) } - val testEachExampleFile: Spec[ZConfig[Biolink.BiolinkData] with HttpClient, TestFailure[Throwable], TestSuccess] = { + val testEachExampleFile = { // List of example files to process. val exampleFiles = Files .walk(exampleDir) @@ -248,31 +259,25 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { .toSeq suite("Test example files in the src/it/resources/examples directory") { - exampleFiles.map(exampleFile => - suite(s"Testing ${exampleDir.relativize(exampleFile)}") { - val outputFile = exampleDir.resolve(exampleFile.getFileName.toString.replaceFirst(".tsv$", ".txt")) - - val exampleText = { - val source = Source.fromFile(exampleFile.toFile) - source.getLines() - } - - val tests = for { - // Read the example JSON file. - line <- exampleText - cols = line.split("\t") - } yield { - if (line.trim.isEmpty) None - else if (cols.length != 3) { - logger.error(s"Unable to parse line '${line.trim}' from ${exampleFile}") - None + exampleFiles + .map(exampleFile => + suite(s"Testing ${exampleDir.relativize(exampleFile)}") { + val outputFile = exampleDir.resolve(exampleFile.getFileName.toString.replaceFirst(".tsv$", ".txt")) + + val exampleText = { + val source = Source.fromFile(exampleFile.toFile) + source.getLines() } - else Some(testEdge(cols(0), cols(1), cols(2))) - } - tests.flatten.reduce(_ + _) - } - ).reduce(_ + _) + val tests = for { + // Read the example JSON file. + line <- exampleText + cols = line.split("\t") + } yield testEdge(cols(0), cols(1), cols(2)) + + tests.reduce(_ + _) + }) + .reduce(_ + _) } } @@ -280,4 +285,5 @@ object EnhanceEdgesTest extends DefaultRunnableSpec with LazyLogging { testCURIEs, testEachExampleFile ).provideCustomLayer(testLayer) + }