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.
A range of modifications for better code, easier maintenance and some convienience utilities:
New features
Taxonomy.copy()
method as a shorthand forcopy.deepcopy(Taxonomy)
inplace
argument toTaxonomy
methodsfilterRanks()
andprune()
, allowing chose whether to return a modified deepcopy of the instance od modifiy it in placeImprovements
Taxonomy.filter()
method will now return aValueError
when attempting to useroot
rank in the filtering instead of creating new root NodesPending deprecation
Taxonomy.from_json
will be removed in 3.0.0, it is replaced byread_json
, a module level constructor.load
will be removed in 3.0.0, it is replaced byread_json
, a module level constructor.Taxonomy.from_taxdump
will be removed in 3.0.0, it is replaced byread_taxdump
, a module level constructor.load_ncbi
will be removed in 3.0.0, it is replaced byread_ncbi
, a better-named module level constructor.Bug Fix
Taxonomy.listDescendant
now does filter output based on the ranks parameterNode.node_info
output to actually use newlines instead of printing '\n'