Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rcannood committed Nov 11, 2024
1 parent d2474b9 commit 85166e3
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 52 deletions.
14 changes: 6 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
Package: laminr.api
Title: R Package Client for the Lamin API
Title: Interface to the 'LaminDB' API
Version: 0.1.0
Authors@R:c(
person("Robrecht", "Cannoodt", , "[email protected]", role = c("aut", "cre"),
person("Robrecht", "Cannoodt", email = "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0003-3641-729X", github = "rcannood")),
person("Luke", "Zappia", , "[email protected]", role = "aut",
person("Luke", "Zappia", email = "[email protected]", role = "aut",
comment = c(ORCID = "0000-0001-7744-8565", github = "lazappi")),
person("Data Intuitive", , , "[email protected]", role = "aut"),
person("Lamin Labs", , , "[email protected]", role = c("aut", "cph"))
person("Data Intuitive", email = "[email protected]", role = "aut"),
person("Lamin Labs", email = "[email protected]", role = c("aut", "cph"))
)
Description: Client package for accessing the Lamin API. Most content is
generated by the Openapi Generator
https://github.com/openapitools/openapi-generator.
Description: Client package for accessing the Lamin API.
License: Apache License (>= 2)
URL: https://github.com/data-intuitive/laminr.api
BugReports: https://github.com/data-intuitive/laminr.api/issues
Expand Down
94 changes: 55 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# R API client for the Lamin API
# **{laminr.api}**: R Interface to the LaminDB API


## Overview

The **{laminr.api}** package provides an low-level R interface to the
LaminDB API. The package is not meant to be used directly by end-users,
but is used by higher-level packages like **{laminr}**.

This package is mostly auto-generated from the OpenAPI specification of
the LaminDB API using the [OpenAPI
Generator](https://www.npmjs.com/package/@openapitools/openapi-generator-cli).

## Installation

To install directly from Github, use `remotes`:
Expand All @@ -17,9 +27,11 @@ remotes::install_github("data-intuitive/laminr.api")
``` r
library(laminr.api)

api_url <- getOption("lamindb_current_instance")$api_url
instance_id <- getOption("lamindb_current_instance")$id
schema_id <- getOption("lamindb_current_instance")$schema_id
# retrieve these values from ~/.lamin/current_instance.env
# after running `lamin connect <instance_id>`
api_url <- "https://us-east-1.api.lamin.ai/"
instance_id <- "037ba1e08d804f91a90275a47735076a"
schema_id <- "097186c3e91c01ced47aa3e01a3c1515"

api_client <- ApiClient$new(base_path = api_url)

Expand Down Expand Up @@ -87,15 +99,19 @@ schema <- api$GetSchemaInstancesInstanceIdSchemaGet(instance_id)
names(schema)
```

[1] "core" "bionty"
[1] "core" "bionty" "wetlab"

``` r
names(schema$core)
```

[1] "run" "user" "param" "ulabel" "feature" "storage" "artifact"
[8] "transform" "collection" "featureset" "paramvalue" "featurevalue" "runparamvalue" "artifactulabel"
[15] "collectionulabel" "featuresetfeature" "artifactfeatureset" "artifactparamvalue" "collectionartifact" "artifactfeaturevalue"
[1] "run" "user" "param"
[4] "ulabel" "feature" "storage"
[7] "artifact" "transform" "collection"
[10] "featureset" "paramvalue" "featurevalue"
[13] "runparamvalue" "artifactulabel" "collectionulabel"
[16] "featuresetfeature" "artifactfeatureset" "artifactparamvalue"
[19] "collectionartifact" "artifactfeaturevalue"

Get record:

Expand All @@ -104,7 +120,7 @@ api$GetRecordInstancesInstanceIdModulesModuleNameModelNameIdOrUidPost(
instance_id,
"core",
"artifact",
"KBW89Mf7IGcekja2hADu",
"3TNCsZZcnIBv2WGb0001",
schema_id,
include_foreign_keys = TRUE
)
Expand All @@ -113,65 +129,65 @@ api$GetRecordInstancesInstanceIdModulesModuleNameModelNameIdOrUidPost(
$n_objects
NULL

$description
[1] "Myeloid compartment"

$uid
[1] "KBW89Mf7IGcekja2hADu"
[1] "3TNCsZZcnIBv2WGb0001"

$hash
[1] "SZ5tB0T4YKfiUuUkAL09ZA"
[1] "iETHP3Lw-tVqZxYAuEC-SA"

$storage_id
[1] 2

$version
NULL

$`_accessor`
[1] "AnnData"

$transform_id
[1] 22

$version
[1] "2024-07-01"

$n_observations
[1] 51552
[1] 163

$id
[1] 3659
[1] 938

$created_by_id
[1] 1
$created_at
[1] "2024-10-18T21:46:55.467982+00:00"

$run_id
[1] 27
$description
[1] "10x reference adata, trusted cell type annotation"

$size
[1] 691757462
$`_key_is_virtual`
[1] TRUE

$key
[1] "cell-census/2024-07-01/h5ads/fe52003e-1460-4a65-a213-2bb1a508332f.h5ad"
NULL

$updated_at
[1] "2024-10-18T21:58:06.010689+00:00"

$n_observations
[1] 70

$size
[1] 851664

$`_hash_type`
[1] "md5-n"
[1] "md5"

$`_key_is_virtual`
[1] FALSE
$created_by_id
[1] 9

$is_latest
[1] TRUE

$created_at
[1] "2024-07-12T12:34:10.345829+00:00"

$updated_at
[1] "2024-07-12T12:40:48.837026+00:00"
$visibility
[1] 1

$type
[1] "dataset"

$visibility
[1] 1
$run_id
[1] 305

$suffix
[1] ".h5ad"
Expand Down
18 changes: 13 additions & 5 deletions README.qmd
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
---
title: R API client for the Lamin API
title: "**{laminr.api}**: R Interface to the LaminDB API"
format: gfm
---

## Overview

The **{laminr.api}** package provides an low-level R interface to the LaminDB API. The package is not meant to be used directly by end-users, but is used by higher-level packages like **{laminr}**.

This package is mostly auto-generated from the OpenAPI specification of the LaminDB API using the [OpenAPI Generator](https://www.npmjs.com/package/@openapitools/openapi-generator-cli).

## Installation

To install directly from Github, use `remotes`:
Expand All @@ -18,9 +24,11 @@ remotes::install_github("data-intuitive/laminr.api")
```{r}
library(laminr.api)
api_url <- getOption("lamindb_current_instance")$api_url
instance_id <- getOption("lamindb_current_instance")$id
schema_id <- getOption("lamindb_current_instance")$schema_id
# retrieve these values from ~/.lamin/current_instance.env
# after running `lamin connect <instance_id>`
api_url <- "https://us-east-1.api.lamin.ai/"
instance_id <- "037ba1e08d804f91a90275a47735076a"
schema_id <- "097186c3e91c01ced47aa3e01a3c1515"
api_client <- ApiClient$new(base_path = api_url)
Expand Down Expand Up @@ -48,7 +56,7 @@ api$GetRecordInstancesInstanceIdModulesModuleNameModelNameIdOrUidPost(
instance_id,
"core",
"artifact",
"KBW89Mf7IGcekja2hADu",
"3TNCsZZcnIBv2WGb0001",
schema_id,
include_foreign_keys = TRUE
)
Expand Down

0 comments on commit 85166e3

Please sign in to comment.