Title: | GUI's for visualization of flow cytometry data analysis pipelines |
---|---|
Description: | This package is the companion of the `CytoPipeline` package. It provides GUI's (shiny apps) for the visualization of flow cytometry data analysis pipelines that are run with `CytoPipeline`. Two shiny applications are provided, i.e. an interactive flow frame assessment and comparison tool and an interactive scale transformations visualization and adjustment tool. |
Authors: | Philippe Hauchamps [aut, cre] , Laurent Gatto [aut] , Dan Lin [ctb] |
Maintainer: | Philippe Hauchamps <[email protected]> |
License: | GPL-3 |
Version: | 1.5.0 |
Built: | 2024-11-18 03:26:12 UTC |
Source: | https://github.com/bioc/CytoPipelineGUI |
interactive visualization of flow cytometry data analysis pipeline objects stored in cache
CytoPipelineCheckApp(dir = ".", debug = FALSE)
CytoPipelineCheckApp(dir = ".", debug = FALSE)
dir |
the root directory into which the engine will look for existing CytoPipeline experiments |
debug |
if TRUE, will output messages on the console tracking the shiny events, for debugging purposes |
no return value
# run CytoPipeline object first outputDir <- base::tempdir() rawDataDir <- system.file("extdata", package = "CytoPipeline") experimentName <- "OMIP021_PeacoQC" sampleFiles <- file.path( rawDataDir, list.files( rawDataDir, pattern = "Donor")) jsonDir <- system.file("extdata", package = "CytoPipeline") jsonPath <- file.path(jsonDir, "pipelineParams.json") pipL2 <- CytoPipeline( jsonPath, experimentName = experimentName, sampleFiles = sampleFiles) suppressWarnings(execute( pipL2, rmCache = TRUE, path = outputDir)) # run shiny app if (interactive()) CytoPipelineCheckApp(dir = outputDir)
# run CytoPipeline object first outputDir <- base::tempdir() rawDataDir <- system.file("extdata", package = "CytoPipeline") experimentName <- "OMIP021_PeacoQC" sampleFiles <- file.path( rawDataDir, list.files( rawDataDir, pattern = "Donor")) jsonDir <- system.file("extdata", package = "CytoPipeline") jsonPath <- file.path(jsonDir, "pipelineParams.json") pipL2 <- CytoPipeline( jsonPath, experimentName = experimentName, sampleFiles = sampleFiles) suppressWarnings(execute( pipL2, rmCache = TRUE, path = outputDir)) # run shiny app if (interactive()) CytoPipelineCheckApp(dir = outputDir)
Based on an experiment name, this function will gather the required flowFrames from the CytoPipeline disk cache and display a difference plot using the user chosen 1D or 2D view.
plotDiffFlowFrame( experimentNameFrom, experimentNameTo, whichQueueFrom, whichQueueTo, sampleFileFrom, sampleFileTo, path, flowFrameNameFrom, flowFrameNameTo, xChannelLabelFrom, xChannelLabelTo, yChannelLabelFrom, yChannelLabelTo, interactive = FALSE, useAllCells, nDisplayCells, useFixedLinearRange, linearRange, transfoListName = " " )
plotDiffFlowFrame( experimentNameFrom, experimentNameTo, whichQueueFrom, whichQueueTo, sampleFileFrom, sampleFileTo, path, flowFrameNameFrom, flowFrameNameTo, xChannelLabelFrom, xChannelLabelTo, yChannelLabelFrom, yChannelLabelTo, interactive = FALSE, useAllCells, nDisplayCells, useFixedLinearRange, linearRange, transfoListName = " " )
experimentNameFrom |
the experiment name (representing a pipeline run) from which to extract the flow frame ('from' situation) |
experimentNameTo |
the experiment name (representing a pipeline run) from which to extract the flow frame ('to' situation) |
whichQueueFrom |
"pre-processing" or "scale transform" ('from' situation) |
whichQueueTo |
"pre-processing" or "scale transform" ('to' situation) |
sampleFileFrom |
in case 'whichQueueFrom' is set to 'pre-processing, which sample file to look at for the 'from' situation. This can be a number or a character.
|
sampleFileTo |
same as sampleFileFrom, but for the 'to' situation |
path |
the root path to look for the CytoPipeline experiment cache |
flowFrameNameFrom |
for the 'from' situation, the name of the object to fetch (as referenced in the pipeline workflow) |
flowFrameNameTo |
for the 'to' situation, the name of the object to fetch (as referenced in the pipeline workflow) |
xChannelLabelFrom |
the label of the channel
to be displayed on the x axis:
the conventional syntax is : |
xChannelLabelTo |
should be equal to xChannelLabelFrom (otherwise no plot is returned but NULL) |
yChannelLabelFrom |
the label of the channel
to be displayed on the y axis:
the conventional syntax is : |
yChannelLabelTo |
should be equal to yChannelLabelFrom (otherwise no plot is returned but NULL) |
interactive |
if TRUE, uses ggplot_shiny |
useAllCells |
if TRUE, no subsampling will be done |
nDisplayCells |
if useAllCells == FALSE, the number of subsampled cells |
useFixedLinearRange |
if TRUE, all channels using a linear scale will use a fixed range set by linearRange |
linearRange |
set for all channels using a linear scale, if useFixedLinearRange == TRUE |
transfoListName |
if not set to " ", the transformation list (as an object name ending with "_obj", as referenced in the pipeline workflow) to be used for for display. |
a ggplot (or plotly if interactive = TRUE) object
# run CytoPipeline object first outputDir <- base::tempdir() rawDataDir <- system.file("extdata", package = "CytoPipeline") experimentName <- "OMIP021_PeacoQC" sampleFiles <- file.path( rawDataDir, list.files(rawDataDir, pattern = "Donor")) jsonDir <- system.file("extdata", package = "CytoPipeline") jsonPath <- file.path(jsonDir, "pipelineParams.json") pipL2 <- CytoPipeline( jsonPath, experimentName = experimentName, sampleFiles = sampleFiles) suppressWarnings(execute( pipL2, rmCache = TRUE, path = outputDir)) plotDiffFlowFrame( experimentNameFrom = experimentName, whichQueueFrom = "pre-processing", sampleFileFrom = 1, flowFrameNameFrom = "remove_doublets_obj", xChannelLabelFrom = "FSC-A : NA", yChannelLabelFrom = "SSC-A : NA", path = outputDir, experimentNameTo = experimentName, whichQueueTo = "pre-processing", sampleFileTo = 1, flowFrameNameTo = "remove_debris_obj", xChannelLabelTo = "FSC-A : NA", yChannelLabelTo = "SSC-A : NA", useAllCells = TRUE, nDisplayCells = 0, useFixedLinearRange = TRUE, linearRange = c(-100, 262144)) plotDiffFlowFrame( experimentNameFrom = experimentName, whichQueueFrom = "pre-processing", sampleFileFrom = 1, flowFrameNameFrom = "remove_doublets_obj", xChannelLabelFrom = "FSC-A : NA", yChannelLabelFrom = "SSC-A : NA", path = outputDir, experimentNameTo = experimentName, whichQueueTo = "pre-processing", sampleFileTo = 1, flowFrameNameTo = "remove_debris_obj", xChannelLabelTo = "FSC-A : NA", yChannelLabelTo = "SSC-A : NA", useAllCells = FALSE, nDisplayCells = 100, useFixedLinearRange = FALSE, linearRange = NULL) plotDiffFlowFrame( experimentNameFrom = experimentName, whichQueueFrom = "pre-processing", sampleFileFrom = 1, flowFrameNameFrom = "remove_debris_obj", xChannelLabelFrom = "FSC-A : NA", yChannelLabelFrom = "Comp-525/50Violet-A : L/D Aqua - Viability", path = outputDir, experimentNameTo = experimentName, whichQueueTo = "pre-processing", sampleFileTo = 1, flowFrameNameTo = "remove_dead_cells_obj", xChannelLabelTo = "FSC-A : NA", yChannelLabelTo = "Comp-525/50Violet-A : L/D Aqua - Viability", useAllCells = TRUE, nDisplayCells = 0, useFixedLinearRange = FALSE, linearRange = NULL, transfoListName = "scale_transform_estimate_obj")
# run CytoPipeline object first outputDir <- base::tempdir() rawDataDir <- system.file("extdata", package = "CytoPipeline") experimentName <- "OMIP021_PeacoQC" sampleFiles <- file.path( rawDataDir, list.files(rawDataDir, pattern = "Donor")) jsonDir <- system.file("extdata", package = "CytoPipeline") jsonPath <- file.path(jsonDir, "pipelineParams.json") pipL2 <- CytoPipeline( jsonPath, experimentName = experimentName, sampleFiles = sampleFiles) suppressWarnings(execute( pipL2, rmCache = TRUE, path = outputDir)) plotDiffFlowFrame( experimentNameFrom = experimentName, whichQueueFrom = "pre-processing", sampleFileFrom = 1, flowFrameNameFrom = "remove_doublets_obj", xChannelLabelFrom = "FSC-A : NA", yChannelLabelFrom = "SSC-A : NA", path = outputDir, experimentNameTo = experimentName, whichQueueTo = "pre-processing", sampleFileTo = 1, flowFrameNameTo = "remove_debris_obj", xChannelLabelTo = "FSC-A : NA", yChannelLabelTo = "SSC-A : NA", useAllCells = TRUE, nDisplayCells = 0, useFixedLinearRange = TRUE, linearRange = c(-100, 262144)) plotDiffFlowFrame( experimentNameFrom = experimentName, whichQueueFrom = "pre-processing", sampleFileFrom = 1, flowFrameNameFrom = "remove_doublets_obj", xChannelLabelFrom = "FSC-A : NA", yChannelLabelFrom = "SSC-A : NA", path = outputDir, experimentNameTo = experimentName, whichQueueTo = "pre-processing", sampleFileTo = 1, flowFrameNameTo = "remove_debris_obj", xChannelLabelTo = "FSC-A : NA", yChannelLabelTo = "SSC-A : NA", useAllCells = FALSE, nDisplayCells = 100, useFixedLinearRange = FALSE, linearRange = NULL) plotDiffFlowFrame( experimentNameFrom = experimentName, whichQueueFrom = "pre-processing", sampleFileFrom = 1, flowFrameNameFrom = "remove_debris_obj", xChannelLabelFrom = "FSC-A : NA", yChannelLabelFrom = "Comp-525/50Violet-A : L/D Aqua - Viability", path = outputDir, experimentNameTo = experimentName, whichQueueTo = "pre-processing", sampleFileTo = 1, flowFrameNameTo = "remove_dead_cells_obj", xChannelLabelTo = "FSC-A : NA", yChannelLabelTo = "Comp-525/50Violet-A : L/D Aqua - Viability", useAllCells = TRUE, nDisplayCells = 0, useFixedLinearRange = FALSE, linearRange = NULL, transfoListName = "scale_transform_estimate_obj")
This function plots a 1D view, i.e. the marginal distribution for one specified channel, of the given flow frame, using the specific user-provided scale transformation parameters.
plotScaleTransformedChannel( ff, channel, applyTransform = c("axis scale only", "data"), transfoType = c("linear", "logicle"), linA, linB, negDecades, width, posDecades )
plotScaleTransformedChannel( ff, channel, applyTransform = c("axis scale only", "data"), transfoType = c("linear", "logicle"), linA, linB, negDecades, width, posDecades )
ff |
the |
channel |
the name of the channel of which to display the marginal distribution (i.e. the channel name used as column in the ff expression matrix). |
applyTransform |
if "data", data are explicitly transformed using the user provided sclae transformation parameters, before display if "axis scale only" (default), the data are not transformed, i.e. only the x axis scale is defined according to the scale transformation parameters. |
transfoType |
the transformation type, currently only
|
linA |
the intercept parameter of the linear transformation. |
linB |
the slope parameter of the linear transformation. |
negDecades |
the number of additional decades on the negative side for the logicle transformation. |
width |
the width parameter of the logicle transformation. |
posDecades |
the number of positive decades of the logicle tranformation. |
a ggplot object
# run CytoPipeline object first outputDir <- base::tempdir() rawDataDir <- system.file("extdata", package = "CytoPipeline") experimentName <- "OMIP021_PeacoQC" sampleFiles <- file.path( rawDataDir, list.files(rawDataDir, pattern = "Donor")) jsonDir <- system.file("extdata", package = "CytoPipeline") jsonPath <- file.path(jsonDir, "pipelineParams.json") pipL2 <- CytoPipeline( jsonPath, experimentName = experimentName, sampleFiles = sampleFiles) suppressWarnings(execute( pipL2, rmCache = TRUE, path = outputDir)) ff <- CytoPipeline::getCytoPipelineFlowFrame( pipL2, path = outputDir, whichQueue = "scale transform", objectName = "flowframe_aggregate_obj" ) plotScaleTransformedChannel( ff, channel = "FSC-A", transfoType = "linear", linA = 0.0002, linB = -0.5) plotScaleTransformedChannel( ff, channel = "Comp-670/30Violet-A", transfoType = "logicle", negDecades = 1, width = 0.5, posDecades = 4 ) plotScaleTransformedChannel( ff, channel = "CD3", applyTransform = "data", transfoType = "logicle", negDecades = 1, width = 0.5, posDecades = 4 )
# run CytoPipeline object first outputDir <- base::tempdir() rawDataDir <- system.file("extdata", package = "CytoPipeline") experimentName <- "OMIP021_PeacoQC" sampleFiles <- file.path( rawDataDir, list.files(rawDataDir, pattern = "Donor")) jsonDir <- system.file("extdata", package = "CytoPipeline") jsonPath <- file.path(jsonDir, "pipelineParams.json") pipL2 <- CytoPipeline( jsonPath, experimentName = experimentName, sampleFiles = sampleFiles) suppressWarnings(execute( pipL2, rmCache = TRUE, path = outputDir)) ff <- CytoPipeline::getCytoPipelineFlowFrame( pipL2, path = outputDir, whichQueue = "scale transform", objectName = "flowframe_aggregate_obj" ) plotScaleTransformedChannel( ff, channel = "FSC-A", transfoType = "linear", linA = 0.0002, linB = -0.5) plotScaleTransformedChannel( ff, channel = "Comp-670/30Violet-A", transfoType = "logicle", negDecades = 1, width = 0.5, posDecades = 4 ) plotScaleTransformedChannel( ff, channel = "CD3", applyTransform = "data", transfoType = "logicle", negDecades = 1, width = 0.5, posDecades = 4 )
Based on an experiment name, this function will gather the required flowFrame from the CytoPipeline disk cache and display it using the user chosen 1D or 2D view.
plotSelectedFlowFrame( experimentName, whichQueue, sampleFile, flowFrameName, path, xChannelLabel, yChannelLabel, useAllCells, nDisplayCells, useFixedLinearRange, linearRange, transfoListName = " " )
plotSelectedFlowFrame( experimentName, whichQueue, sampleFile, flowFrameName, path, xChannelLabel, yChannelLabel, useAllCells, nDisplayCells, useFixedLinearRange, linearRange, transfoListName = " " )
experimentName |
the experiment name (representing a pipeline run) from which to extract the flow frame |
whichQueue |
"pre-processing" or "scale transform" |
sampleFile |
in case 'whichQueue' is set to 'pre-processing, which sample file to look at. This can be a number or a character.
|
flowFrameName |
the name of the object to fetch (as referenced in the pipeline workflow) |
path |
the root path to look for the CytoPipeline experiment cache |
xChannelLabel |
the label of the channel to be displayed on the x axis:
the conventional syntax is : |
yChannelLabel |
the label of the channel to be displayed on the y axis:
the conventional syntax is : |
useAllCells |
if TRUE, no subsampling will be done |
nDisplayCells |
if useAllCells == FALSE, the number of subsampled cells |
useFixedLinearRange |
if TRUE, all channels using a linear scale will use a fixed range set by linearRange |
linearRange |
set for all channels using a linear scale, if useFixedLinearRange == TRUE |
transfoListName |
if not set to " ", the transformation list (as an object name ending with "_obj", as referenced in the pipeline workflow) to be used for for display. |
a ggplot object
# run CytoPipeline object first outputDir <- base::tempdir() rawDataDir <- system.file("extdata", package = "CytoPipeline") experimentName <- "OMIP021_PeacoQC" sampleFiles <- file.path( rawDataDir, list.files(rawDataDir, pattern = "Donor")) jsonDir <- system.file("extdata", package = "CytoPipeline") jsonPath <- file.path(jsonDir, "pipelineParams.json") pipL2 <- CytoPipeline( jsonPath, experimentName = experimentName, sampleFiles = sampleFiles) suppressWarnings(execute( pipL2, rmCache = TRUE, path = outputDir)) plotSelectedFlowFrame( experimentName = experimentName, whichQueue = "pre-processing", sampleFile = 1, flowFrameName = "remove_debris_obj", path = outputDir, xChannelLabel = "FSC-A : NA", yChannelLabel = "SSC-A : NA", useAllCells = TRUE, nDisplayCells = 0, useFixedLinearRange = TRUE, linearRange = c(-100, 262144)) plotSelectedFlowFrame( experimentName = experimentName, whichQueue = "pre-processing", sampleFile = 1, flowFrameName = "remove_debris_obj", path = outputDir, xChannelLabel = "FSC-A : NA", yChannelLabel = "SSC-A : NA", useAllCells = FALSE, nDisplayCells = 100, useFixedLinearRange = FALSE, linearRange = NULL) plotSelectedFlowFrame( experimentName = experimentName, whichQueue = "pre-processing", sampleFile = 1, flowFrameName = "remove_debris_obj", path = outputDir, xChannelLabel = "Comp-670/30Violet-A : BV785 - CD3", yChannelLabel = "Comp-780/60Red-A : APCCy7 - CD4", useAllCells = TRUE, nDisplayCells = 0, useFixedLinearRange = FALSE, linearRange = NULL, transfoListName = "scale_transform_estimate_obj")
# run CytoPipeline object first outputDir <- base::tempdir() rawDataDir <- system.file("extdata", package = "CytoPipeline") experimentName <- "OMIP021_PeacoQC" sampleFiles <- file.path( rawDataDir, list.files(rawDataDir, pattern = "Donor")) jsonDir <- system.file("extdata", package = "CytoPipeline") jsonPath <- file.path(jsonDir, "pipelineParams.json") pipL2 <- CytoPipeline( jsonPath, experimentName = experimentName, sampleFiles = sampleFiles) suppressWarnings(execute( pipL2, rmCache = TRUE, path = outputDir)) plotSelectedFlowFrame( experimentName = experimentName, whichQueue = "pre-processing", sampleFile = 1, flowFrameName = "remove_debris_obj", path = outputDir, xChannelLabel = "FSC-A : NA", yChannelLabel = "SSC-A : NA", useAllCells = TRUE, nDisplayCells = 0, useFixedLinearRange = TRUE, linearRange = c(-100, 262144)) plotSelectedFlowFrame( experimentName = experimentName, whichQueue = "pre-processing", sampleFile = 1, flowFrameName = "remove_debris_obj", path = outputDir, xChannelLabel = "FSC-A : NA", yChannelLabel = "SSC-A : NA", useAllCells = FALSE, nDisplayCells = 100, useFixedLinearRange = FALSE, linearRange = NULL) plotSelectedFlowFrame( experimentName = experimentName, whichQueue = "pre-processing", sampleFile = 1, flowFrameName = "remove_debris_obj", path = outputDir, xChannelLabel = "Comp-670/30Violet-A : BV785 - CD3", yChannelLabel = "Comp-780/60Red-A : APCCy7 - CD4", useAllCells = TRUE, nDisplayCells = 0, useFixedLinearRange = FALSE, linearRange = NULL, transfoListName = "scale_transform_estimate_obj")
Plot a pipeline workflow from a CytoPipeline run
plotSelectedWorkflow(experimentName, whichQueue, sampleFile, path = path)
plotSelectedWorkflow(experimentName, whichQueue, sampleFile, path = path)
experimentName |
the experiment name (representing a pipeline run) from which to extract the workflow |
whichQueue |
"pre-processing" or "scale transform" |
sampleFile |
in case 'whichQueue' is set to 'pre-processing, which sample file to look at. This can be a number or a character.
|
path |
the root path to look for the CytoPipeline experiment cache |
nothing, but displays the plot as a side effect
# run CytoPipeline object first outputDir <- base::tempdir() rawDataDir <- system.file("extdata", package = "CytoPipeline") experimentName <- "OMIP021_PeacoQC" sampleFiles <- file.path( rawDataDir, list.files(rawDataDir, pattern = "Donor")) jsonDir <- system.file("extdata", package = "CytoPipeline") jsonPath <- file.path(jsonDir, "pipelineParams.json") pipL2 <- CytoPipeline( jsonPath, experimentName = experimentName, sampleFiles = sampleFiles) suppressWarnings(execute( pipL2, rmCache = TRUE, path = outputDir)) plotSelectedWorkflow( experimentName = experimentName, whichQueue = "pre-processing", sampleFile = sampleFiles[1], path = outputDir) plotSelectedWorkflow( experimentName = experimentName, whichQueue = "scale transform", sampleFile = NULL, path = outputDir)
# run CytoPipeline object first outputDir <- base::tempdir() rawDataDir <- system.file("extdata", package = "CytoPipeline") experimentName <- "OMIP021_PeacoQC" sampleFiles <- file.path( rawDataDir, list.files(rawDataDir, pattern = "Donor")) jsonDir <- system.file("extdata", package = "CytoPipeline") jsonPath <- file.path(jsonDir, "pipelineParams.json") pipL2 <- CytoPipeline( jsonPath, experimentName = experimentName, sampleFiles = sampleFiles) suppressWarnings(execute( pipL2, rmCache = TRUE, path = outputDir)) plotSelectedWorkflow( experimentName = experimentName, whichQueue = "pre-processing", sampleFile = sampleFiles[1], path = outputDir) plotSelectedWorkflow( experimentName = experimentName, whichQueue = "scale transform", sampleFile = NULL, path = outputDir)
this application allows the user to visualize a scale transformation list, possibly amending it channel after channel, and save the results on disk. The needed input tranformation list and flow frame for visualization needs to be read from a CytoPipeline experiments stored in cache.
ScaleTransformApp(dir = ".")
ScaleTransformApp(dir = ".")
dir |
the root directory into which the engine will look for existing CytoPipeline experiments |
no return value
# run CytoPipeline object first outputDir <- base::tempdir() rawDataDir <- system.file("extdata", package = "CytoPipeline") experimentName <- "OMIP021_PeacoQC" sampleFiles <- file.path(rawDataDir, list.files(rawDataDir, pattern = "Donor")) jsonDir <- system.file("extdata", package = "CytoPipeline") jsonPath <- file.path(jsonDir, "pipelineParams.json") pipL2 <- CytoPipeline( jsonPath, experimentName = experimentName, sampleFiles = sampleFiles) suppressWarnings(execute( pipL2, rmCache = TRUE, path = outputDir)) # run shiny app if (interactive()) ScaleTransformApp(dir = outputDir)
# run CytoPipeline object first outputDir <- base::tempdir() rawDataDir <- system.file("extdata", package = "CytoPipeline") experimentName <- "OMIP021_PeacoQC" sampleFiles <- file.path(rawDataDir, list.files(rawDataDir, pattern = "Donor")) jsonDir <- system.file("extdata", package = "CytoPipeline") jsonPath <- file.path(jsonDir, "pipelineParams.json") pipL2 <- CytoPipeline( jsonPath, experimentName = experimentName, sampleFiles = sampleFiles) suppressWarnings(execute( pipL2, rmCache = TRUE, path = outputDir)) # run shiny app if (interactive()) ScaleTransformApp(dir = outputDir)