How to use the prophyle.prophyle_otu_table.OrderedEnum function in prophyle

To help you get started, we’ve selected a few prophyle examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github prophyle / prophyle / prophyle / prophyle_otu_table.py View on Github external
if self.__class__ is other.__class__:
            return self.value > other.value
        return NotImplemented

    def __le__(self, other):
        if self.__class__ is other.__class__:
            return self.value <= other.value
        return NotImplemented

    def __lt__(self, other):
        if self.__class__ is other.__class__:
            return self.value < other.value
        return NotImplemented


class Rank(OrderedEnum):
    NO_RANK = 7
    SPECIES = 6
    GENUS = 5
    FAMILY = 4
    ORDER = 3
    CLASS = 2
    PHYLUM = 1
    KINGDOM = 0


str2rank = {
    'species': Rank.SPECIES,
    'genus': Rank.GENUS,
    'family': Rank.FAMILY,
    'order': Rank.ORDER,
    'class': Rank.CLASS,