Segmented single-cell exports name their columns however the
acquisition software happens to. A cr_column_map records how those
raw headers translate to the analysis names used downstream, so that
the mapping lives in one declarative object instead of being spread
through reader code.
Usage
cr_column_map(exact = NULL, prefix = NULL, keep = NULL)
# S3 method for class 'cr_column_map'
print(x, ...)Arguments
- exact
Named character vector. Names are raw header names, values the analysis name to rename them to.
- prefix
Named character vector. Names are regular expressions matched against the raw header names, values the analysis name. The first matching column is renamed.
- keep
Optional character vector of analysis names to retain after renaming, in this order. Names that are absent are ignored.
NULLkeeps every column.- x
A
cr_column_map.- ...
Ignored.
Details
Two matching modes are available because vendor headers are not
always stable: exact matches a header verbatim, while prefix
matches a regular expression. Prefix matching exists for headers that
embed a unit glyph (an area column ending in a squared-micrometre
symbol, for instance), where the exact spelling cannot be relied on.
Renaming is deliberately tolerant: names that do not occur in a given export are skipped silently rather than raising an error. Exports from the same instrument routinely carry different subsets of the available measurements, and a strict renamer forces a second reader to exist for every subset.
See also
cr_read_export(), cr_read_exports().
Other import:
cr_assign_units(),
cr_centroid_overlap(),
cr_extract_markers(),
cr_filename_grammar(),
cr_marker_rules(),
cr_merge_rules(),
cr_parse_paths(),
cr_path_spec(),
cr_read_cellprofiler(),
cr_read_cells(),
cr_read_design(),
cr_read_export(),
cr_read_exports(),
cr_read_qupath(),
cr_read_segmantr(),
cr_unit_map()