getDensities | R Documentation |
Returns a dataframe with 4 columns, containing for every file and every channel of interest the x/y values computed by density.
getDensities(
files,
channels,
quantileValues = 0.5,
transformList = NULL,
selection = NULL,
...
)
files |
Full paths of to the fcs files of the samples |
channels |
Names of the channels to compute the densities for |
quantileValues |
Quantiles to extract as well |
transformList |
Transformation list to pass to the flowCore
|
selection |
List with indexation vector for every file. |
... |
Extra parameters to pass to density |
dir <- system.file("extdata", package = "CytoNorm")
files <- list.files(dir, pattern = "fcs$")
ff <- flowCore::read.FCS(file.path(dir, files[1]))
channels <- grep("Di$", flowCore::colnames(ff), value = TRUE)
transformList <- flowCore::transformList(channels,
cytofTransform)
densities <- getDensities(files = file.path(dir, files),
channels = channels,
transformList = transformList,
quantileValues = c(0.25, 0.5, 0.75))
densities$densities$Marker <- paste0(
FlowSOM::GetMarkers(ff, densities$densities$Channel),
" (", densities$densities$Channel, ")")
library(ggplot2)
ggplot(dplyr::filter(densities$densities,
File == file.path(dir, files[1]))) +
geom_line(aes(x = x, y = y)) +
facet_wrap(~ Marker, scales = "free") +
theme_minimal()
ggplot(dplyr::filter(densities$quantiles,
Channel == FlowSOM::GetChannels(ff, "CD66"))) +
geom_vline(aes(xintercept = `0.25`), col = "grey") +
geom_vline(aes(xintercept = `0.5`), col = "grey", lwd = 1) +
geom_vline(aes(xintercept = `0.75`), col = "grey") +
geom_line(aes(x = x, y = y),
data = dplyr::filter(densities$densities,
Channel == FlowSOM::GetChannels(ff, "CD66"))) +
facet_wrap(~ File) +
theme_minimal()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.