Open
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
Author
|
You can ignore the |
Author
|
Ahhh I triple-checked and I must've broken something. The imputation isn't working like it was yesterday. |
Author
|
nevermind it is all good |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.