Pull Request for NRNB issue 238: Using Foundation model for GRN Inference#127
Open
FaizalJnu wants to merge 15 commits into
Open
Pull Request for NRNB issue 238: Using Foundation model for GRN Inference#127FaizalJnu wants to merge 15 commits into
FaizalJnu wants to merge 15 commits into
Conversation
Evaluation packages updated
--use_embeddings flag uses added.
EPr update stayed
epr issue stayed 2
FInal pre testing merge
…l datasets available in datadir
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes made and files added:
BLEval folder:
1. init.py file:
InputSettings class
use_embeddingsparameter to__init__method.adjust_paths_for_embeddingsmethod to modify file paths when using embeddings.get_true_edges_pathmethod for retrieving the correct path to true edges file.OutputSettings class
datasetsanduse_embeddingsparameters to__init__method.adjust_paths_for_embeddingsmethod to modify output paths when using embeddings.get_output_pathmethod for constructing output file paths.BLEval class
computeAUCmethod to support embeddings and use the newget_true_edges_pathmethod.computeEarlyPrecmethod to support the embeddings generation by passingself.input_settingsinto theEarlyPrec()function as well.ConfigParser class
use_embeddingsparameter toparsemethod__parse_input_settingsand__parse_output_settingsmethods to support embeddingsOther improvements
from pathlib import Pathconsistently.Pathobjects for better cross-platform compatibility.2. computeDGAUC file:
In PRROC function
3. computeEarlyPrec file:
In EarlyPrec() function
Unchanged elements
Blevaluator.py file:
In config get_parser() function:
In main() function:
Post-Run Evaluation Initialization: Initialization of the evaluation summarizer (evalSummarizer) using the parsed input and output settings. This replaces any hardcoded settings with dynamic configuration, allowing for greater flexibility and adaptability.
Output Directory Construction:
The output directory is now dynamically constructed based on the evaluation settings (evalSummarizer.output_settings.base_dir, evalSummarizer.input_settings.datadir, and evalSummarizer.output_settings.output_prefix). This change ensures that the output files are stored in a well-organized directory structure that reflects the evaluation parameters.
Unchanged Logic:
The core functionality for computing and saving the AUPRC and AUROC values remains unchanged. The logic has been preserved but now exists within a more structured and configurable context.
BLRun Folder:
1. generate_embeds.py:
2. runner.py:
In generate_embeds method:
Subprocess Execution: The script is executed via a subprocess command, with robust error handling to ensure that any issues are clearly reported.
- The generateInputs() method has been updated to call generate_embeddings() when self.use_embeddings is True. This ensures that the embeddings are generated before any other input processing steps are performed.
- The run() method has been updated to ensure that the output directory is created based on the processed input directory, maintaining a clear separation of inputs and outputs.
BLRunner.py file:
The get_parser() function now includes a new command-line argument --use_embeddings, which allows users to specify whether embeddings should be used in the pipeline. This argument is a boolean flag (action='store_true'), meaning that it will default to False unless explicitly provided by the user.
The parse_arguments() function has been updated to return the parsed arguments, including the newly added use_embeddings flag. This function now serves as the entry point for all command-line configurations, ensuring that the user's preferences are respected throughout the pipeline.
Model folder:
generate_embeddings.py:
Dockerfile and req.yaml added to support a containerised environment for the embeddings generation pipeline.
Initialize.sh
ReadMe file
CORE FLOW:
The pipeline, if run with the command
will
inputs/example/GSD/ExpressionData.csv, Embeddings data will be generated and saved atinputs/example/GSD/processedExpressionData/EmbeddingsData.csvand the refNetwork.csv file will automatically be copied and saved in the processedExpressionData directory.AND, if the command used is:
Both auc and epr pipelines have been modified to be used along with the use_embeddings flag
The Evaluation pipeline will run on the GRNs we Inferred using EmbeddingsData.csv
inputs/example/GSD/processedExpressionDataandoutputs/example/GSD/processedExpressionDatarespectfully.