OpenVariant | New feature Multiple fields for a single plugin#51
Open
dmartmillan wants to merge 14 commits intodevelopfrom
Open
OpenVariant | New feature Multiple fields for a single plugin#51dmartmillan wants to merge 14 commits intodevelopfrom
dmartmillan wants to merge 14 commits intodevelopfrom
Conversation
Collaborator
Author
|
Not merge yet! |
Collaborator
Author
|
Ready! |
There was a problem hiding this comment.
Pull Request Overview
This PR introduces support for plugins that target multiple output fields in a single invocation by keying plugins on tuples of field names and updating parsing, annotation loading, and documentation accordingly.
- Key changes:
- Annotation storage now uses tuple keys for multi‐field plugins and updates header extraction and parsing in
variant.py. - Annotation loader in
annotation.pynow accepts list‐style field declarations and normalizes into tuple keys. - Examples and documentation expanded to show multi‐field plugin usage and fixed sample notebooks/READMEs.
- Annotation storage now uses tuple keys for multi‐field plugins and updates header extraction and parsing in
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| openvariant/variant/variant.py | Updated header and parser logic to unpack tuple‐keyed plugins. |
| openvariant/annotation/annotation.py | Accept list fields, normalize keys, and verify columns. |
| examples/plugin_system/HGVS_decoder/init.py | Added example init for multi‐field plugin (syntax needs fix). |
| examples/plugin_system/README.md | Updated README with new plugins section (spelling error). |
| docs/user_guide/annotation_structure.rst | Expanded docs for multi‐field plugin (duplicate word issue). |
Comments suppressed due to low confidence (2)
examples/plugin_system/HGVS_decoder/init.py:1
- This import syntax is invalid; change to
from .multi_test import Multi_testPluginto correctly import the plugin class.
import .multi_test from Multi_testPlugin
docs/examples/plugin_system/HGVS_decoder/init.py:1
- Invalid import syntax in docs example; update to
from .multi_test import Multi_testPluginto match real code.
import .multi_test from Multi_testPlugin
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…s-for-a-single-plugin
…-plugin' of github.com:bbglab/openvariant into 50-openvariant-new-feature-multiple-fields-for-a-single-plugin
Collaborator
Author
|
Can we merge it? or it needs revision? |
Member
|
Hi David, it still needs revision and testing. We've been quite busy lately. |
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.
Be able to create plugins that modify multiple fields, added along with a small example and documentation explaining the use case.
The main change is how Annotation (
annotation._annotation) is stored:Previous version (each plugin has its individual field):
{ 'TYPE': ('PLUGIN', ....), 'POSITION': ('PLUGIN', ....), 'VARIANT': ('PLUGIN', ....), 'HGVS': ('INTERNAL',, ....) }Now (a tuple is created as a key, it encompass multiple fields to a unique plugin function):
{ ('TYPE', 'POSITION', 'VARIANT'): ('PLUGIN', ....), 'HGVS': ('INTERNAL', ....) }With this simple change, we can distinguish which fields are grouped under each plugin. This makes parsing straightforward, as we know which plugin function to execute and which fields it should apply to.
In the first example, the plugin is executed three times in separate processes; now, it runs just once for multiple fields.
The
filedSourcewas discarted because the field from inputs can be used as follow (and being access by the plugin):