lnschema_bionty.dev.BioRegistry#

class lnschema_bionty.dev.BioRegistry(*args, **kwargs)#

Bases: Registry, HasParents, CanValidate

Base Registry of lnschema_bionty.

BioRegistry inherits all methods from Registry and provides additional methods including bionty() and from_bionty()

Notes

For more info, see tutorials:

Fields

Methods

classmethod bionty(organism=None, bionty_source=None, **kwargs)#

The corresponding Bionty object.

e.g. lnschema_bionty.CellType.bionty() is equivalent to bionty.CellType(). Note that the public source is auto-configured and tracked via lnschema_bionty.BiontySource(). :rtype: Bionty

See also

Bionty

Examples

>>> celltype_bt = lb.CellType.bionty()
>>> celltype_bt
CellType
Organism: all
Source: cl, 2023-04-20
#terms: 2698
...
📖 CellType.df(): ontology reference table
🔎 CellType.lookup(): autocompletion of terms
🎯 CellType.search(): free text search of terms
🧐 CellType.inspect(): check if identifiers are mappable
👽 CellType.standardize(): map synonyms to standardized names
🔗 CellType.ontology: Pronto.Ontology object
classmethod from_bionty(**kwargs)#

Create a record or records from bionty based on a single field value.

Return type:

Union[BioRegistry, List[BioRegistry], None]

Notes

For more info, see tutorial lnschema_bionty

Bulk create protein records via from_values.

Examples

Create a record by passing a field value:

>>> record = lb.Gene.from_bionty(symbol="TCF7", organism="human")

Create a record from non-default source:

>>> bionty_source = lb.BiontySource.filter(entity="CellType", source="cl", version="2022-08-16").one()  # noqa
>>> record = lb.CellType.from_bionty(name="T cell", bionty_source=bionty_source)
save(parents=None, *args, **kwargs)#

Save the record and its parents recursively.

Parameters:

parents (Optional[bool], default: None) – bool = True. Whether to save parents records.

Return type:

None