-
Notifications
You must be signed in to change notification settings - Fork 242
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
Addresses part of issue #18, Allele class refactoring. #1370
base: master
Are you sure you want to change the base?
Conversation
More concretely it refactor the Allele class: * Is now and interface. * Added several methods to access properties from several allele types like breakends and whole contig insertions. * Disentagles the current mixture of "display" bytes vs base bytes in the bases array... now only base are stored like that if it applies. * Adds a "hidden" heriarchy of implementations for different allele subtypes. * Improves reusing instances for common variants (single base and common symbolic alleles) * Mark as deprecated several method that seem unecessary. * Disable the possibility of changing an allele bases and adds an API (BaseSequence interface) to access these efficiently wihtout the need of clonning a byte[] array each time. * Makes impossible to create alleles that have invalid base (IUPAC codes that are not allowed by the VCF spec). * Fixes (and also deprecates) some not well-though Allele method that only make sense for some subtypes of alleles. * Breakend API, access to contig, position type of breakend and base.
Allele.java diffs rather messy perhaps reviewers should consider to assess it on the changed version of the file and go back to the github diff just report what they don't like. |
Current test pass but need to add new ones, please review in the meantime. |
I'm adding test code and fixing issues in the code as I come across them, you can start reviewing the first commit only for stability. |
/** | ||
* Enumeration of possible allele types/categories. | ||
*/ | ||
public enum AlleleType { |
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.
Oups this class is actually not in use. I forgot to delete it I guess. Is not much point to it as 99.9% of the time code only know how to deal with one type so call to the corresponding isBlahBlah() method is sufficient. You can ignore this class in your review(s)
More concretely it refactor the Allele class:
wihtout the need of cloning a byte[] array each time.
Description
Please explain the changes you made here.
Explain the motivation for making this change. What existing problem does the pull request solve?
Checklist