-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
242 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
/.quarto/ | ||
*.html | ||
*.R | ||
*_files | ||
_quarto.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
--- | ||
title: "Package structure" | ||
vignette: > | ||
%\VignetteIndexEntry{Package structure} | ||
%\VignetteEncoding{UTF-8} | ||
%\VignetteEngine{quarto::html} | ||
editor_options: | ||
chunk_output_type: console | ||
knitr: | ||
opts_chunk: | ||
collapse: true | ||
comment: "#>" | ||
--- | ||
|
||
```{mermaid} | ||
classDiagram | ||
laminr --> RichInstance | ||
Check warning on line 17 in vignettes/structure.qmd GitHub Actions / lint
Check warning on line 17 in vignettes/structure.qmd GitHub Actions / lint
|
||
laminr --> UserSettings | ||
laminr --> InstanceSettings | ||
RichInstance --|> Instance | ||
Instance --> InstanceAPI | ||
Instance --> Module | ||
Core --|> Module | ||
Bionty --|> Module | ||
Module --> Registry | ||
Registry --> Field | ||
Registry --> RichRecord | ||
Artifact --|> Record | ||
RichInstance --> Core | ||
RichInstance --> Bionty | ||
Core --> Artifact | ||
RichRecord --|> Record | ||
class laminr{ | ||
+connect(String slug): RichInstance | ||
} | ||
class UserSettings{ | ||
+initialize(...): UserSettings | ||
+email: String | ||
+access_token: String | ||
+uid: String | ||
+uuid: String | ||
+handle: String | ||
+name: String | ||
} | ||
class InstanceSettings{ | ||
+initialize(...): InstanceSettings | ||
+owner: String | ||
+name: String | ||
+id: String | ||
+schema_id: String | ||
+api_url: String | ||
} | ||
class Instance{ | ||
+initialize(InstanceSettings Instance_settings, API api, Map<String, any> schema): Instance | ||
+get_modules(): Module[] | ||
+get_module(String module_name): Module | ||
+get_module_names(): String[] | ||
} | ||
class InstanceAPI{ | ||
+initialize(InstanceSettings Instance_settings) | ||
+get_schema(): Map~String, Any~ | ||
+get_record(...): Map~String, Any~ | ||
} | ||
class RichInstance{ | ||
+initialize(InstanceSettings Instance_settings, API api, Map<String, any> schema): RichInstance | ||
+Registry Artifact | ||
+Registry Collection | ||
+...registry accessors... | ||
+Registry User | ||
+Bionty bionty | ||
} | ||
class Core{ | ||
+Registry Artifact | ||
+Registry Collection | ||
+...registry accessors... | ||
+Registry User | ||
} | ||
class Bionty{ | ||
+Registry CellLine | ||
+Registry CellMarker | ||
+...registry accessors... | ||
+Registry Tissue | ||
} | ||
class Module{ | ||
+initialize(Instance Instance, API api, String module_name, Map<String, any> module_schema): Module | ||
+name: String | ||
+get_registries(): Registry[] | ||
+get_registry(String registry_name): Registry | ||
+get_registry_names(): String[] | ||
} | ||
class Registry{ | ||
+initialize(Instance Instance, Module module, API api, String registry_name, Map<String, Any> registry_schema): Registry | ||
+name: String | ||
+class_name: String | ||
+is_link_table: Bool | ||
+get_fields(): Field[] | ||
+get_field(String field_name): Field | ||
+get_field_names(): String[] | ||
+get(String id_or_uid, Bool include_foreign_keys, List~String~ select, Bool verbose): RichRecord | ||
+get_registry_class(): RichRecordClass | ||
} | ||
class Artifact{ | ||
+initialize(...): Artifact | ||
+cache(): String | ||
+load(): Any | ||
} | ||
class Field{ | ||
+initialize(...): Field | ||
+type: String | ||
+through: Map | ||
+field_name: String | ||
+registry_name: String | ||
+column_name: String | ||
+module_name: String | ||
+is_link_table: Bool | ||
+relation_type: String | ||
+related_field_name: String | ||
+related_registry_name: String | ||
+related_module_name: String | ||
} | ||
class RichRecord{ | ||
+...field value accessors... | ||
} | ||
class Record{ | ||
+initialize(Instance Instance, Registry registry, API api, Map<String, Any> data): Record | ||
+get_value(String field_name): Any | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
``` |