lamindb.integrations

Integrations.

Functions

lamindb.integrations.save_vitessce_config(vitessce_config, key=None, description=None)

Validates and saves a VitessceConfig object.

If the VitessceConfig object references multiple artifacts, automatically creates a Collection and displays the “Vitessce button” next to it.

The VitessceConfig artifact has .suffix = ".vitessce.json" and .kind = "__lamindb_config__", which is by default hidden on the hub UI.

Guide: Vitessce.

Parameters:
  • vitessce_config (VitessceConfig) – A VitessceConfig object.

  • key (str | None, default: None) – A key for the VitessceConfig artifact.

  • description (str | None, default: None) – A description for the VitessceConfig aritifact. Is additionally used as key for a Collection in case the VitessceConfig object references multiple artifacts.

Return type:

Artifact

lamindb.integrations.save_tiledbsoma_experiment(adatas, key=None, description=None, run=None, revises=None, measurement_name='RNA', obs_id_name='obs_id', var_id_name='var_id', append_obsm_varm=False, **kwargs)

Write AnnData to tiledbsoma.Experiment.

Reads AnnData objects, writes them to tiledbsoma.Experiment, creates & saves an Artifact.

Populates a column lamin_run_uid column in obs with the current run.uid.

Is based on tiledbsoma.io.from_anndata.

Parameters:
  • adatas (list[AnnData | UPathStr]) – AnnData objects to write, in-memory or on-disk.

  • key (str | None, default: None) – An optional key to reference the artifact.

  • description (str | None, default: None) – A description.

  • run (Run | None, default: None) – The run that creates the artifact.

  • revises (Artifact | None, default: None) – lamindb.Artifact with tiledbsoma.Experiment to append to.

  • measurement_name (str, default: 'RNA') – The name of the measurement to store data in tiledbsoma.Experiment.

  • obs_id_name (str, default: 'obs_id') – Which AnnData obs column to use for append mode.

  • var_id_name (str, default: 'var_id') – Which AnnData var column to use for append mode.

  • append_obsm_varm (bool, default: False) – Whether to append obsm and varm in append mode .

  • **kwargs – Keyword arguments passed to tiledbsoma.io.from_anndata.

Return type:

Artifact

lamindb.integrations.curate_from_croissant(croissant_data, run=None)

Create annotated artifacts from a CroissantML file.

Returns a collection if multiple files are found in croissant_data, otherwise a single artifact.

Parameters:

croissant_data (str | Path | dict[str, Any]) – Path to CroissantML JSON file or dictionary.

Return type:

Artifact | Collection

Example

artifact = ln.integrations.curate_from_croissant("dataset_metadata.json")

Modules

lightning

PyTorch Lightning.