read_cpout | R Documentation |
Reader function to generate a
SpatialExperiment
or
SingleCellExperiment
object from single-cell data
obtained by the
ImcSegmentationPipeline
pipeline.
read_cpout(
path,
object_file = "cell.csv",
image_file = "Image.csv",
panel_file = "panel.csv",
graph_file = "Object relationships.csv",
object_feature_file = "var_cell.csv",
intensities = "Intensity_MeanIntensity_FullStack",
extract_imgid_from = "ImageNumber",
extract_cellid_from = "ObjectNumber",
extract_coords_from = c("Location_Center_X", "Location_Center_Y"),
extract_cellmetadata_from = c("AreaShape_Area", "Neighbors_NumberOfNeighbors_8",
"AreaShape_Eccentricity", "AreaShape_MajorAxisLength", "AreaShape_MinorAxisLength",
"AreaShape_MeanRadius"),
extract_imagemetadata_from = c("Metadata_acname", "Metadata_acid",
"Metadata_description"),
extract_graphimageid_from = "First Image Number",
extract_graphcellids_from = c("First Object Number", "Second Object Number"),
extract_metal_from = "Metal Tag",
scale_intensities = TRUE,
extract_scalingfactor_from = "Scaling_FullStack",
return_as = c("spe", "sce")
)
path |
full path to the CellProfiler output folder. |
object_file |
single character indicating the file name storing the object/cell-specific intensities and metadata. |
image_file |
single character indicating the file name storing meta data
per image (can be |
panel_file |
single character indicating the file name storing the panel
information (can be |
graph_file |
single character indicating the file name storing the
object/cell interaction information (can be |
object_feature_file |
single character indicating the file name storing object/cell feature information. |
intensities |
single character indicating which column entries of the
|
extract_imgid_from |
single character indicating which column entries of
the |
extract_cellid_from |
single character indicating which column entry
of the |
extract_coords_from |
character vector indicating which column entries
of the |
extract_cellmetadata_from |
character vector indicating which additional
object/cell specific metadata to extract from the |
extract_imagemetadata_from |
character vector indicating which
additional image specific metadata to extract from the |
extract_graphimageid_from |
single character indicating which column
entries of the |
extract_graphcellids_from |
character vector indicating which column
entries of the |
extract_metal_from |
single character indicating which column entry of
the |
scale_intensities |
single logical. Should the measured intensity
features be scaled by |
extract_scalingfactor_from |
single character indicating which column
entries of the |
return_as |
should the object be returned as
|
returns a SpatialExperiment
or SingleCellExperiment
object with markers in rows and cells in columns.
In the case of both containers x
, intensity features (as selected
by the intensities
parameter) are stored in the counts(x)
slot.
Cell metadata (e.g morphological features) are stored in the
colData(x)
slot. The interaction graphs are stored as
SelfHits
object in the
colPair(x, "neighborhood")
slot.
Intensity features are extracted via partial string matching. Internally, the
read_cpout
function checks if per channel a single intensity feature
is read in (by checking the _cXY
ending where XY
is the
channel number).
In the case of a returned SpatialExperiment
object, the cell
coordinates are stored in the spatialCoords(x)
slot.
In the case of a returned SingleCellExperiment
object, the cell
coordinates are stored in the colData(x)
slot named as Pos_X
and Pos_Y
.
Tobias Hoch
Nils Eling (nils.eling@dqbm.uzh.ch)
https://github.com/BodenmillerGroup/ImcSegmentationPipeline for the pipeline
read_steinbock
for reading in single-cell data as produced by
the steinbock pipeline
colPair
for information on how to work
with the cell-cell interaction graphs
path <- system.file("extdata/mockData/cpout", package = "imcRtools")
# Read in as SpatialExperiment object
x <- read_cpout(path, graph_file = "Object_relationships.csv")
x
# Read in as SingleCellExperiment object
x <- read_cpout(path, graph_file = "Object_relationships.csv",
return_as = "sce")
x
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.