bionty.Entity#
- class bionty.Entity(source, version=None, species=None, *, reference_id=None, include_id_prefixes=None, include_name_prefixes=None, exclude_id_prefixes=None, exclude_name_prefixes=None, **kwargs)#
Bases:
object
Biological entity as an Entity.
See Guide for background.
Attributes
- database#
Name of the source.
- ontology#
The Pronto Ontology object.
- species#
The
name
ofSpecies
Entity.
- version#
The
name
ofversion
entity Entity.
Methods
- curate(df, column=None, reference_id='ontology_id', case_sensitive=True)#
Curate index of passed DataFrame to conform with default identifier.
If
target_column
isNone
, checks the existing index for compliance with the default identifier.If
target_column
denotes an entity identifier, tries to map that identifier to the default identifier.
- Parameters:
df – The input Pandas DataFrame to curate.
column – The column in the passed Pandas DataFrame to curate.
reference_id – The reference column in the ontology Pandas DataFrame. ‘Defaults to ontology_id’.
case_sensitive – Whether the curation should be case sensitive or not. Defaults to True.
- Return type:
DataFrame
- Returns:
Returns the DataFrame with the curated index and a boolean
__curated__
column that indicates compliance with the default identifier.
- df()#
Pandas DataFrame.
- Return type:
DataFrame
- lookup(field='name')#
Return an auto-complete object for the bionty id.
- Parameters:
field – The field to lookup the values for. Adapt this parameter to, for example, ‘ontology_id’ to lookup by ID. Defaults to ‘name’.
- Return type:
tuple
- Returns:
A NamedTuple of lookup information of the entitys values.