Revision#2
Merged
Merged
Conversation
Agent-Logs-Url: https://github.com/WGLab/ContextScore/sessions/9fe5e3cf-5118-49c5-b220-efe028ef0af2 Co-authored-by: jonperdomo <14855676+jonperdomo@users.noreply.github.com>
Agent-Logs-Url: https://github.com/WGLab/ContextScore/sessions/a9571794-14b8-438c-8fca-e6888a3dd9a2 Co-authored-by: jonperdomo <14855676+jonperdomo@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/WGLab/ContextScore/sessions/3245ebf7-353e-4639-9e2a-9443e1743e09 Co-authored-by: jonperdomo <14855676+jonperdomo@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an installable/CI-tested ContextScore package, including the SV feature-extraction + scoring pipeline, a full-model training script, and a pytest suite to validate key prediction/IO helpers.
Changes:
- Introduces
contextscore.predictCLI/scoring flow (VCF→BED→feature extraction→model scoring→VCF filtering) plus supporting helpers (model/ANNOVAR resolution, gz/plain VCF handling). - Adds
contextscore.extract_featureswith annotation lookups and additional engineered features, plus a largetrain_full_model.pytraining/evaluation script. - Adds packaging/CI scaffolding (setup.py, MANIFEST, conda recipe, env file, GitHub Actions workflow) and new pytest coverage.
Reviewed changes
Copilot reviewed 18 out of 23 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_predict_io.py |
Adds end-to-end-ish scoring/IO tests around gz VCF reading and predict.score() outputs. |
tests/test_predict_helpers.py |
Adds unit tests for model/ANNOVAR path resolution, plotting-import behavior, and fixture presence. |
tests/test_extract_features_helpers.py |
Adds unit tests for chromosome normalization and BED→ANNOVAR input conversion edge cases. |
tests/conftest.py |
Adds path setup to allow importing the package in tests. |
contextscore/predict.py |
Implements scoring CLI, VCF parsing, model inference, adaptive thresholding, and filtered VCF emission. |
contextscore/extract_features.py |
Implements feature extraction and annotation plumbing (bedtools + ANNOVAR) plus engineered neighborhood/breakpoint features. |
contextscore/train_full_model.py |
Adds full training/evaluation script with CV, weighting, and optional plotting/SHAP paths. |
contextscore/download_tables.py |
Adds a helper script to download UCSC tables into BED files. |
contextscore/__main__.py |
Enables python -m contextscore entrypoint. |
contextscore/TrainingAnnotationsSummary.tsv |
Adds a training summary TSV artifact. |
setup.py |
Adds setuptools packaging, dependencies, entrypoint, and attempts to package data/ files. |
MANIFEST.in |
Includes README/LICENSE and recursively includes data/. |
README.md |
Expands project documentation (installation, ANNOVAR setup, workflow, annotation sources). |
pytest.ini |
Configures pytest discovery for tests/. |
environment.yml |
Adds a conda environment definition for local dev/CI. |
conda/meta.yaml |
Adds a conda recipe for building/installing the package. |
.github/workflows/unit-tests.yml |
Adds CI to create the conda env and run pytest. |
.gitignore |
Adds ignores for outputs/fixtures artifacts and data/. |
.vscode/settings.json |
Adds VS Code pytest settings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+560
to
+567
| # Relax threshold for larger SVs | ||
| abs_svlen = abs(svlen_match) | ||
| if abs_svlen is not None and abs_svlen > 10000: | ||
| type_threshold = 0.1 * type_threshold | ||
|
|
||
| # Keep if larger than threshold or >100kb and not deletion | ||
| should_keep = confidence_score >= type_threshold or (abs_svlen is not None and abs_svlen > 100000) | ||
|
|
Comment on lines
+149
to
+154
| def test_generated_predictions_include_multiple_svtypes(): | ||
| assert PREDICTIONS_TSV.exists() | ||
| predictions_df = pd.read_csv(PREDICTIONS_TSV, sep='\t') | ||
|
|
||
| assert predictions_df['sv_type_str'].nunique() >= 2 | ||
| assert {'DEL', 'INS'}.issubset(set(predictions_df['sv_type_str'].unique())) |
| --annovar /path/to/annovar --annovar-db /path/to/humandb | ||
| ``` | ||
|
|
||
| ## Sources for additional annotations (under `data/` directory): |
Comment on lines
+5
to
+10
| PROJECT_ROOT = Path(__file__).resolve().parent | ||
| DATA_FILES = [ | ||
| path.relative_to(PROJECT_ROOT).as_posix() | ||
| for path in (PROJECT_ROOT / "data").glob("*") | ||
| if path.is_file() | ||
| ] |
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.
No description provided.