Connect to a LaminDB instance using the connect() function.
The instance object provides access to the modules and registries
of the instance.
Details
Note that by connecting to an instance via connect(), you receive
a "richer" version of the Instance class documented here, providing
direct access to all core registries and additional modules.
See the vignette on "Package Architecture" for more information:
vignette("architecture", package = "laminr").
Active bindings
is_default
(logical(1))
Whether this is the default instance.
Methods
Method 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.
Usage
Instance$new(settings, api, schema, is_default, py_lamin)
Arguments
settings
The settings for the instance
api
The API for the instance
schema
The schema for the instance
is_default
Logical, whether this is the default instance
py_lamin
A Python lamindb module object
Method get_modules()
Get the modules for the instance.
Returns
A list of Module objects.
Method get_module()
Get a module by name.
Usage
Instance$get_module(module_name)
Arguments
module_name
The name of the module.
Method get_module_names()
Get the names of the modules. Example: c("core", "bionty").
Usage
Instance$get_module_names()
Returns
A character vector of module names.
Method get_settings()
Get instance settings.
Note: This method is intended for internal use only and may be removed in the future.
Returns
The settings for the instance.
Method get_api()
Get instance API.
Note: This method is intended for internal use only and may be removed in the future.
Returns
The API for the instance.
Method get_py_lamin()
Get the Python lamindb module
Usage
Instance$get_py_lamin(check = FALSE, what = "This functionality")
Arguments
check
Logical, whether to perform checks
what
What the python module is being requested for, used in check
messages
Returns
Python lamindb module.
Method track()
Start a run with tracked data lineage
Usage
Instance$track(transform = NULL, path = NULL)
Arguments
transform
UID specifying the data transformation
path
Path to the R script or document to track
Details
Calling track() with transform = NULL with return a UID, providing
that UID with the same path with start a run
Method finish()
Finish a tracked run
Print an Instance
Usage
Instance$print(style = TRUE)
Arguments
style
Logical, whether the output is styled using ANSI codes
Method to_string()
Create a string representation of an Instance
Usage
Instance$to_string(style = FALSE)
Arguments
style
Logical, whether the output is styled using ANSI codes
Returns
A cli::cli_ansi_string if style = TRUE or a character vector
Examples
if (FALSE) { # \dontrun{
# Connect to an instance
db <- connect("laminlabs/cellxgene")
# fetch an artifact
artifact <- db$Artifact$get("MkRm3eUKPwfnAyZMWD9v")
# describe the artifact
artifact$describe()
# view field
artifact$id
# load dataset
artifact$load()
} # }