Skip to contents

Introduction

This vignette provides more detailed instructions for how to set up {laminr}.

Installing {laminr}

The {laminr} package can be installed from CRAN:

Additional packages

Some functionality in {laminr} requires additional packages. To install all suggested dependencies use:

install.packages("laminr", dependencies = TRUE)

If you choose not to install all additional packages you will be prompted to do so as needed.

Installing Python lamindb

Using {laminr} requires that the Python lamindb package is available.

Using the included Python environment

The recommended way to use {laminr} is to connect to the included r-lamindb Python environment. This can be created using:

laminr::install_lamindb()

This should be run before the first time you load the {laminr} library. The {reticulate} package will then be told to use this environment when {laminr} is loaded.

Adding additional packages

If you want to add additional packages to the environment, these can be specified using the extra_packages argument. For example, to add the bionty package:

laminr::install_lamindb(extra_packages = "bionty")

Python packages providing additional registries that may be used in your instance:

  • bionty - Basic biological entities, coupled to public ontologies
  • cellregistry - A registry for single cells
  • clinicore - Basic clinical entities
  • findrefs - Store references to studies, reports, papers, blog posts, preprints
  • omop - OMOP Common Data Model
  • ourprojects - Manage projects and teams
  • wetlab - Basic wetlab entities

Other Python packages you may want to install:

  • s3fs - Accessing artifacts stored on Amazon S3

Installing additional Python packages also be useful if you want to use another R package which expects a particular Python module to be installed.

Using another environment

In some cases you may prefer to use another Python environment. This may be the case if you use another R package which requires a Python module or if you are managing your own Python environment.

Specifying another Python environment to use should be done before loading {laminr} using one of these methods:

Details of the current Python environment can be viewed using reticulate::py_config(). For more information about setting the active Python environment see vignette("versions", package = "reticulate") (also available here).

Adding lamindb to another environment

To install lamindb into another environment, set the envname argument:

laminr::install_lamindb(envname = "your-env")

Be aware that there may be dependency conflicts with packages already installed in the environment and installing lamindb may cause package versions to change.

Logging in to LaminDB

If you have not used LaminDB before you will need to login to access public instances. To do this you will need a user API key which you can get by logging in to LaminHub and going to your user settings.

You can then login with:

laminr::lamin_login(api_key = "your_api_key")

Switching users

If you have already given an API key for a user you can log in as them by giving the user name:

laminr::lamin_login(user = "user_handle")

Setting a default instance

Using connect(slug = NULL) will connect to the current default LaminDB instance. The default instance can be set using:

laminr::lamin_connect("<owner>/<name>")

Note that this must be called before attempting to connect to a default instance and cannot be changed once the default instance is connected.