Skip to content

Clean Up All Code/Files Associated with Old xCRG - #2890

Open
chunyuma wants to merge 1 commit into
masterfrom
issue-2825
Open

chunyuma wants to merge 1 commit into
masterfrom
issue-2825

Conversation

@chunyuma

Copy link
Copy Markdown
Collaborator

Hi all,

This PR was created to clean up the dead code/files associated with old xCRG which involves the following scripts.

Notes

  1. @edeutsch, @saramsey, @bazarkua and @hodgesf, I am sorry, since I am not sure who are now in charge of ARAX_expander.py (4 under File edited) and RTXConfiguration.py (5 under File edited). My apologies for tagging you if you are not responsible for these files, and thank you for your understanding.
  2. @isbluis, would you be available to help review araxi.js (7 under File edited)? I would appreciate your help.
  3. @dkoslicki, could you please help me review DSL_Documentation.md (6 under File edited) and test_ARAX_infer.py (3 under File edited)? I would appreciate your help.
  4. @not43s, I am not sure whether you want to review all, but please feel free to review whether any of them affects your new xCRG. I would appreciate any feedback you may have.

Could you all please make sure these changes look good, although they now have passed the non-slow tests? I appreciate everybody's help.

Files Deleted

File Description
code/ARAX/ARAXQuery/Infer/scripts/creativeCRG.py Old ML prediction engine — loaded embeddings, ran Random Forest, extracted paths via KP queries
code/ARAX/ARAXQuery/Infer/scripts/refresh_CRG_data.py Script to refresh model embeddings against new NodeSynonymizer
code/ARAX/ARAXQuery/Infer/README.md Documentation for old xCRG (model training details, etc.)
xCRG_data/decreased_NGD_score_dist.png NGD distribution plot for xCRG model
xCRG_data/decreased_prob_dist.png Probability distribution plot for xCRG model
xCRG_data/increased_NGD_score_dist.png NGD distribution plot for xCRG model
xCRG_data/increased_prob_dist.png Probability distribution plot for xCRG model
xCRG_data/chemical_gene_embeddings_v1.0.KG2.10.0_refreshedTo_KG2.10.2.npz GraphSage node embeddings for xCRG model
xCRG_data/xcrg_increase_model_v1.0.KG2.10.0_new_version.pt Random Forest model for "increase" prediction of xCRG
xCRG_data/xcrg_decrease_model_v1.0.KG2.10.0_new_version.pt Random Forest model for "decrease" prediction of xCRG

Files Edited

1. code/ARAX/ARAXQuery/ARAX_infer.py

What was removed:

  • from creativeCRG import creativeCRG import
  • from openapi_server.models.qualifier import Qualifier / QualifierConstraint imports (only used by xCRG)
  • 'chemical_gene_regulation_graph_expansion' from allowable_actions set
  • All xCRG parameter descriptors (xcrg_subject_curie_info, xcrg_object_curie_info, xcrg_subject_qnode_id, xcrg_object_qnode_id, xcrg_qedge_id_info, xcrg_regulation_type, xcrg_n_result_curies_info, xcrg_threshold, xcrg_kp, xcrg_path_len, xcrg_n_paths_info)
  • The entire command_definitions['chemical_gene_regulation_graph_expansion'] block
  • The entire __chemical_gene_regulation_graph_expansion() method

2. code/ARAX/ARAXQuery/Infer/scripts/infer_utilities.py

What was removed:

  • The entire genrete_regulate_subgraphs() method — built TRAPI knowledge graphs from old xCRG predictions

3. code/ARAX/test/test_ARAX_infer.py

What was removed:

  • test_xcrg_infer_bomeol — tested DSL-based xCRG with subject chemical
  • test_xcrg_with_qg1 — tested xCRG with query graph (gene pinned)
  • test_xcrg_with_qg2 — tested xCRG with query graph (chemical pinned, decreased direction)
  • test_xcrg_with_only_qg — tested xCRG with TRAPI-only query (no DSL)
  • test_xcrg_infer_dsl — tested xCRG with DSL + overlay + resultify pipeline

4. code/ARAX/ARAXQuery/ARAX_expander.py

What was removed:

  • The elif set(["biolink:affects"]).intersection(set(qedge.predicates)) block — this was the old routing path that dispatched inferred biolink:affects queries to ARAXInfer for chemical_gene_regulation_graph_expansion. It is safe to be deleted. The ARAX_query_graph_interpreter.py now intercepts all xCRG-eligible queries via is_xcrg_mvp2_query() and routes them to connect(action=xcrg) before they ever reach ARAX_expander.py.

5. code/RTXConfiguration.py

What was removed:

  • legacy_xcrg_data_dir variable
  • self.xcrg_embeddings_path attribute
  • self.xcrg_increase_model_path attribute
  • self.xcrg_decrease_model_path attribute
  • Associated comment block

6. code/ARAX/Documentation/DSL_Documentation.md

What was removed:

  • Table of contents entry for infer(action=chemical_gene_regulation_graph_expansion)
  • The entire ### infer(action=chemical_gene_regulation_graph_expansion) section with all parameter documentation

7. code/UI/interactive/araxi.js

What was removed:

  • The entire "infer(action=chemical_gene_regulation_graph_expansion)" JSON block with all parameter definitions

8. .gitignore

What was removed:

  • code/ARAX/ARAXQuery/Infer/data/xCRG_data/*.pt
  • code/ARAX/ARAXQuery/Infer/data/xCRG_data/*.npz

@isbluis

isbluis commented Sep 18, 2026

Copy link
Copy Markdown
Member

The change to araxi.js looks fine to me.

Of note, this file is typically generated from the self-documentation provided by the various components, and it seems that you also updated that in ARAX_infer.py, so it should be fine going forward.

@hodgesf

hodgesf commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Hi Chunyu,

have you had an opportunity to run ARAX locally and check that it functions as expected after all of these removals/edits??

Happy to help with that if needed.

@chunyuma

Copy link
Copy Markdown
Collaborator Author

Hi Frankie @hodgesf,

I didn't deploy ARAX locally but only run all non-slow tests, I would greatly appreciate if you could help with checking. Thank you!

@dkoslicki

Copy link
Copy Markdown
Member

@chunyuma regarding the DSL documentation, this is autogenerated via https://github.com/RTXteam/RTX/blob/master/code/ARAX/Documentation/document_dsl_commands.py. Is that what you ran to make the DSL markdown document edits? If not, you likely don't want to manually edit the DSL documentation, as it will get stomped on the next time the document_dsl_commands.py documentation script is run

@chunyuma

Copy link
Copy Markdown
Collaborator Author

@dkoslicki, it is not autogenerated via script but should be exactly the same because the removed part in the document is all from the old xCRG module (which has been entirely removed including its document content). I show it here to let you know what was updated in the document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants