From f3dbe9cdf3507baad9d7b7c3fc60d912de82c572 Mon Sep 17 00:00:00 2001 From: dustine32 Date: Tue, 12 Mar 2024 14:22:57 -0700 Subject: [PATCH] Allow Reactome to share intermediate small mols for #308 --- .../gocam/exchange/BioPaxtoGO.java | 6 +++--- .../gocam/exchange/BioPaxtoGOTest.java | 21 +++++-------------- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/exchange/src/main/java/org/geneontology/gocam/exchange/BioPaxtoGO.java b/exchange/src/main/java/org/geneontology/gocam/exchange/BioPaxtoGO.java index 81247a7..e8d575e 100644 --- a/exchange/src/main/java/org/geneontology/gocam/exchange/BioPaxtoGO.java +++ b/exchange/src/main/java/org/geneontology/gocam/exchange/BioPaxtoGO.java @@ -1331,7 +1331,7 @@ else if (entity instanceof Interaction){ input_id = UUID.randomUUID().toString(); } String input_location = null; - if (small_mol_do_not_join_ids.contains(input_id) || input.getCellularLocation() == null || entityStrategy.equals(EntityStrategy.REACTO)) { + if (small_mol_do_not_join_ids.contains(input_id) || input.getCellularLocation() == null) { // Gotta make these locations specific to rxn ID for do_not_join classes input_location = entity_id; } else { @@ -1341,7 +1341,7 @@ else if (entity instanceof Interaction){ } input_location = String.join("_", in_location_terms); } - if(entityStrategy.equals(EntityStrategy.YeastCyc) && !small_mol_do_not_join_ids.contains(input_id)){ + if(!small_mol_do_not_join_ids.contains(input_id)){ // Try to reuse previous rxn's output instance for(PathwayStep previous_step : previous_steps) { BiochemicalReaction reaction = getBiochemicalReaction(previous_step); @@ -1379,7 +1379,7 @@ else if (entity instanceof Interaction){ output_id = UUID.randomUUID().toString(); } String output_location = null; - if (small_mol_do_not_join_ids.contains(output_id) || output.getCellularLocation() == null || entityStrategy.equals(EntityStrategy.REACTO)) { + if (small_mol_do_not_join_ids.contains(output_id) || output.getCellularLocation() == null) { // Gotta make these locations specific to rxn ID for do_not_join classes output_location = entity_id; } else { diff --git a/exchange/src/test/java/org/geneontology/gocam/exchange/BioPaxtoGOTest.java b/exchange/src/test/java/org/geneontology/gocam/exchange/BioPaxtoGOTest.java index fc49f45..04cbba5 100644 --- a/exchange/src/test/java/org/geneontology/gocam/exchange/BioPaxtoGOTest.java +++ b/exchange/src/test/java/org/geneontology/gocam/exchange/BioPaxtoGOTest.java @@ -1013,31 +1013,20 @@ public final void testInferRegulatesViaOutputEnables() { System.out.println("Done testing regulates via output enables"); } - //gomodel:R-HSA-4641262/R-HSA-201677 / RO:0002413 / gomodel:R-HSA-4641262/R-HSA-201691 - // #inferProvidesInput - /** - * Test method for {@link org.geneontology.gocam.exchange.GoCAM#inferProvidesInput}. - * Use pathway R-HSA-4641262 , reaction1 = R-HSA-201677 reaction2 = R-HSA-201691 - * Relation should be RO:0002413 directly positive regulates - * Phosphorylation of LRP5/6 cytoplasmic domain by membrane-associated GSK3beta - * Phosphorylation of LRP5/6 cytoplasmic domain by CSNKI - * https://reactome.org/content/detail/R-HSA-4641262 - * Compare to http://noctua-dev.berkeleybop.org/editor/graph/gomodel:R-HSA-4641262 - * - * Also an active site detection test - */ @Test - public final void testInferProvidesInput() { + public final void testSharedIntermediateInputs() { System.out.println("Testing provides input"); TupleQueryResult result = null; try { + // Check for shared input/output entity instance between rxns result = blaze.runSparqlQuery( "prefix obo: " + "select ?pathway " + "where { " + "VALUES ?reaction1 { } . "+ "VALUES ?reaction2 { } . "+ - " ?reaction1 obo:RO_0002413 ?reaction2 . " + " ?reaction1 obo:RO_0002234 ?small_mol . " + + " ?reaction2 obo:RO_0002233 ?small_mol . " + "?reaction1 obo:BFO_0000050 ?pathway "+ "}"); int n = 0; String pathway = null; @@ -1059,7 +1048,7 @@ public final void testInferProvidesInput() { e.printStackTrace(); } } - System.out.println("Done testing regulates via output enables"); + System.out.println("Done testing sharing of intermediate small molecules"); } @Test