Skip to content

Commit

Permalink
add usage vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
rcannood committed Oct 9, 2024
1 parent 75d8a7e commit f3cbc5c
Showing 1 changed file with 104 additions and 0 deletions.
104 changes: 104 additions & 0 deletions vignettes/usage.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
---
title: "Usage"
vignette: >
%\VignetteIndexEntry{Usage}
%\VignetteEncoding{UTF-8}
%\VignetteEngine{quarto::html}
editor_options:
chunk_output_type: console
knitr:
opts_chunk:
collapse: true
comment: "#>"
---

```{r setup}
library(laminr)
```

## Instance

### Connect to a LaminDB instance

```{r connect}
db <- connect("laminlabs/cellxgene")
```


### Print a LaminDB instance

```{r print_instance}
db
```

### Get module

```{r get_module}
db$get_module("core")
db$bionty
```

## Registry

```{r get_artifact_registry}
db$Artifact
```

```{r get_bionty_celline}
db$bionty$CellLine
```

## Record

### Get artifact

```{r get_artifact}
artifact <- db$Artifact$get("KBW89Mf7IGcekja2hADu")
```

### Print artifact

```{r print_artifact}
artifact
```

### Print simple fields

```{r print_simple_fields}
artifact$id
artifact$uid
artifact$key
```

### Print related fields

```{r print_related_fields}
artifact$storage
artifact$created_by
artifact$experimental_factors
```

### Cache artifact

:::{.callout-note}
Only S3 storage is supported at the moment.
:::

```{r cache_artifact}
artifact$cache()
```

### Load artifact

:::{.callout-note}
Only S3 storage and AnnData accessors are supported at the moment.
:::

```{r load_artifact}
artifact$load()
```

0 comments on commit f3cbc5c

Please sign in to comment.