Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/prepareCellData.R
Convert single-cell marker intensities from a mass cytometry experiment into a format for efficient counting.
1 | prepareCellData(x, markers = NULL, ...)
|
x |
A named list of numeric matrices, where each matrix corresponds to a sample and contains expression intensities for each cell (row) and each marker (column). Alternatively, a ncdfFlowSet object containing the same information. |
markers |
A character vector containing the names of the markers to use in downstream analyses. |
... |
Additional arguments to pass to |
This function constructs a BiocNeighborIndex object from the marker intensities of each cell in one or more samples.
The precomputed index is used to speed up downstream nearest-neighbour searching,
avoiding redundant work from repeated calls to countCells
(e.g., with different values of tol
).
If markers
is specified, only the selected markers will be used in the precomputation.
This restricts the markers that are used in downstream functions -
namely, countCells
and neighborDistances
.
By default, markers=NULL
which means that all supplied markers will be used.
Markers that are not in markers
will be ignored in distance calculations.
However, their intensities are still stored in the output object, for use in functions like medIntensities
.
A List containing precomputed values for use in countCells
.
This includes:
precomputed
, a BiocNeighborIndex object containing a pre-built index for the neighbor search.
sample.id
, an integer vector specifying the sample of origin for each cell in precomputed
.
cell.id
, an integer vector specifying the original index in
the corresponding sample of x
for each cell in precomputed
.
unused
, a matrix of intensity values for markers not in markers
.
colData
, a DataFrame containing per-sample statistics.
Aaron Lun
countCells
, where the output of this function is used to obtain hypersphere counts.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ### Mocking up some data: ###
nmarkers <- 20
marker.names <- paste0("X", seq_len(nmarkers))
nsamples <- 8
sample.names <- paste0("Y", seq_len(nsamples))
x <- list()
for (i in sample.names) {
ex <- matrix(rgamma(nmarkers*1000, 2, 2), ncol=nmarkers, nrow=1000)
colnames(ex) <- marker.names
x[[i]] <- ex
}
### Running the function: ###
cd <- prepareCellData(x)
cd
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.