lamindb.core.HasParents

class lamindb.core.HasParents

Bases: object

Base class for hierarchical registries (ontologies).

Attributes

Methods

view_parents(field=None, with_children=False, distance=5)

View parents in a graph.

Parameters:
  • field (str | DeferredAttribute | None, default: None) – Field to display on graph

  • with_children (bool, default: False) – Also show children.

  • distance (int, default: 5) – Maximum distance still shown.

There are two types of registries with a parents field:

  • Ontological hierarchies: ULabel (project & sub-project), CellType (cell type & subtype), …

  • Procedural/temporal hierarchies: Transform (preceding transform & successing transform), …

Examples

>>> import bionty as bt
>>> bt.Tissue.from_public(name="subsegmental bronchus").save()
>>> record = bt.Tissue.filter(name="respiratory tube").one()
>>> record.view_parents()
>>> tissue.view_parents(with_children=True)