Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pathfinder dryrun mode: showing what queries are created from the "template-generation" #862

Open
colleenXu opened this issue Sep 4, 2024 · 1 comment
Assignees
Labels
On Test Related changes are deployed to Test server

Comments

@colleenXu
Copy link
Collaborator

I think it'd be helpful to have a feature similar to the dryrun parameter (ref, issue) for Pathfinder.

I imagine:

  • preferably a parameter we can set in the POST query parameters (dryrun or caching both work this way). That's better than an environ variable set at startup (INSTANCE_ENV).
  • Won't fully execute pathfinder mode
  • Instead, once the categories of the starting nodes are known...BTE constructs the 3 templates/queries it's going to run for pathfinder. Return info on what those 3 queries are in a TRAPI response (in logs) AND console logs
  • Ideally, give this info in a nicer format. Current format of execution plan in console logs looks like this:
Click here

  bte:biothings-explorer-trapi:qedge2btedge KG Filters: {
  bte:biothings-explorer-trapi:qedge2btedge   "input_type": [
  bte:biothings-explorer-trapi:qedge2btedge     "SmallMolecule",
  bte:biothings-explorer-trapi:qedge2btedge     "MolecularEntity",
  bte:biothings-explorer-trapi:qedge2btedge     "NucleicAcidEntity",
  bte:biothings-explorer-trapi:qedge2btedge     "ChemicalMixture",
  bte:biothings-explorer-trapi:qedge2btedge     "MolecularMixture",
  bte:biothings-explorer-trapi:qedge2btedge     "Drug",
  bte:biothings-explorer-trapi:qedge2btedge     "ComplexMolecularMixture",
  bte:biothings-explorer-trapi:qedge2btedge     "ProcessedMaterial",
  bte:biothings-explorer-trapi:qedge2btedge     "Food",
  bte:biothings-explorer-trapi:qedge2btedge     "EnvironmentalFoodContaminant",
  bte:biothings-explorer-trapi:qedge2btedge     "FoodAdditive",
  bte:biothings-explorer-trapi:qedge2btedge     "ChemicalEntity"
  bte:biothings-explorer-trapi:qedge2btedge   ],
  bte:biothings-explorer-trapi:qedge2btedge   "output_type": [
  bte:biothings-explorer-trapi:qedge2btedge     "Gene"
  bte:biothings-explorer-trapi:qedge2btedge   ],
  bte:biothings-explorer-trapi:qedge2btedge   "predicate": [
  bte:biothings-explorer-trapi:qedge2btedge     "regulates",
  bte:biothings-explorer-trapi:qedge2btedge     "regulated_by",
  bte:biothings-explorer-trapi:qedge2btedge     "affects_response_to",
  bte:biothings-explorer-trapi:qedge2btedge     "increases_response_to",
  bte:biothings-explorer-trapi:qedge2btedge     "decreases_response_to",
  bte:biothings-explorer-trapi:qedge2btedge     "disrupts",
  bte:biothings-explorer-trapi:qedge2btedge     "ameliorates_condition",
  bte:biothings-explorer-trapi:qedge2btedge     "exacerbates_condition",
  bte:biothings-explorer-trapi:qedge2btedge     "has_adverse_event",
  bte:biothings-explorer-trapi:qedge2btedge     "has_side_effect",
  bte:biothings-explorer-trapi:qedge2btedge     "affects",
  bte:biothings-explorer-trapi:qedge2btedge     "response_affected_by",
  bte:biothings-explorer-trapi:qedge2btedge     "response_increased_by",
  bte:biothings-explorer-trapi:qedge2btedge     "response_decreased_by",
  bte:biothings-explorer-trapi:qedge2btedge     "disrupted_by",
  bte:biothings-explorer-trapi:qedge2btedge     "condition_ameliorated_by",
  bte:biothings-explorer-trapi:qedge2btedge     "condition_prevented_by",
  bte:biothings-explorer-trapi:qedge2btedge     "condition_exacerbated_by",
  bte:biothings-explorer-trapi:qedge2btedge     "adverse_event_of",
  bte:biothings-explorer-trapi:qedge2btedge     "is_side_effect_of",
  bte:biothings-explorer-trapi:qedge2btedge     "affected_by",
  bte:biothings-explorer-trapi:qedge2btedge     "physically_interacts_with",
  bte:biothings-explorer-trapi:qedge2btedge     "directly_physically_interacts_with",
  bte:biothings-explorer-trapi:qedge2btedge     "binds",
  bte:biothings-explorer-trapi:qedge2btedge     "indirectly_physically_interacts_with",
  bte:biothings-explorer-trapi:qedge2btedge     "genetically_interacts_with",
  bte:biothings-explorer-trapi:qedge2btedge     "gene_fusion_with",
  bte:biothings-explorer-trapi:qedge2btedge     "genetic_neighborhood_of",
  bte:biothings-explorer-trapi:qedge2btedge     "interacts_with",
  bte:biothings-explorer-trapi:qedge2btedge     "associated_with_likelihood_of",
  bte:biothings-explorer-trapi:qedge2btedge     "associated_with_increased_likelihood_of",
  bte:biothings-explorer-trapi:qedge2btedge     "associated_with_decreased_likelihood_of",
  bte:biothings-explorer-trapi:qedge2btedge     "likelihood_associated_with",
  bte:biothings-explorer-trapi:qedge2btedge     "increased_likelihood_associated_with",
  bte:biothings-explorer-trapi:qedge2btedge     "decreased_likelihood_associated_with",
  bte:biothings-explorer-trapi:qedge2btedge     "associated_with_sensitivity_to",
  bte:biothings-explorer-trapi:qedge2btedge     "sensitivity_associated_with",
  bte:biothings-explorer-trapi:qedge2btedge     "associated_with_resistance_to",
  bte:biothings-explorer-trapi:qedge2btedge     "resistance_associated_with",
  bte:biothings-explorer-trapi:qedge2btedge     "genetic_association",
  bte:biothings-explorer-trapi:qedge2btedge     "genetically_associated_with",
  bte:biothings-explorer-trapi:qedge2btedge     "gene_associated_with_condition",
  bte:biothings-explorer-trapi:qedge2btedge     "condition_associated_with_gene",
  bte:biothings-explorer-trapi:qedge2btedge     "correlated_with",
  bte:biothings-explorer-trapi:qedge2btedge     "positively_correlated_with",
  bte:biothings-explorer-trapi:qedge2btedge     "negatively_correlated_with",
  bte:biothings-explorer-trapi:qedge2btedge     "occurs_together_in_literature_with",
  bte:biothings-explorer-trapi:qedge2btedge     "coexpressed_with",
  bte:biothings-explorer-trapi:qedge2btedge     "has_biomarker",
  bte:biothings-explorer-trapi:qedge2btedge     "biomarker_for",
  bte:biothings-explorer-trapi:qedge2btedge     "associated_with"
  bte:biothings-explorer-trapi:qedge2btedge   ]
  bte:biothings-explorer-trapi:qedge2btedge } +0ms
  bte:biothings-explorer-trapi:edge-manager (4) Edges not yet executed = 1 +140ms
  bte:biothings-explorer-trapi:edge-manager (5) Sending next edge 'un_obj' WITH entity count...(134) +0ms
  bte:biothings-explorer-trapi:edge-manager Checking entity max : (20)--(0) +0ms
  bte:biothings-explorer-trapi:QEdge (8) Choosing lower entity count in edge... +139ms
  bte:biothings-explorer-trapi:QNode (8) Node "un" holding undefined aside. +142ms
  bte:biothings-explorer-trapi:QEdge (8) Chose lower entity value in object (20) +0ms
  bte:biothings-explorer-trapi:edge-manager 'sub_un' : (1) --> (134) +0ms
  bte:biothings-explorer-trapi:edge-manager 'un_obj' : (134) <-- (20) +0ms
  bte:biothings-explorer-trapi:qedge2btedge Input node is creativeQueryObject +139ms
  bte:biothings-explorer-trapi:qedge2btedge Output node is un +0ms
  bte:biothings-explorer-trapi:QEdge Expanded edges: gene_associated_with_condition,biomarker_for,affects_response_to,increases_response_to,decreases_response_to,regulates,disrupts,ameliorates_condition,exacerbates_condition,has_adverse_event,has_side_effect,affects,causes,contributes_to +0ms
  bte:biothings-explorer-trapi:QEdge Expanded edges: gene_associated_with_condition,biomarker_for,affects_response_to,increases_response_to,decreases_response_to,regulates,disrupts,ameliorates_condition,exacerbates_condition,has_adverse_event,has_side_effect,affects,causes,contributes_to +1ms
  bte:biothings-explorer-trapi:qedge2btedge KG Filters: {
  bte:biothings-explorer-trapi:qedge2btedge   "input_type": [
  bte:biothings-explorer-trapi:qedge2btedge     "Disease"
  bte:biothings-explorer-trapi:qedge2btedge   ],
  bte:biothings-explorer-trapi:qedge2btedge   "output_type": [
  bte:biothings-explorer-trapi:qedge2btedge     "Gene"
  bte:biothings-explorer-trapi:qedge2btedge   ],
  bte:biothings-explorer-trapi:qedge2btedge   "predicate": [
  bte:biothings-explorer-trapi:qedge2btedge     "condition_associated_with_gene",
  bte:biothings-explorer-trapi:qedge2btedge     "has_biomarker",
  bte:biothings-explorer-trapi:qedge2btedge     "response_affected_by",
  bte:biothings-explorer-trapi:qedge2btedge     "response_increased_by",
  bte:biothings-explorer-trapi:qedge2btedge     "response_decreased_by",
  bte:biothings-explorer-trapi:qedge2btedge     "regulated_by",
  bte:biothings-explorer-trapi:qedge2btedge     "disrupted_by",
  bte:biothings-explorer-trapi:qedge2btedge     "condition_ameliorated_by",
  bte:biothings-explorer-trapi:qedge2btedge     "condition_exacerbated_by",
  bte:biothings-explorer-trapi:qedge2btedge     "adverse_event_of",
  bte:biothings-explorer-trapi:qedge2btedge     "is_side_effect_of",
  bte:biothings-explorer-trapi:qedge2btedge     "affected_by",
  bte:biothings-explorer-trapi:qedge2btedge     "caused_by",
  bte:biothings-explorer-trapi:qedge2btedge     "contribution_from"
  bte:biothings-explorer-trapi:qedge2btedge   ]
  bte:biothings-explorer-trapi:qedge2btedge } +1ms
  bte:biothings-explorer-trapi:edge-manager (3) Edge manager is managing 2 qEdges. +128ms
  bte:biothings-explorer-trapi:edge-manager (4) Edges not yet executed = 2 +0ms
  bte:biothings-explorer-trapi:edge-manager (5) Sending next edge 'sub_un' WITH entity count...(1) +1ms
  bte:biothings-explorer-trapi:edge-manager Checking entity max : (0)--(1) +0ms
  bte:biothings-explorer-trapi:edge-manager 'sub_un' : (1) --> (0) +0ms
  bte:biothings-explorer-trapi:edge-manager 'un_obj' : (0) <-- (20) +0ms
  bte:biothings-explorer-trapi:edge-manager (5) Executing current edge >> "sub_un" +1ms

@tokebe Anything to add? Particularly on urgency? I think this would be useful right now (aka do ASAP) but it's also fine to have this later...

@rjawesome @NeuralFlux Jackson mentioned that one of you two could pick this issue and self-assign.

@colleenXu colleenXu changed the title Pathfinder dry-run mode: showing what queries are created from the "template-generation" Pathfinder dryrun mode: showing what queries are created from the "template-generation" Sep 4, 2024
@rjawesome rjawesome self-assigned this Sep 6, 2024
@tokebe tokebe added the On Dev Related changes are deployed to Dev server label Sep 17, 2024
@tokebe tokebe added On CI Related changes are deployed to CI server and removed On Dev Related changes are deployed to Dev server labels Sep 26, 2024
@colleenXu
Copy link
Collaborator Author

colleenXu commented Sep 28, 2024

biothings/bte-server@5790cb4 this commit also required.

Deployed on CI Mon 9/30.

@colleenXu colleenXu added On CI -> Test and removed On CI Related changes are deployed to CI server labels Oct 24, 2024
@tokebe tokebe added On Test Related changes are deployed to Test server and removed On CI -> Test labels Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
On Test Related changes are deployed to Test server
Projects
None yet
Development

No branches or pull requests

3 participants