pangea.contrib.treeoflife package

Submodules

pangea.contrib.treeoflife.admin module

pangea.contrib.treeoflife.apps module

class pangea.contrib.treeoflife.apps.TreeOfLifeConfig(app_name, app_module)[source]

Bases: django.apps.config.AppConfig

name = 'treeoflife'

pangea.contrib.treeoflife.constants module

pangea.contrib.treeoflife.mixins module

class pangea.contrib.treeoflife.mixins.BiotaMixin(*args, **kwargs)[source]

Bases: pangea.contrib.treeoflife.mixins.MicrobeMixin

Fields available in Bacteria, Archaea, & Fungi but not Virus.

class Meta[source]

Bases: object

abstract = False
biofilm_forming

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

halotolerance

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

salinity_concentration_range_w_v

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class pangea.contrib.treeoflife.mixins.MicrobeMixin(*args, **kwargs)[source]

Bases: django.db.models.base.Model

Fields available in Bacteria, Archaea, Fungi, & Viruses.

class Meta[source]

Bases: object

abstract = False
animal_pathogen

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

antimicrobial_susceptibility

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

extreme_environment

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

human_commensal

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

optimal_ph

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

optimal_temperature

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

pathogenicity

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

plant_pathogen

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

spore_forming

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class pangea.contrib.treeoflife.mixins.MoneraMixin(*args, **kwargs)[source]

Bases: pangea.contrib.treeoflife.mixins.BiotaMixin

Fields available in Bacteria & Archaea, but not Fungi or Virus.

class Meta[source]

Bases: object

abstract = False
drylands

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

gram_stain

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

high_ph

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

low_ph

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

low_productivity

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

psychrophilic

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

radiophilic

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

pangea.contrib.treeoflife.models module

class pangea.contrib.treeoflife.models.Archaea(created_at, updated_at, human_commensal, antimicrobial_susceptibility, optimal_temperature, extreme_environment, optimal_ph, animal_pathogen, spore_forming, pathogenicity, plant_pathogen, salinity_concentration_range_w_v, biofilm_forming, halotolerance, low_ph, high_ph, drylands, low_productivity, gram_stain, psychrophilic, radiophilic, uuid, taxon_id, tree_node)[source]

Bases: pangea.contrib.treeoflife.models.MicrobeDirectoryEntry, pangea.contrib.treeoflife.mixins.MoneraMixin

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

objects = <django.db.models.manager.Manager object>
tree_node

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

tree_node_id
class pangea.contrib.treeoflife.models.Bacteria(created_at, updated_at, human_commensal, antimicrobial_susceptibility, optimal_temperature, extreme_environment, optimal_ph, animal_pathogen, spore_forming, pathogenicity, plant_pathogen, salinity_concentration_range_w_v, biofilm_forming, halotolerance, low_ph, high_ph, drylands, low_productivity, gram_stain, psychrophilic, radiophilic, uuid, taxon_id, tree_node)[source]

Bases: pangea.contrib.treeoflife.models.MicrobeDirectoryEntry, pangea.contrib.treeoflife.mixins.MoneraMixin

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

objects = <django.db.models.manager.Manager object>
tree_node

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

tree_node_id
class pangea.contrib.treeoflife.models.Fungi(created_at, updated_at, human_commensal, antimicrobial_susceptibility, optimal_temperature, extreme_environment, optimal_ph, animal_pathogen, spore_forming, pathogenicity, plant_pathogen, salinity_concentration_range_w_v, biofilm_forming, halotolerance, uuid, taxon_id, tree_node)[source]

Bases: pangea.contrib.treeoflife.models.MicrobeDirectoryEntry, pangea.contrib.treeoflife.mixins.BiotaMixin

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

objects = <django.db.models.manager.Manager object>
tree_node

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

tree_node_id
class pangea.contrib.treeoflife.models.MicrobeDirectoryEntry(*args, **kwargs)[source]

Bases: pangea.core.mixins.AutoCreatedUpdatedMixin

class Meta[source]

Bases: object

abstract = False
as_dict()[source]

Return a dict of annotations.

taxon_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

uuid

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class pangea.contrib.treeoflife.models.TaxonName(created_at, updated_at, uuid, taxon_id, name, name_type)[source]

Bases: pangea.core.mixins.AutoCreatedUpdatedMixin

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

name_type

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
taxon_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

tree_node
uuid

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

class pangea.contrib.treeoflife.models.TreeNode(created_at, updated_at, uuid, taxon_id, parent, rank)[source]

Bases: pangea.core.mixins.AutoCreatedUpdatedMixin

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

all_names
ancestors(reducer=<function TreeNode.<lambda>>)[source]

Return a list of TreeNodes that are ancestors of this node.

Start with this node.

annotation
archaea_annotation_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

bacteria_annotation_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

classmethod byname(name)[source]
canon_name
children

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

fungi_annotation_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

is_root
objects = <django.db.models.manager.Manager object>
parent

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

parent_id
rank

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

taxon_id

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

uuid

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

virus_annotation_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Parent.children is a ReverseManyToOneDescriptor instance.

Most of the implementation is delegated to a dynamically defined manager class built by create_forward_many_to_many_manager() defined below.

class pangea.contrib.treeoflife.models.Virus(created_at, updated_at, human_commensal, antimicrobial_susceptibility, optimal_temperature, extreme_environment, optimal_ph, animal_pathogen, spore_forming, pathogenicity, plant_pathogen, uuid, taxon_id, tree_node, virus_name, virus_lineage, kegg_genome, kegg_disease, disease, host_name, host_lineage)[source]

Bases: pangea.contrib.treeoflife.models.MicrobeDirectoryEntry, pangea.contrib.treeoflife.mixins.MicrobeMixin

exception DoesNotExist

Bases: django.core.exceptions.ObjectDoesNotExist

exception MultipleObjectsReturned

Bases: django.core.exceptions.MultipleObjectsReturned

disease

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

host_lineage

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

host_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

kegg_disease

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

kegg_genome

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

objects = <django.db.models.manager.Manager object>
tree_node

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

In the example:

class Child(Model):
    parent = ForeignKey(Parent, related_name='children')

Child.parent is a ForwardManyToOneDescriptor instance.

tree_node_id
virus_lineage

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

virus_name

A wrapper for a deferred-loading field. When the value is read from this object the first time, the query is executed.

pangea.contrib.treeoflife.taxa_tree module

class pangea.contrib.treeoflife.taxa_tree.TaxaTree[source]

Bases: object

static ancestor_rank(rank, taxon, default=None)[source]

Return the ancestor of taxon at the given rank.

static ancestors(taxon)[source]

Return a list of all ancestors of the taxon starting with the taxon itself.

static get_taxon_parent_lists(taxa)[source]

Return a pair of lists giving the name of each taxon and its parent.

Give an empty string as the parent of the root.

This function is used to prepare data for a Plotly suburst plot.

static ranked_ancestors(taxon)[source]

Return a dict of all ancestors of the taxon starting with the taxon itself. Keys of the dict are taxon ranks

pangea.contrib.treeoflife.urls module

pangea.contrib.treeoflife.urls.path(route, view, kwargs=None, name=None, *, Pattern=<class 'django.urls.resolvers.RoutePattern'>)

pangea.contrib.treeoflife.utils module

pangea.contrib.treeoflife.utils.populate_md2(limit=-1, exclude_bact=False)[source]
pangea.contrib.treeoflife.utils.save_archaea(tree_node, row)[source]
pangea.contrib.treeoflife.utils.save_bacteria(tree_node, row)[source]
pangea.contrib.treeoflife.utils.save_euk(tree_node, row)[source]
pangea.contrib.treeoflife.utils.save_virus(tree_node, row)[source]

pangea.contrib.treeoflife.views module

pangea.contrib.treeoflife.views.annotate_taxa(self, request, *args, **kwargs)[source]

Reply with annotations for the taxa.

pangea.contrib.treeoflife.views.fuzzy_correct_taxa_names(self, request, *args, **kwargs)[source]

Reply with alternate taxa names.

pangea.contrib.treeoflife.views.get_ancestors(self, request, *args, **kwargs)[source]

Reply with ancestor taxa.

pangea.contrib.treeoflife.views.get_descendants(self, request, *args, **kwargs)[source]

Reply with descendant taxa.

Module contents