lamindb.dev.HasParents#
- class lamindb.dev.HasParents#
Bases:
object
Base class for hierarchical methods.
Attributes
Methods
- view_parents(field=None, with_children=False, distance=5)#
View parents in a graph.
- Parameters:
field (
Optional
[TypeVar
(StrField
,str
,DeferredAttribute
)], default:None
) – Field to display on graphwith_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), …
See also
Examples
>>> import lnschema_bionty as lb >>> lb.Tissue.from_bionty(name="subsegmental bronchus").save() >>> record = lb.Tissue.filter(name="respiratory tube").one() >>> record.view_parents() >>> tissue.view_parents(with_children=True)