Skip to content

Commit

Permalink
Version 0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
apcamargo committed Mar 15, 2020
1 parent c77c977 commit d82d6e3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

setup(
name="taxopy",
version="0.2.0",
version="0.2.1",
packages=find_packages(),
license="GNU General Public License v3.0",
description="A Python package for obtaining complete lineages and the lowest common ancestor (LCA) from a set of taxonomic identifiers.",
Expand Down
2 changes: 1 addition & 1 deletion taxopy/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def __init__(self, taxid: str, taxdb: TaxDb):
)

def __repr__(self):
return " -> ".join(reversed(self.name_lineage))
return " > ".join(reversed(self.name_lineage))

def _find_lineage(self, taxid2parent):
lineage = []
Expand Down
8 changes: 4 additions & 4 deletions taxopy/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ def find_majority_vote(taxon_list: list, taxdb: TaxDb):
Raises
------
MajorityVoteError
If the input list has less than three Taxon objects.
If the input list has less than two Taxon objects.
"""
if len(taxon_list) < 3:
if len(taxon_list) < 2:
raise MajorityVoteError(
"The input list must contain at least three Taxon objects."
"The input list must contain at least two Taxon objects."
)
n_taxa = len(taxon_list)
zipped_taxid_lineage = zip_longest(*[reversed(i.taxid_lineage) for i in taxon_list])
for taxonomic_level in reversed(list(zipped_taxid_lineage)):
majority_taxon = Counter(taxonomic_level).most_common()[0]
if majority_taxon[1] > n_taxa / 2:
if majority_taxon[0] and majority_taxon[1] > n_taxa / 2:
return Taxon(majority_taxon[0], taxdb)

0 comments on commit d82d6e3

Please sign in to comment.