Instance {laminr} | R Documentation |
Connect to a LaminDB instance using the connect()
function.
The instance object provides access to the modules and registries
of the instance.
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")
.
is_default
(logical(1)
)
Whether this is the default instance.
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.
Instance$new(settings, api, schema, is_default, py_lamin)
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
get_modules()
Get the modules for the instance.
Instance$get_modules()
A list of Module objects.
get_module()
Get a module by name.
Instance$get_module(module_name)
module_name
The name of the module.
The Module object.
get_module_names()
Get the names of the modules. Example: c("core", "bionty")
.
Instance$get_module_names()
A character vector of module names.
get_settings()
Get instance settings.
Note: This method is intended for internal use only and may be removed in the future.
Instance$get_settings()
The settings for the instance.
get_api()
Get instance API.
Note: This method is intended for internal use only and may be removed in the future.
Instance$get_api()
The API for the instance.
get_py_lamin()
Get the Python lamindb module
Instance$get_py_lamin(check = FALSE, what = "This functionality")
check
Logical, whether to perform checks
what
What the python module is being requested for, used in check messages
Python lamindb module.
track()
Start a run with tracked data lineage
Instance$track(transform = NULL, path = NULL)
transform
UID specifying the data transformation
path
Path to the R script or document to track
Calling track()
with transform = NULL
with return a UID, providing
that UID with the same path with start a run
finish()
Finish a tracked run
Instance$finish()
print()
Print an Instance
Instance$print(style = TRUE)
style
Logical, whether the output is styled using ANSI codes
to_string()
Create a string representation of an Instance
Instance$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
## Not run:
# Connect to an instance
db <- connect("laminlabs/cellxgene")
# fetch an artifact
artifact <- db$Artifact$get("KBW89Mf7IGcekja2hADu")
# describe the artifact
artifact$describe()
# view field
artifact$id
# load dataset
artifact$load()
## End(Not run)