Skip to content

Commit

Permalink
Remove link tables from print output (#55)
Browse files Browse the repository at this point in the history
* Remove link tables from instance output

* Remove link tables from Module output

* Render README

* Update CHANGELOG
  • Loading branch information
lazappi authored Oct 25, 2024
1 parent ab0f303 commit 668574f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 42 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ For more information, please visit the [package website](https://laminr.lamin.ai

* Add progress bars to `Artifact$cache()` (PR #58)

* Remove link tables from object print output (PR #55)

## TESTING

* Add a simple unit test which queries laminlabs/lamindata (PR #27).
Expand Down
16 changes: 1 addition & 15 deletions R/Instance.R
Original file line number Diff line number Diff line change
Expand Up @@ -175,19 +175,10 @@ Instance <- R6::R6Class( # nolint object_name_linter
}
)

link_lines <- purrr::map_chr(
names(registries)[is_link_table],
function(.registry) {
cli::col_blue(paste0(" ", .registry))
}
)

lines <- c(
cli::style_bold(cli::col_green(private$.settings$name)),
cli::style_italic(cli::col_magenta(" Core registries")),
standard_lines,
cli::style_italic(cli::col_magenta(" Core link tables")),
link_lines
standard_lines
)

module_names <- self$get_module_names()
Expand Down Expand Up @@ -230,11 +221,6 @@ Instance <- R6::R6Class( # nolint object_name_linter
collapse = ", "
),
"]"
),
"CoreLinkTables" = paste0(
"[",
paste(names(registries[is_link_table]), collapse = ", "),
"]"
)
)

Expand Down
16 changes: 1 addition & 15 deletions R/Module.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,19 +113,10 @@ Module <- R6::R6Class( # nolint object_name_linter
}
)

link_lines <- purrr::map_chr(
names(registries)[is_link_table],
function(.registry) {
cli::col_blue(paste0(" ", .registry))
}
)

lines <- c(
cli::style_bold(cli::col_green(private$.module_name)),
cli::style_italic(cli::col_magenta(" Registries")),
standard_lines,
cli::style_italic(cli::col_magenta(" Link tables")),
link_lines
standard_lines
)

if (isFALSE(style)) {
Expand Down Expand Up @@ -158,11 +149,6 @@ Module <- R6::R6Class( # nolint object_name_linter
collapse = ", "
),
"]"
),
"LinkTables" = paste0(
"[",
paste(names(registries[is_link_table]), collapse = ", "),
"]"
)
),
quote_strings = FALSE
Expand Down
15 changes: 3 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,6 @@ db
$FeatureSet
$ParamValue
$FeatureValue
Core link tables
runparamvalue
artifactulabel
collectionulabel
featuresetfeature
artifactfeatureset
artifactparamvalue
collectionartifact
artifactfeaturevalue
Additional modules
bionty

Expand All @@ -90,15 +81,15 @@ You can print the record:
artifact
```

Artifact(uid='KBW89Mf7IGcekja2hADu', description='Myeloid compartment', key='cell-census/2024-07-01/h5ads/fe52003e-1460-4a65-a213-2bb1a508332f.h5ad', storage_id=2, _accessor='AnnData', version='2024-07-01', id=3659, size=691757462, transform_id=22, is_latest=TRUE, type='dataset', n_observations=51552, created_by_id=1, _hash_type='md5-n', created_at='2024-07-12T12:34:10.345829+00:00', suffix='.h5ad', updated_at='2024-07-12T12:40:48.837026+00:00', _key_is_virtual=FALSE, visibility=1, run_id=27, hash='SZ5tB0T4YKfiUuUkAL09ZA')
Artifact(uid='KBW89Mf7IGcekja2hADu', description='Myeloid compartment', key='cell-census/2024-07-01/h5ads/fe52003e-1460-4a65-a213-2bb1a508332f.h5ad', created_by_id=1, run_id=27, suffix='.h5ad', created_at='2024-07-12T12:34:10.345829+00:00', hash='SZ5tB0T4YKfiUuUkAL09ZA', _hash_type='md5-n', storage_id=2, version='2024-07-01', _accessor='AnnData', id=3659, is_latest=TRUE, _key_is_virtual=FALSE, transform_id=22, n_observations=51552, size=691757462, visibility=1, updated_at='2024-07-12T12:40:48.837026+00:00', type='dataset')

Or call the `$describe()` method to get a summary:

``` r
artifact$describe()
```

Artifact(uid='KBW89Mf7IGcekja2hADu', description='Myeloid compartment', key='cell-census/2024-07-01/h5ads/fe52003e-1460-4a65-a213-2bb1a508332f.h5ad', storage_id=2, _accessor='AnnData', version='2024-07-01', id=3659, size=691757462, transform_id=22, is_latest=TRUE, type='dataset', n_observations=51552, created_by_id=1, _hash_type='md5-n', created_at='2024-07-12T12:34:10.345829+00:00', suffix='.h5ad', updated_at='2024-07-12T12:40:48.837026+00:00', _key_is_virtual=FALSE, visibility=1, run_id=27, hash='SZ5tB0T4YKfiUuUkAL09ZA')
Artifact(uid='KBW89Mf7IGcekja2hADu', description='Myeloid compartment', key='cell-census/2024-07-01/h5ads/fe52003e-1460-4a65-a213-2bb1a508332f.h5ad', created_by_id=1, run_id=27, suffix='.h5ad', created_at='2024-07-12T12:34:10.345829+00:00', hash='SZ5tB0T4YKfiUuUkAL09ZA', _hash_type='md5-n', storage_id=2, version='2024-07-01', _accessor='AnnData', id=3659, is_latest=TRUE, _key_is_virtual=FALSE, transform_id=22, n_observations=51552, size=691757462, visibility=1, updated_at='2024-07-12T12:40:48.837026+00:00', type='dataset')
Provenance
$storage = 's3://cellxgene-data-public'
$transform = 'Census release 2024-07-01 (LTS)'
Expand Down Expand Up @@ -127,7 +118,7 @@ You can directly load the artifact to access its data:
artifact$load()
```

ℹ 's3://cellxgene-data-public/cell-census/2024-07-01/h5ads/fe52003e-1460-4a65-a213-2bb1a508332f.h5ad' already exists at '/home/rcannood/.cache/lamindb/cellxgene-data-public/cell-census/2024-07-01/h5ads/fe52003e-1460-4a65-a213-2bb1a508332f.h5ad'
ℹ 's3://cellxgene-data-public/cell-census/2024-07-01/h5ads/fe52003e-1460-4a65-a213-2bb1a508332f.h5ad' already exists at '/home/luke/.cache/lamindb/cellxgene-data-public/cell-census/2024-07-01/h5ads/fe52003e-1460-4a65-a213-2bb1a508332f.h5ad'

AnnData object with n_obs × n_vars = 51552 × 36398
obs: 'donor_id', 'Predicted_labels_CellTypist', 'Majority_voting_CellTypist', 'Manually_curated_celltype', 'assay_ontology_term_id', 'cell_type_ontology_term_id', 'development_stage_ontology_term_id', 'disease_ontology_term_id', 'self_reported_ethnicity_ontology_term_id', 'is_primary_data', 'organism_ontology_term_id', 'sex_ontology_term_id', 'tissue_ontology_term_id', 'suspension_type', 'tissue_type', 'cell_type', 'assay', 'disease', 'organism', 'sex', 'tissue', 'self_reported_ethnicity', 'development_stage', 'observation_joinid'
Expand Down

0 comments on commit 668574f

Please sign in to comment.