Skip to content
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

More informative error messages when dictionaries don't match #1870

Merged
merged 4 commits into from May 11, 2023

Conversation

kachulis
Copy link
Contributor

Addresses common complaint about opaque error messages when sequence dictionaries don't match, by specifying which files the mismatched sequence dictionaries are coming from.

A recent example of this issue is #1869

@kachulis kachulis linked an issue Apr 11, 2023 that may be closed by this pull request
SequenceUtil.assertSequenceDictionariesEqual(SAMSequenceDictionaryExtractor.extractDictionary(inputPath), SAMSequenceDictionaryExtractor.extractDictionary(genotypesPath), true);
SequenceUtil.assertSequenceDictionariesEqual(SAMSequenceDictionaryExtractor.extractDictionary(inputPath), checker.getHeader().getSequenceDictionary(), true);

try {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be able to switch to SequenceDictionaryUtils.assertSequenceDictionariesEqual as well, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't change these because they use the extra checkPrefixOnly argument, which the others don't. So rather than create another overload in Picard, I left these as direct calls to htsjdk. If you think its worth it though I could add a second method for those cases though.

Copy link
Contributor Author

@kachulis kachulis May 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh, I see. No I think that's fine in that case.

throw new IllegalArgumentException("Dictionary on fingerprinted file smaller than that on Haplotype Database!");
throw new SequenceUtil.SequenceListsDifferException("Dictionary on fingerprinted file smaller than that on Haplotype Database!");
}
try {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and also this?

@kachulis
Copy link
Contributor Author

@cmnbroad looks like I can't approve this since I originally submitted it, but this looks good to me.

Copy link
Contributor

@cmnbroad cmnbroad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kachulis.

@cmnbroad cmnbroad merged commit e67fe94 into master May 11, 2023
3 checks passed
@cmnbroad cmnbroad deleted the ck_dictionary_size_check branch May 11, 2023 16:19
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.

Sequence dictionaries are not the same size
2 participants