Aligner
- class Aligner(force_download=None)[source]
Bases:
object
A class for aligning new registries.
Instantiate the aligner.
Attributes Summary
Set this if there's another part of the data besides the ID that should be matched
Keyword arguments to pass to the getter function on call
Should new entries be included automatically? Only set this true for aligners of very high confidence (e.g., OBO Foundry but not BioPortal)
Get the internal registry.
Set to true if you don't want to align to deprecated resources
Methods Summary
align
([dry, show, force_download])Align and output the curation sheet.
cli
()Construct a CLI for the aligner.
get_curation_row
(external_id, external_entry)Get a sequence of items that will be ech row in the curation table.
get_curation_table
(**kwargs)Get the curation table as a string, built by
tabulate
.get_skip
()Get the mapping prefixes that should be skipped to their reasons (strings).
prepare_external
(external_id, external_entry)Prepare a dictionary to be added to the bioregistry for each external registry entry.
print_curation_table
(**kwargs)Print the curation table.
Write the curation table to a TSV.
Write the internal registry.
Attributes Documentation
- alt_key_match: ClassVar[Optional[str]] = None
Set this if there’s another part of the data besides the ID that should be matched
- getter_kwargs: ClassVar[Optional[Mapping[str, Any]]] = None
Keyword arguments to pass to the getter function on call
- include_new: ClassVar[bool] = False
Should new entries be included automatically? Only set this true for aligners of very high confidence (e.g., OBO Foundry but not BioPortal)
- skip_deprecated: ClassVar[bool] = False
Set to true if you don’t want to align to deprecated resources
Methods Documentation
- classmethod align(dry=False, show=False, force_download=None)[source]
Align and output the curation sheet.
- get_curation_row(external_id, external_entry)[source]
Get a sequence of items that will be ech row in the curation table.
- Parameters
external_id – The external registry identifier
external_entry – The external registry data
- Return type
- Returns
A sequence of cells to add to the curation table.
The default implementation of this function iterates over all of the keys in the class variable
curation_header
and looks inside each record for those in order.Note
You don’t need to pass the external ID. this will automatically be the first element.