fixed bug when some node labels are blank in read.beast #63
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.
Hi Yu,
I was trying to read in trees generated in BEAST using the MultiTypeTree package using the
read.beast
method and I noticed the data was not being read correctly. My trees had node labels for only some of the nodes (with node nodes having blank labels) andread.beast
was getting confused about which data corresonds to which node. See the following example (the example usesread.beast.newick
but this also applies forread.beast
:Note how there are two rows where the 'node' column is 5.
I fixed this by setting pseudo node labels to blank labels (like when the labels are completely blank). There will still be an issue if there are duplicate node labels or node labels are similar to the psuedo labels. With the example above my fix gives the correct:
I also fixed a dependency issue with
filenamer::filename
andpurrr::is_numeric
in the internal functions forread.beast
.