Description Usage Arguments Details Value See Also Examples
View source: R/read_cell_seg_data.R
read_cell_seg_data
makes it easier to use data from PerkinElmer's
inForm program. It reads data files written by inForm 2.0 and later and does
useful cleanup on the result. Data files written by inForm 2.0 can be read
easily using read.delim
or
read_tsv
. However there is still some useful cleanup to
be done.
1 2 3 | read_cell_seg_data(path = NA,
pixels_per_micron = getOption("phenoptr.pixels.per.micron"),
remove_units = TRUE)
|
path |
Path to the file to read, or NA to use a file chooser. |
pixels_per_micron |
Conversion factor to microns
(default 2 pixels/micron, the resolution of 20x MSI fields
taken on Vectra Polaris and Vectra 3.).
Set to NA to skip conversion. Set to |
remove_units |
If TRUE (default), remove the unit name from expression columns. |
read_cell_seg_data
reads both single-image tables and merged tables
and does useful cleanup on the data:
Removes columns that are all NA. These are typically unused summary columns.
Converts percent columns to numeric fractions.
Converts pixel distances to microns. The conversion factor may be
specified as a parameter, by setting
options(phenoptr.pixels.per.micron)
, or by reading an associated
component_data.tif
file.
Optionally removes units from expression names
If the file contains multiple sample names,
a tag
column is created
containing a minimal, unique tag for each sample.
This is useful when a
short name is needed, for example in chart legends.
If pixels_per_micron='auto'
, read_cell_seg_data
looks for
a component_data.tif
file in the same directory as path
.
If found, pixels_per_micron
is read from the file and
the cell coordinates are offset to the correct spatial location.
A data_frame
containing the cleaned-up data set.
Other file readers: get_field_info
,
list_cell_seg_files
,
read_components
, read_maps
1 2 3 4 5 6 7 8 9 10 11 12 13 | path <- sample_cell_seg_path()
csd <- read_cell_seg_data(path)
# count all the phenotypes in the data
table(csd$Phenotype)
## Not run:
# Use purrr::map_df to read all cell seg files in a directory
# and return a single data_frame.
paths <- list_cell_seg_files(path)
csd <- purrr::map_df(paths, read_cell_seg_data)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.