Registry {laminr} | R Documentation |
A registry in a module.
module
(Module)
The instance the registry belongs to.
name
(character(1)
)
The API for the instance.
class_name
(character(1)
)
The class name for the registry.
is_link_table
(logical(1)
)
Whether the registry is a link table.
new()
Creates an instance of this R6 class. This class should not be instantiated directly,
but rather by connecting to a LaminDB instance using the connect()
function.
Registry$new(instance, module, api, registry_name, registry_schema)
instance
The instance the registry belongs to.
module
The module the registry belongs to.
api
The API for the instance.
registry_name
The name of the registry.
registry_schema
The schema for the registry.
get()
Get a record by ID or UID.
Registry$get(id_or_uid, include_foreign_keys = FALSE, verbose = FALSE)
id_or_uid
The ID or UID of the record.
include_foreign_keys
Logical, whether to include foreign keys in the record.
verbose
Logical, whether to print verbose output.
A Record object.
df()
Get a data frame summarising records in the registry
Registry$df(limit = 100, verbose = FALSE)
limit
Maximum number of records to return
verbose
Boolean, whether to print progress messages
A data.frame containing the available records
from_df()
Create a record from a data frame
Registry$from_df(dataframe, key = NULL, description = NULL, run = NULL)
dataframe
The data.frame
to create a record from
key
A relative path within the default storage
description
A string describing the record
run
A Run
object that creates the record
Creating records is only possible for the default instance, requires the
Python lamindb
module and is only implemented for the core Artifact
registry.
A TemporaryRecord
object containing the new record. This is not
saved to the database until temp_record$save()
is called.
from_path()
Create a record from a path
Registry$from_path(path, key = NULL, description = NULL, run = NULL)
path
Path to create a record from
key
A relative path within the default storage
description
A string describing the record
run
A Run
object that creates the record
Creating records is only possible for the default instance, requires the
Python lamindb
module and is only implemented for the core Artifact
registry.
A TemporaryRecord
object containing the new record. This is not
saved to the database until temp_record$save()
is called.
from_anndata()
Create a record from an AnnData
Registry$from_anndata(adata, key = NULL, description = NULL, run = NULL)
adata
The anndata::AnnData object to create a record from
key
A relative path within the default storage
description
A string describing the record
run
A Run
object that creates the record
Creating records is only possible for the default instance, requires the
Python lamindb
module and is only implemented for the core Artifact
registry.
A TemporaryRecord
object containing the new record. This is not
saved to the database until temp_record$save()
is called.
get_fields()
Get the fields in the registry.
Registry$get_fields()
A list of Field objects.
get_field()
Get a field by name.
Registry$get_field(field_name)
field_name
The name of the field.
A Field object.
get_field_names()
Get the field names in the registry.
Registry$get_field_names()
A character vector of field names.
get_record_class()
Get the record class for the registry.
Note: This method is intended for internal use only and may be removed in the future.
Registry$get_record_class()
A Record class.
get_temporary_record_class()
Get the temporary record class for the registry.
Note: This method is intended for internal use only and may be removed in the future.
Registry$get_temporary_record_class()
A TemporaryRecord
class.
print()
Print a Registry
Registry$print(style = TRUE)
style
Logical, whether the output is styled using ANSI codes
A character vector
to_string()
Create a string representation of a Registry
Registry$to_string(style = FALSE)
style
Logical, whether the output is styled using ANSI codes
A cli::cli_ansi_string
if style = TRUE
or a character vector