Skip to content

Bugfix/bencap/40/multi variant transcript ids fail regex validation#42

Merged
afrubin merged 4 commits intomainfrom
bugfix/bencap/40/multi-variant-transcript-ids-fail-regex-validation
May 6, 2025
Merged

Bugfix/bencap/40/multi variant transcript ids fail regex validation#42
afrubin merged 4 commits intomainfrom
bugfix/bencap/40/multi-variant-transcript-ids-fail-regex-validation

Conversation

@afrubin
Copy link
Member

@afrubin afrubin commented May 6, 2025

No description provided.

bencap and others added 4 commits April 3, 2025 11:39
Adds a `components` method to the Variant class which is a tuple
of fully qualified variant strings that comprises the current variant
object. The `format_variant` function was refactored into a new
function `_format_component_variants`, which returns a list of the
component variants of a Variant object. In turn, the __repr__ function
uses this class function to return the variant string representation.
The `components` method returns the result of this new internal
formatting function, with the prefix and transcript identifier prepended
to each variant string.

For multi-variants, each tuple element is parsable into a single-variant
Variant object which comprises the original multi-variant. For single-
variants, the single element tuple contains the original variant string.
Fixes an issue where the target identifier string was not captured for multi-variants,
which was causing regex validation to fail in cases where the multi-variant had a
target identifier. To fix this change, an additional capture group `<variant>` was
added as a wrapper around the `<single_variant>` and `<multi_variant>` capture groups.
The regex expression was treating the boolean expression as

```
(<target>:<single_variant>)|<multi_variant>
```
and now treats it as
```
<target>:(<single_variant>|<multi_variant>)
```

Additional test cases were added to better capture these potential issues with regex
validation of multi-variant (and single-variant) variants in the future.
@afrubin afrubin merged commit 6969800 into main May 6, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants