Add optional alternative prediction bigWig and combine-aggregation for benchmark#3
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7d56e244d2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a7d84e9dcf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| alternative_prediction_array = import_bigwig_stats_array(alternative_prediction_stream, | ||
| chromosome, | ||
| chromosome_length, | ||
| agg_function, | ||
| bin_count) |
There was a problem hiding this comment.
Handle absent chromosomes in the alternative bigWig
If the optional --alternative_prediction file is missing one of the benchmarked chromosomes (for example because it uses 1/chr1 naming or omits chrM), this new code still calls stats() on that chromosome and pyBigWig raises, aborting the whole benchmark. That breaks the advertised fallback behavior of using the primary prediction when only one track has data, so the alternative stream needs a chromosome-presence check before querying it.
Useful? React with 👍 / 👎.
Motivation
Description
--alternative_predictionand--prediction_combine_operation(meanormax) to thebenchmarksubcommand inmaxatac/utilities/parser.pyand updated therun_benchmarkingentrypoint to log and pass these options to downstream code.import_bigwig_stats_array,combine_prediction_arrays, and extendedimport_prediction_array_fninmaxatac/utilities/genome_tools.pyto load stats preserving NaNs and to combine primary/alternative arrays with per-bin mean or max semantics while falling back to available values.calculate_R2_pearson_spearmanandChromosomeAUPRCinmaxatac/utilities/benchmarking_tools.pyto accept an optional alternative prediction stream and the combine operation and to use the newimport_prediction_array_fnso the combined vector is used for all downstream metrics.maxatac/analyses/benchmark.pyto pass the new arguments into both quantitative and binary benchmarking flows and added documentation indocs/readme/benchmark.mdwith an example and behavior description.tests/test_benchmark.pythat verifycombine_prediction_arraysbehavior formeanandmaxand a parser smoke test for the new CLI options.Testing
pytest -q tests/test_benchmark.pywhich produced2 passed, 1 skippedwith warnings.python -m compileall maxatac/analyses/benchmark.py maxatac/utilities/benchmarking_tools.py maxatac/utilities/genome_tools.py maxatac/utilities/parser.py tests/test_benchmark.pywhich completed successfully.Codex Task