-
Notifications
You must be signed in to change notification settings - Fork 3
OpenVariant | New feature Multiple fields for a single plugin #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
OpenVariant | New feature Multiple fields for a single plugin #51
Conversation
Not merge yet! |
Ready! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.py
now 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_testPlugin
to 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_testPlugin
to match real code.
import .multi_test from Multi_testPlugin
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…s-for-a-single-plugin
…-plugin' of github.com:bbglab/openvariant into 50-openvariant-new-feature-multiple-fields-for-a-single-plugin
Can we merge it? or it needs revision? |
Hi David, it still needs revision and testing. We've been quite busy lately. |
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):
Now (a tuple is created as a key, it encompass multiple fields to a unique plugin function):
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
filedSource
was discarted because the field from inputs can be used as follow (and being access by the plugin):