-
Notifications
You must be signed in to change notification settings - Fork 8
Option to impute SNPs #46
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: main
Are you sure you want to change the base?
Conversation
it seems that only the NSNPX types are used, so I'll be externally figuring out e.g. indel length
hashing Coordinate still doesn't work
nucleotide mutations need to be consolidated
merge from master
update from master
instead of looping through backwards and deleting on the way (which requires lots of moving around), just loop through forwards and add to the end as necessary
written by chatgpt
also factored out some functions from the fasta printers so that I could use them
especially don't copy the sequence when passing it through the functions
update from master
|
You can ignore the |
|
Ahhh I triple-checked and I must've broken something. The imputation isn't working like it was yesterday. |
|
nevermind it is all good |
This PR adds a
--imputeoption which will impute all substitutions to ambiguous bases, given that the parental state is consistent with the ambiguity. (For example,Nmay be any non-gap character, but Y may only beCorT.) It erases these mutations from the relevant nodes. Having the ambiguity never be introduced is the most parsimonious scenario. If aNucMutconsists of ambiguous and non-ambiguous bases, the non-ambiguous bases are retained, and merged together if consecutive.Besides creating
impute.cppand adding the necessary lines topanman.hpp, I also introduce various small conveniences. Examples:NucMuts now have functions such as.getNucCode(int i)to do the bitshift lookup of the base at a given position, or.length()to do the bitshift lookup of the length of the mutation. I changed code elsewhere to use these new helper functions, which improves readability and follows the principle of DRY.Coordinatewhich stores just a position and may be made by copying off aNucMut. I use this struct to speed upconsolidateNucMutations()by converting it to use anunordered_map.sequence_t). These were used in two separate FASTA-printing functions, and I use them for my imputation function.I also perform one unambiguous bugfix, in
mergeNodes(), which now e.g. updates theparentattribute of all new children.