-
Notifications
You must be signed in to change notification settings - Fork 94
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
Validation - refactor to be able to retrieve all errors rather than throw exception on 1st #706
Comments
I posted this in HGVS slack but it disappeared after 90 days so re-raising here |
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
I would like to be able to see all the errors, rather than throw an exception on the 1st one
Say you asked to validate 'NM_000059.4(BRCA2):c.-40+1G>C'
Now, I know - but this is biology so it's full of messy data! This is an example from ClinVar submission
If you run it with strict=True it throws HGVSInvalidVariantError "Cannot validate sequence of an intronic variant"
strict = False it returns True (as it was only a warning)
I'd like to see what errors there are - In strict you can also only see 1 issue (the first that causes an exception to be thrown) and strict=False you can see none
I think it's important to separate the concept of "Wrong" and "I can't tell whether it's wrong"
Recommendation:
Add a new method which performs validation, and returns a list of results and messages, sorted by res (ie severity)
We could re-implement the existing validate using this
If you call the new method you can then examine it for the errors you care about (or display them to the user)
For strict - go through the sorted list and throw the worst one. For the warnings (eg "Cannot validate sequence of an intronic variant" I'd throw a subclass of HGVSInvalidVariantError which indicates it's not an error but rather you can't evaluate it - can then handle client code better)
The text was updated successfully, but these errors were encountered: