Get a standard ImmunData column name¶
Description¶
Use imd_schema() when code needs the standard column name
for an ImmunData identifier or calculated value, such as
the cell barcode, receptor identifier, repertoire identifier, count, or
proportion.
Use this helper in reusable analysis code or package extensions instead
of writing an internal name such as “imd_barcode” directly.
It only returns names; it does not inspect or change an ImmunData
object.
Usage¶
imd_schema(key = NULL)
Arguments¶
key
|
A character string or NULL. One schema key, for example
“barcode”, “receptor”,
“repertoire”, “count”, or
“proportion”. Use NULL, the default, to return
all available keys and column names.
|
Value¶
If key is supplied, one character string containing the
standard column name. If key = NULL, a named list of all
schema keys and column names.
See Also¶
make_receptor_schema(), imd_rename_cols(),
ImmunData
Examples¶
#> [1] "imd_barcode"
#> [1] "imd_receptor_id"
# Expected result: "imd_receptor_id"
# Use a returned name for programmatic selection.
barcode_column <- imd_schema("barcode")
get_test_idata() |>
dplyr::collect() |>
dplyr::select(dplyr::all_of(barcode_column)) |>
head(2)
#> # A tibble: 2 × 1
#> imd_barcode
#> <chr>
#> 1 S1_1
#> 2 S1_2