Title: | tidyFlowCore: Bringing flowCore to the tidyverse |
---|---|
Description: | tidyFlowCore bridges the gap between flow cytometry analysis using the flowCore Bioconductor package and the tidy data principles advocated by the tidyverse. It provides a suite of dplyr-, ggplot2-, and tidyr-like verbs specifically designed for working with flowFrame and flowSet objects as if they were tibbles; however, your data remain flowCore data structures under this layer of abstraction. tidyFlowCore enables intuitive and streamlined analysis workflows that can leverage both the Bioconductor and tidyverse ecosystems for cytometry data. |
Authors: | Timothy Keyes [cre] , Kara Davis [rth, own], Garry Nolan [rth, own] |
Maintainer: | Timothy Keyes <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.1.0 |
Built: | 2024-12-01 05:43:17 UTC |
Source: | https://github.com/bioc/tidyFlowCore |
Order rows using column values
## S3 method for class 'flowFrame' arrange(.data, ..., .by_group = FALSE)
## S3 method for class 'flowFrame' arrange(.data, ..., .by_group = FALSE)
.data |
|
... |
Variables, or functions of variables, to arrange by. |
.by_group |
Unused. |
An object of the same type as .data. The output has the following
properties:
* All rows appear in the output, but (usually) in a different place.
* Columns are not modified.
* The flowFrame
's
identifier
will be preserved.
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::arrange(feature_1)
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::arrange(feature_1)
Order rows using column values
## S3 method for class 'flowSet' arrange(.data, ..., .by_group = FALSE)
## S3 method for class 'flowSet' arrange(.data, ..., .by_group = FALSE)
.data |
A |
... |
Variables, or functions of variables, to arrange by. |
.by_group |
Unused. |
An object of the same type as .data. The output has the following
properties:
* All rows appear in the output, but (usually) in a different place.
* Columns are not modified.
* The flowSet
's
pData
will be preserved.
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::arrange(feature_1)
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::arrange(feature_1)
flowFrame
Coerce an object into a flowFrame
Coerce a data.frame, tbl_df, or tof_tbl into a flowFrame
as_flowFrame(x, ...) ## S3 method for class 'tof_tbl' as_flowFrame(x, ...)
as_flowFrame(x, ...) ## S3 method for class 'tof_tbl' as_flowFrame(x, ...)
x |
A data.frame, tbl_df, or tof_tbl. |
... |
Unused. |
A flowFrame
. Note that all non-numeric
columns in 'x' will be removed.
NULL NULL
NULL NULL
flowSet
Coerce an object into a flowSet
Coerce a tof_tbl into a flowSet
as_flowSet(x, ...) ## S3 method for class 'tof_tbl' as_flowSet(x, group_cols, ...)
as_flowSet(x, ...) ## S3 method for class 'tof_tbl' as_flowSet(x, group_cols, ...)
x |
A tof_tbl. |
... |
Unused. |
group_cols |
Unquoted names of the columns in 'x' that should
be used to group cells into separate |
A flowSet
A flowSet
in which cells are grouped into
constituent flowFrame
s based on the values in
'group_cols'. If no 'group_cols' are specified, a
flowFrame
will be returned instead.
Note that all non-numeric columns in will be removed.
NULL NULL
NULL NULL
Coerce flowFrames or flowSets into tibbles.
as_tof_tbl( flow_data, .name_method = c("tidyFlowCore", "featureNames", "colnames"), sep = "|", ... )
as_tof_tbl( flow_data, .name_method = c("tidyFlowCore", "featureNames", "colnames"), sep = "|", ... )
flow_data |
A flowFrame or flowSet |
.name_method |
A string indicating how tidyFlowCore should extract column
names from 'flow_data'. Available options are "tidyFlowCore" (the default), which
uses tidyFlowCore's internal heuristic to name columns; "featureNames", which
uses |
sep |
A string indicating which symbol should be used to separate antigen names and channel names in the columns of the output tof_tbl when .name_method = 'tidyFlowCore'. |
... |
Optional method-specific arguments. |
A cytometry-specialized tibble called a 'tof_tbl'.
input_file <- system.file("extdata", "0877408774.B08", package="flowCore") input_flowframe <- flowCore::read.FCS(input_file) tof_tibble <- as_tof_tbl(input_flowframe)
input_file <- system.file("extdata", "0877408774.B08", package="flowCore") input_flowframe <- flowCore::read.FCS(input_file) tof_tibble <- as_tof_tbl(input_flowframe)
Convert an object into a tibble-flowCore abstraction (a 'tof_tbl')
## S3 method for class 'flowSet' as_tof_tbl( flow_data, .name_method = c("tidyFlowCore", "featureNames", "colnames"), sep = "|", ..., include_metadata = FALSE, include_tidyFlowCore_identifier = FALSE )
## S3 method for class 'flowSet' as_tof_tbl( flow_data, .name_method = c("tidyFlowCore", "featureNames", "colnames"), sep = "|", ..., include_metadata = FALSE, include_tidyFlowCore_identifier = FALSE )
flow_data |
A FlowSet |
.name_method |
A string indicating how tidyFlowCore should extract column
names for the output tof_tbl from 'flow_data'.
Available options are "tidyFlowCore" (the default), which
uses tidyFlowCore's internal heuristic to name columns; "featureNames", which
uses |
sep |
A string to use to separate the antigen name and its associated channel name in the column names of the output tibble. Defaults to "|". |
... |
Currently unused. |
include_metadata |
A boolean value indicating if the metadata for each
.fcs file read by flowCore (stored in |
include_tidyFlowCore_identifier |
A boolean value indicating if tidyFlowCore's internal identifier for each flowFrame in the flowSet should be included in the output tof_tbl result. Defaults to FALSE. |
A cytometry-specialized tibble called a 'tof_tbl'.
Count the observations in each group.
## S3 method for class 'flowFrame' count(x, ..., wt = NULL, sort = FALSE, name = NULL)
## S3 method for class 'flowFrame' count(x, ..., wt = NULL, sort = FALSE, name = NULL)
x |
|
... |
Variables to group by, named according to
|
wt |
If NULL (the default), counts the number of rows in each group. If a variable, computes sum(wt) for each group. |
sort |
If TRUE, will show the largest groups at the top. |
name |
If omitted, it will default to n. If there's already a column called n, it will use nn. If there's a column called n and nn, it'll use nnn, and so on, adding ns until it gets a new name. |
A data.frame containing the groupwise counts.
my_flowframe <- simulate_cytometry_data()$flowframe |> dplyr::mutate( random_group = sample( c("a", "b"), size = nrow(simulate_cytometry_data()$flowframe), replace = TRUE ) ) my_flowframe |> dplyr::count(random_group)
my_flowframe <- simulate_cytometry_data()$flowframe |> dplyr::mutate( random_group = sample( c("a", "b"), size = nrow(simulate_cytometry_data()$flowframe), replace = TRUE ) ) my_flowframe |> dplyr::count(random_group)
Count the observations in each group.
## S3 method for class 'flowSet' count(x, ..., wt = NULL, sort = FALSE, name = NULL)
## S3 method for class 'flowSet' count(x, ..., wt = NULL, sort = FALSE, name = NULL)
x |
A |
... |
Variables to group by, named according to
|
wt |
If NULL (the default), counts the number of rows in each group. If a variable, computes sum(wt) for each group. |
sort |
If TRUE, will show the largest groups at the top. |
name |
If omitted, it will default to n. If there's already a column called n, it will use nn. If there's a column called n and nn, it'll use nnn, and so on, adding ns until it gets a new name. |
A data.frame containing the groupwise counts. If no columns are specified in '...', the grouping is performed by experiment in the flowSet. Otherwise, the columns specified by '...' will be used for grouping.
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::count() my_flowset |> dplyr::count(cell_type)
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::count() my_flowset |> dplyr::count(cell_type)
Keep rows that match a condition.
## S3 method for class 'flowFrame' filter(.data, ..., .by = NULL, .preserve = FALSE)
## S3 method for class 'flowFrame' filter(.data, ..., .by = NULL, .preserve = FALSE)
.data |
|
... |
Expressions that return a logical value, and are defined in terms
of the variables in the |
.by |
Optionally, a selection of columns to group by for just this operation, functioning as an alternative to group_by(). |
.preserve |
Unused. |
An object of the same type as .data. The output has the
following properties:
* Rows are a subset of the input, but appear in the same order.
* Columns are not modified.
* The flowFrame
's identifier
will be preserved.
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::filter(feature_1 > 50)
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::filter(feature_1 > 50)
Keep rows that match a condition.
## S3 method for class 'flowSet' filter(.data, ..., .by = NULL, .preserve = FALSE)
## S3 method for class 'flowSet' filter(.data, ..., .by = NULL, .preserve = FALSE)
.data |
A |
... |
Expressions that return a logical value, and are defined in terms
of the variables in the |
.by |
Optionally, a selection of columns to group by for just this operation, functioning as an alternative to group_by(). |
.preserve |
Unused. |
An object of the same type as .data. The output has the
following properties:
* Rows are a subset of the input, but appear in the same order.
* Columns are not modified.
* The flowSet
's pData
will be preserved.
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::filter(feature_1 > 50)
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::filter(feature_1 > 50)
Create a new ggplot.
## S3 method for class 'flowFrame' ggplot( data = NULL, mapping = ggplot2::aes(), ..., environment = parent.frame() )
## S3 method for class 'flowFrame' ggplot( data = NULL, mapping = ggplot2::aes(), ..., environment = parent.frame() )
data |
Default dataset to use for plot in the form of a
|
mapping |
Default list of aesthetic mappings to use for plot.
If not specified, must be supplied in each layer added to the plot. Note that
variable names used for aesthetic mappings come from the
|
... |
Other arguments passed on to methods. Not currently used. |
environment |
Deprecated. Used prior to tidy evaluation. |
A ggplot
simulations <- simulate_cytometry_data() test_flowframe <- simulations$flowframe flowframe_plot <- test_flowframe |> ggplot2::ggplot(ggplot2::aes(x = feature_1, y = feature_2)) + ggplot2::geom_point()
simulations <- simulate_cytometry_data() test_flowframe <- simulations$flowframe flowframe_plot <- test_flowframe |> ggplot2::ggplot(ggplot2::aes(x = feature_1, y = feature_2)) + ggplot2::geom_point()
Create a new ggplot.
## S3 method for class 'flowSet' ggplot( data = NULL, mapping = ggplot2::aes(), ..., environment = parent.frame() )
## S3 method for class 'flowSet' ggplot( data = NULL, mapping = ggplot2::aes(), ..., environment = parent.frame() )
data |
Default dataset to use for plot in the form of a
|
mapping |
Default list of aesthetic mappings to use for plot.
If not specified, must be supplied in each layer added to the plot. Note that
variable names used for aesthetic mappings come from the
|
... |
Other arguments passed on to methods. Not currently used. |
environment |
Deprecated. Used prior to tidy evaluation. |
A ggplot
simulations <- simulate_cytometry_data() test_flowset <- simulations$flowset flowset_plot <- test_flowset |> ggplot2::ggplot(ggplot2::aes(x = feature_1, y = feature_2)) + ggplot2::geom_point() flowset_plot_with_metadata <- test_flowset |> # note that `patient` below comes from the flowSet's metadata (pData) ggplot2::ggplot(ggplot2::aes(x = feature_1, y = feature_2, color = patient)) + ggplot2::geom_point()
simulations <- simulate_cytometry_data() test_flowset <- simulations$flowset flowset_plot <- test_flowset |> ggplot2::ggplot(ggplot2::aes(x = feature_1, y = feature_2)) + ggplot2::geom_point() flowset_plot_with_metadata <- test_flowset |> # note that `patient` below comes from the flowSet's metadata (pData) ggplot2::ggplot(ggplot2::aes(x = feature_1, y = feature_2, color = patient)) + ggplot2::geom_point()
Group a flowFrame into a flowSet using one or more variables.
## S3 method for class 'flowFrame' group_by(.data, ..., .add = FALSE, .drop = dplyr::group_by_drop_default(.data))
## S3 method for class 'flowFrame' group_by(.data, ..., .add = FALSE, .drop = dplyr::group_by_drop_default(.data))
.data |
|
... |
Unquoted variables or columns to group by according to .data's
|
.add |
Unused. |
.drop |
Unused. |
A flowSet
containing one
flowFrame
for each of the unique combinations of columns
selected in .... Metadata about grouping columns will be stored in the output
flowSet
's pData
.
my_flowframe <- simulate_cytometry_data()$flowframe |> dplyr::mutate( random_group = sample( c("a", "b"), size = nrow(simulate_cytometry_data()$flowframe), replace = TRUE ) ) my_flowframe |> dplyr::group_by(random_group)
my_flowframe <- simulate_cytometry_data()$flowframe |> dplyr::mutate( random_group = sample( c("a", "b"), size = nrow(simulate_cytometry_data()$flowframe), replace = TRUE ) ) my_flowframe |> dplyr::group_by(random_group)
Make the AnnotatedDataFrame needed for the flowFrame class
make_flowcore_annotated_data_frame(maxes_and_mins)
make_flowcore_annotated_data_frame(maxes_and_mins)
maxes_and_mins |
a data.frame containing information about the max and min values of each channel to be saved in the flowFrame. |
An AnnotatedDataFrame.
NULL
NULL
A character vector used by 'tof_find_panel_info' to detect and parse which CyTOF metals correspond to each channel in an input .fcs file.
data(metal_masterlist)
data(metal_masterlist)
A character vector in which each entry is a pattern that tidyFlowCore searches for in every CyTOF channel in input .fcs files. These patterns are an amalgamate of example .fcs files sampled from the studies linked below.
None
https://github.com/kara-davis-lab/DDPR https://cytobank.org/nolanlab/reports/Levine2015.html https://cytobank.org/nolanlab/reports/Spitzer2015.html https://cytobank.org/nolanlab/reports/Spitzer2017.html https://community.cytobank.org/cytobank/projects/609
Create, modify, and delete columns.
## S3 method for class 'flowFrame' mutate(.data, ...)
## S3 method for class 'flowFrame' mutate(.data, ...)
.data |
|
... |
Name-value pairs. The name (the left side of the equals sign)
gives the name of the column in the output. The right side of the equation
performs computations using the names of each channel according to
|
A flowFrame
. The output has the following properties:
* Columns from .data will be preserved according to the .keep argument.
* Existing columns that are modified by ... will always be returned in their original location.
* New columns created through ... will be placed according to the .before and .after arguments.
* The number of rows is not affected.
* Columns given the value NULL will be removed.
my_flowframe <- simulate_cytometry_data()$flowframe |> dplyr::mutate( random_group = sample( c("a", "b"), size = nrow(simulate_cytometry_data()$flowframe), replace = TRUE ) ) my_flowframe |> dplyr::mutate(new_feature = feature_1 + feature_2)
my_flowframe <- simulate_cytometry_data()$flowframe |> dplyr::mutate( random_group = sample( c("a", "b"), size = nrow(simulate_cytometry_data()$flowframe), replace = TRUE ) ) my_flowframe |> dplyr::mutate(new_feature = feature_1 + feature_2)
Create, modify, and delete columns.
## S3 method for class 'flowSet' mutate(.data, ...)
## S3 method for class 'flowSet' mutate(.data, ...)
.data |
A |
... |
Name-value pairs. The name (the left side of the equals sign)
gives the name of the column in the output. The right side of the equation
performs computations using the names of each channel according to
|
A flowSet
. The output has the following properties:
* Columns from .data will be preserved according to the .keep argument.
* Existing columns that are modified by ... will always be returned in their original location.
* New columns created through ... will be placed according to the .before and .after arguments.
* The number of rows is not affected.
* Columns given the value NULL will be removed.
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::mutate(new_feature = feature_1 + feature_2)
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::mutate(new_feature = feature_1 + feature_2)
flowFrame
into a flowSet
Nest a flowFrame
into a flowSet
## S3 method for class 'flowFrame' nest(.data, ..., .by = NULL, .key = NULL, .names_sep = NULL)
## S3 method for class 'flowFrame' nest(.data, ..., .by = NULL, .key = NULL, .names_sep = NULL)
.data |
|
... |
Columns to nest; these will appear in the inner |
.by |
Columns to nest by; these will be stored in the
|
.key |
Unused. |
.names_sep |
Unused. |
A flowSet
wherein cells are grouped into
constituent flowFrame
s based on which columns are used
to nest.
my_flowframe <- simulate_cytometry_data()$flowframe |> dplyr::mutate( random_group = sample( c("a", "b"), size = nrow(simulate_cytometry_data()$flowframe), replace = TRUE ) ) my_flowframe |> tidyr::nest(.by = random_group)
my_flowframe <- simulate_cytometry_data()$flowframe |> dplyr::mutate( random_group = sample( c("a", "b"), size = nrow(simulate_cytometry_data()$flowframe), replace = TRUE ) ) my_flowframe |> tidyr::nest(.by = random_group)
Constructor for a tof_tibble.
new_tof_tibble(x = dplyr::tibble(), panel = dplyr::tibble())
new_tof_tibble(x = dplyr::tibble(), panel = dplyr::tibble())
x |
A data.frame or tibble containing single-cell mass cytometry data such that rows are cells and columns are CyTOF measurements. |
panel |
A data.frame or tibble containing information about the panel for the mass cytometry data in x. |
A 'tof_tbl', a tibble extension that tracks a few other attributes that are useful for CyTOF data analysis.
Other tof_tbl utilities:
tof_get_panel()
,
tof_set_panel()
pull() is similar to $. It's mostly useful because it looks a little nicer in pipes.
## S3 method for class 'flowFrame' pull(.data, var = -1, name = NULL, ...)
## S3 method for class 'flowFrame' pull(.data, var = -1, name = NULL, ...)
.data |
A |
var |
A variable specified as: * a literal variable name * a positive integer, giving the position counting from the left * a negative integer, giving the position counting from the right. |
name |
An optional parameter that specifies the column to be used as names for a named vector. Specified in a similar manner as var. |
... |
For use by methods. |
A vector the same size as .data.
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::pull(feature_1)
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::pull(feature_1)
pull() is similar to $. It's mostly useful because it looks a little nicer in pipes.
## S3 method for class 'flowSet' pull(.data, var = -1, name = NULL, ...)
## S3 method for class 'flowSet' pull(.data, var = -1, name = NULL, ...)
.data |
A |
var |
A variable specified as: * a literal variable name * a positive integer, giving the position counting from the left * a negative integer, giving the position counting from the right. |
name |
An optional parameter that specifies the column to be used as names for a named vector. Specified in a similar manner as var. |
... |
For use by methods. |
A vector the same size as .data.
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::pull(feature_1)
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::pull(feature_1)
flowFrame
Rename columns in a flowFrame
## S3 method for class 'flowFrame' rename_with(.data, .fn, .cols = dplyr::everything(), ...)
## S3 method for class 'flowFrame' rename_with(.data, .fn, .cols = dplyr::everything(), ...)
.data |
|
.fn |
A function used to transform the selected .cols. Should return a character vector the same length as the input. |
.cols |
Unquoted column names indicating which columns to rename
(as specified by |
... |
Additional arguments passed onto .fn. |
An object of the same type as .data. The output has the following properties:
* Rows are not affected.
* Column names are changed; column order is preserved.
* The flowFrame
's identifier
will be preserved.
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::rename_with(.fn = toupper)
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::rename_with(.fn = toupper)
flowSet
Rename columns in a flowSet
## S3 method for class 'flowSet' rename_with(.data, .fn, .cols = dplyr::everything(), ...)
## S3 method for class 'flowSet' rename_with(.data, .fn, .cols = dplyr::everything(), ...)
.data |
A |
.fn |
A function used to transform the selected .cols. Should return a character vector the same length as the input. |
.cols |
Unquoted column names indicating which columns to rename (as specified by the |
... |
Additional arguments passed onto .fn. |
An object of the same type as .data. The output has the following properties:
* Rows are not affected.
* Column names are changed; column order is preserved.
* The flowSet
's pData
will be preserved.
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::rename_with(.fn = toupper)
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::rename_with(.fn = toupper)
flowFrame
Rename columns in a flowFrame
## S3 method for class 'flowFrame' rename(.data, ...)
## S3 method for class 'flowFrame' rename(.data, ...)
.data |
|
... |
Unquoted name-value pairs (as specified by |
An object of the same type as .data. The output has the following properties:
* Rows are not affected.
* Column names are changed; column order is preserved.
* The flowFrame
's identifier
will be preserved.
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::rename(new_feature = feature_1)
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::rename(new_feature = feature_1)
flowSet
Rename columns in a flowSet
## S3 method for class 'flowSet' rename(.data, ...)
## S3 method for class 'flowSet' rename(.data, ...)
.data |
A |
... |
Unquoted name-value pairs (as specified by the |
An object of the same type as .data. The output has the following properties:
* Rows are not affected.
* Column names are changed; column order is preserved.
* The flowSet
's pData
will be preserved.
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::rename(new_feature = feature_1)
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::rename(new_feature = feature_1)
Keep or drop columns using their names and types.
## S3 method for class 'flowFrame' select(.data, ...)
## S3 method for class 'flowFrame' select(.data, ...)
.data |
|
... |
One or more unquoted expressions separated by commas. Variables names
(as specified by |
A flowFrame
. The output has the following properties:
* Rows are not affected.
* Output columns are a subset of input columns, potentially with a different order. Columns will be renamed if new_name = old_name form is used.
* The flowFrame
's identifier
will be preserved.
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::select(feature_1)
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::select(feature_1)
Keep or drop columns using their names and types.
## S3 method for class 'flowSet' select(.data, ...)
## S3 method for class 'flowSet' select(.data, ...)
.data |
A |
... |
One or more unquoted expressions separated by commas. Variables names
(as specified by the |
A flowSet
. The output has the following properties:
* Rows are not affected.
* Output columns are a subset of input columns, potentially with a different order. Columns will be renamed if new_name = old_name form is used.
* The flowSet
's pData
will be preserved.
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::select(feature_1)
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::select(feature_1)
Simulate Cytometry Data for FlowSet and FlowFrame Analysis
simulate_cytometry_data(num_cells = 100, num_features = 10, num_flowframes = 5)
simulate_cytometry_data(num_cells = 100, num_features = 10, num_flowframes = 5)
num_cells |
An integer indicating the number of cells to simulate. |
num_features |
An integer indicating how many features to simulate. |
num_flowframes |
An integer indicating how many flowFrames to simulate for the simulated flowSet. |
A list containing two entries: a flowFrame and a flowSet.
simulate_cytometry_data()
simulate_cytometry_data()
Subset rows at the head of a data structure.
## S3 method for class 'flowFrame' slice_head(.data, ..., n, prop, by = NULL)
## S3 method for class 'flowFrame' slice_head(.data, ..., n, prop, by = NULL)
.data |
|
... |
Unused. |
n , prop
|
Provide either n, the number of rows, or prop, the proportion of rows to select. If neither are supplied, n = 1 will be used. If n is greater than the number of rows in the group (or prop > 1), the result will be silently truncated to the group size. prop will be rounded towards zero to generate an integer number of rows. A negative value of n or prop will be subtracted from the group size. For example, n = -2 with a group of 5 rows will select 5 - 2 = 3 rows; prop = -0.25 with 8 rows will select 8 * (1 - 0.25) = 6 rows. |
by |
Optionally, an unquoted selection of columns to group by for just this operation. An alternative to group_by. |
An object of the same type as .data. The output has the following properties:
* Each row may appear 0, 1, or many times in the output.
* Columns are not modified.
* Groups are not modified.
* A flowFrame
's identifier
is preserved.
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::slice_head(n = 5)
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::slice_head(n = 5)
Subset rows at the head of a data structure.
## S3 method for class 'flowSet' slice_head(.data, ..., n, prop, by = NULL)
## S3 method for class 'flowSet' slice_head(.data, ..., n, prop, by = NULL)
.data |
A |
... |
Unused. |
n , prop
|
Provide either n, the number of rows, or prop, the proportion of rows to select. If neither are supplied, n = 1 will be used. If n is greater than the number of rows in the group (or prop > 1), the result will be silently truncated to the group size. prop will be rounded towards zero to generate an integer number of rows. A negative value of n or prop will be subtracted from the group size. For example, n = -2 with a group of 5 rows will select 5 - 2 = 3 rows; prop = -0.25 with 8 rows will select 8 * (1 - 0.25) = 6 rows. |
by |
Optionally, an unquoted selection of columns to group by for just this operation. An alternative to group_by. |
An object of the same type as .data. The output has the following properties:
* Each row may appear 0, 1, or many times in the output.
* Columns are not modified.
* Groups are not modified.
* A flowSet
's pData
is preserved.
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::slice_head(n = 10)
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::slice_head(n = 10)
Subset rows of a data structure in order.
## S3 method for class 'flowFrame' slice_max( .data, order_by, ..., n, prop, by = NULL, with_ties = TRUE, na_rm = FALSE )
## S3 method for class 'flowFrame' slice_max( .data, order_by, ..., n, prop, by = NULL, with_ties = TRUE, na_rm = FALSE )
.data |
|
order_by |
Variable or function of variables to order by. To order by multiple variables, wrap them in a data frame or tibble. |
... |
Unused. |
n , prop
|
Provide either n, the number of rows, or prop, the proportion of rows to select. If neither are supplied, n = 1 will be used. If n is greater than the number of rows in the group (or prop > 1), the result will be silently truncated to the group size. prop will be rounded towards zero to generate an integer number of rows. A negative value of n or prop will be subtracted from the group size. For example, n = -2 with a group of 5 rows will select 5 - 2 = 3 rows; prop = -0.25 with 8 rows will select 8 * (1 - 0.25) = 6 rows. |
by |
Optionally, an unquoted selection of columns to group by for just this operation. An alternative to group_by. |
with_ties |
Should ties be kept together? The default, TRUE, may return more rows than you request. Use FALSE to ignore ties, and return the first n rows. |
na_rm |
Should missing values in order_by be removed from the result? If FALSE, NA values are sorted to the end so they will only be included if there are insufficient non-missing values to reach n/prop. |
An object of the same type as .data. The output has the following properties:
* Each row may appear 0, 1, or many times in the output.
* Columns are not modified.
* Groups are not modified.
* A flowFrame
's identifier
is preserved.
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::slice_max(order_by = feature_1, n = 5)
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::slice_max(order_by = feature_1, n = 5)
Subset rows of a data structure in order.
## S3 method for class 'flowSet' slice_max( .data, order_by, ..., n, prop, by = NULL, with_ties = TRUE, na_rm = FALSE )
## S3 method for class 'flowSet' slice_max( .data, order_by, ..., n, prop, by = NULL, with_ties = TRUE, na_rm = FALSE )
.data |
A |
order_by |
Variable or function of variables to order by. To order by multiple variables, wrap them in a data frame or tibble. |
... |
Unused. |
n , prop
|
Provide either n, the number of rows, or prop, the proportion of rows to select. If neither are supplied, n = 1 will be used. If n is greater than the number of rows in the group (or prop > 1), the result will be silently truncated to the group size. prop will be rounded towards zero to generate an integer number of rows. A negative value of n or prop will be subtracted from the group size. For example, n = -2 with a group of 5 rows will select 5 - 2 = 3 rows; prop = -0.25 with 8 rows will select 8 * (1 - 0.25) = 6 rows. |
by |
Optionally, an unquoted selection of columns to group by for just this operation. An alternative to group_by. |
with_ties |
Should ties be kept together? The default, TRUE, may return more rows than you request. Use FALSE to ignore ties, and return the first n rows. |
na_rm |
Should missing values in order_by be removed from the result? If FALSE, NA values are sorted to the end so they will only be included if there are insufficient non-missing values to reach n/prop. |
An object of the same type as .data. The output has the following properties:
* Each row may appear 0, 1, or many times in the output.
* Columns are not modified.
* Groups are not modified.
* A flowSet
's pData
is preserved.
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::slice_max(order_by = feature_1, n = 10)
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::slice_max(order_by = feature_1, n = 10)
Subset rows of a data structure in order.
## S3 method for class 'flowFrame' slice_min( .data, order_by, ..., n, prop, by = NULL, with_ties = TRUE, na_rm = FALSE )
## S3 method for class 'flowFrame' slice_min( .data, order_by, ..., n, prop, by = NULL, with_ties = TRUE, na_rm = FALSE )
.data |
|
order_by |
Variable or function of variables to order by. To order by multiple variables, wrap them in a data frame or tibble. |
... |
Unused. |
n , prop
|
Provide either n, the number of rows, or prop, the proportion of rows to select. If neither are supplied, n = 1 will be used. If n is greater than the number of rows in the group (or prop > 1), the result will be silently truncated to the group size. prop will be rounded towards zero to generate an integer number of rows. A negative value of n or prop will be subtracted from the group size. For example, n = -2 with a group of 5 rows will select 5 - 2 = 3 rows; prop = -0.25 with 8 rows will select 8 * (1 - 0.25) = 6 rows. |
by |
Optionally, an unquoted selection of columns to group by for just this operation. An alternative to group_by. |
with_ties |
Should ties be kept together? The default, TRUE, may return more rows than you request. Use FALSE to ignore ties, and return the first n rows. |
na_rm |
Should missing values in order_by be removed from the result? If FALSE, NA values are sorted to the end so they will only be included if there are insufficient non-missing values to reach n/prop. |
An object of the same type as .data. The output has the following properties:
* Each row may appear 0, 1, or many times in the output.
* Columns are not modified.
* Groups are not modified.
* A flowFrame
's identifier
is preserved.
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::slice_min(order_by = feature_1, n = 5)
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::slice_min(order_by = feature_1, n = 5)
Subset rows of a data structure in order.
## S3 method for class 'flowSet' slice_min( .data, order_by, ..., n, prop, by = NULL, with_ties = TRUE, na_rm = FALSE )
## S3 method for class 'flowSet' slice_min( .data, order_by, ..., n, prop, by = NULL, with_ties = TRUE, na_rm = FALSE )
.data |
A |
order_by |
Variable or function of variables to order by. To order by multiple variables, wrap them in a data frame or tibble. |
... |
Unused. |
n , prop
|
Provide either n, the number of rows, or prop, the proportion of rows to select. If neither are supplied, n = 1 will be used. If n is greater than the number of rows in the group (or prop > 1), the result will be silently truncated to the group size. prop will be rounded towards zero to generate an integer number of rows. A negative value of n or prop will be subtracted from the group size. For example, n = -2 with a group of 5 rows will select 5 - 2 = 3 rows; prop = -0.25 with 8 rows will select 8 * (1 - 0.25) = 6 rows. |
by |
Optionally, an unquoted selection of columns to group by for just this operation. An alternative to group_by. |
with_ties |
Should ties be kept together? The default, TRUE, may return more rows than you request. Use FALSE to ignore ties, and return the first n rows. |
na_rm |
Should missing values in order_by be removed from the result? If FALSE, NA values are sorted to the end so they will only be included if there are insufficient non-missing values to reach n/prop. |
An object of the same type as .data. The output has the following properties:
* Each row may appear 0, 1, or many times in the output.
* Columns are not modified.
* Groups are not modified.
* A flowSet
's pData
is preserved.
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::slice_max(order_by = feature_1, n = 10)
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::slice_max(order_by = feature_1, n = 10)
Subset rows randomly
## S3 method for class 'flowFrame' slice_sample(.data, ..., n, prop, by = NULL, weight_by = NULL, replace = FALSE)
## S3 method for class 'flowFrame' slice_sample(.data, ..., n, prop, by = NULL, weight_by = NULL, replace = FALSE)
.data |
|
... |
Unused. |
n , prop
|
Provide either n, the number of rows, or prop, the proportion of rows to select. If neither are supplied, n = 1 will be used. If n is greater than the number of rows in the group (or prop > 1), the result will be silently truncated to the group size. prop will be rounded towards zero to generate an integer number of rows. A negative value of n or prop will be subtracted from the group size. For example, n = -2 with a group of 5 rows will select 5 - 2 = 3 rows; prop = -0.25 with 8 rows will select 8 * (1 - 0.25) = 6 rows. |
by |
Optionally, an unquoted selection of columns to group by for just this operation. An alternative to group_by. |
weight_by |
Sampling weights. This must evaluate to a vector of non-negative numbers the same length as the input. Weights are automatically standardized to sum to 1. |
replace |
Should sampling be performed with (TRUE) or without (FALSE, the default) replacement. |
An object of the same type as .data. The output has the following properties:
* Each row may appear 0, 1, or many times in the output.
* Columns are not modified.
* Groups are not modified.
* A flowFrame
's identifier
is preserved.
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::slice_sample(n = 5)
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::slice_sample(n = 5)
Subset rows randomly
## S3 method for class 'flowSet' slice_sample(.data, ..., n, prop, by = NULL, weight_by = NULL, replace = FALSE)
## S3 method for class 'flowSet' slice_sample(.data, ..., n, prop, by = NULL, weight_by = NULL, replace = FALSE)
.data |
A |
... |
Unused. |
n , prop
|
Provide either n, the number of rows, or prop, the proportion of rows to select. If neither are supplied, n = 1 will be used. If n is greater than the number of rows in the group (or prop > 1), the result will be silently truncated to the group size. prop will be rounded towards zero to generate an integer number of rows. A negative value of n or prop will be subtracted from the group size. For example, n = -2 with a group of 5 rows will select 5 - 2 = 3 rows; prop = -0.25 with 8 rows will select 8 * (1 - 0.25) = 6 rows. |
by |
Optionally, an unquoted selection of columns to group by for just this operation. An alternative to group_by. |
weight_by |
Sampling weights. This must evaluate to a vector of non-negative numbers the same length as the input. Weights are automatically standardized to sum to 1. |
replace |
Should sampling be performed with (TRUE) or without (FALSE, the default) replacement. |
An object of the same type as .data. The output has the following properties:
* Each row may appear 0, 1, or many times in the output.
* Columns are not modified.
* Groups are not modified.
* A flowSet
's pData
is preserved.
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::slice_sample(n = 10)
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::slice_sample(n = 10)
Subset rows at the tail of a data structure.
## S3 method for class 'flowFrame' slice_tail(.data, ..., n, prop, by = NULL)
## S3 method for class 'flowFrame' slice_tail(.data, ..., n, prop, by = NULL)
.data |
|
... |
Unused. |
n , prop
|
Provide either n, the number of rows, or prop, the proportion of rows to select. If neither are supplied, n = 1 will be used. If n is greater than the number of rows in the group (or prop > 1), the result will be silently truncated to the group size. prop will be rounded towards zero to generate an integer number of rows. A negative value of n or prop will be subtracted from the group size. For example, n = -2 with a group of 5 rows will select 5 - 2 = 3 rows; prop = -0.25 with 8 rows will select 8 * (1 - 0.25) = 6 rows. |
by |
Optionally, an unquoted selection of columns to group by for just this operation. An alternative to group_by. |
An object of the same type as .data. The output has the following properties:
* Each row may appear 0, 1, or many times in the output.
* Columns are not modified.
* Groups are not modified.
* A flowFrame
's identifier
is preserved.
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::slice_tail(n = 5)
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::slice_tail(n = 5)
Subset rows at the tail of a data structure.
## S3 method for class 'flowSet' slice_tail(.data, ..., n, prop, by = NULL)
## S3 method for class 'flowSet' slice_tail(.data, ..., n, prop, by = NULL)
.data |
A |
... |
Unused. |
n , prop
|
Provide either n, the number of rows, or prop, the proportion of rows to select. If neither are supplied, n = 1 will be used. If n is greater than the number of rows in the group (or prop > 1), the result will be silently truncated to the group size. prop will be rounded towards zero to generate an integer number of rows. A negative value of n or prop will be subtracted from the group size. For example, n = -2 with a group of 5 rows will select 5 - 2 = 3 rows; prop = -0.25 with 8 rows will select 8 * (1 - 0.25) = 6 rows. |
by |
Optionally, an unquoted selection of columns to group by for just this operation. An alternative to group_by. |
An object of the same type as .data. The output has the following properties:
* Each row may appear 0, 1, or many times in the output.
* Columns are not modified.
* Groups are not modified.
* A flowSet
's pData
is preserved.
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::slice_tail(n = 10)
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::slice_tail(n = 10)
Subset rows using their positions
## S3 method for class 'flowFrame' slice(.data, ..., .by = NULL, .preserve = FALSE)
## S3 method for class 'flowFrame' slice(.data, ..., .by = NULL, .preserve = FALSE)
.data |
|
... |
Integer row values (to keep). |
.by |
Optionally, an unquoted selection of columns to group by for just this operation. An alternative to group_by. |
.preserve |
Currently unused. |
An object of the same type as .data. The output has the following properties:
* Each row may appear 0, 1, or many times in the output.
* Columns are not modified.
* Groups are not modified.
* A flowSet
's pData
is preserved.
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::slice(1)
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::slice(1)
Subset rows using their positions
## S3 method for class 'flowSet' slice(.data, ..., .by = NULL, .preserve = FALSE)
## S3 method for class 'flowSet' slice(.data, ..., .by = NULL, .preserve = FALSE)
.data |
A |
... |
Integer row values (to keep). |
.by |
Optionally, an unquoted selection of columns to group by for just this operation. An alternative to group_by. |
.preserve |
Currently unused. |
An object of the same type as .data. The output has the following properties:
* Each row may appear 0, 1, or many times in the output.
* Columns are not modified.
* Groups are not modified.
* A flowSet
's pData
is preserved.
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::slice(1)
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::slice(1)
Summarize a flowFrame.
## S3 method for class 'flowFrame' summarise(.data, ..., .by = NULL, .groups = NULL)
## S3 method for class 'flowFrame' summarise(.data, ..., .by = NULL, .groups = NULL)
.data |
.data A |
... |
Name-value pairs of summary functions. The name will be the name of the variable in the result. |
.by |
Optionally, a selection of columns to group by for just this operation, functioning as an alternative to group_by(). |
.groups |
Grouping structure of the result. * "drop_last": dropping the last level of grouping. * "drop": All levels of grouping are dropped. * "keep": Same grouping structure as .data. * "rowwise": Each row is its own group. |
A data.frame containing the summarized result.
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::summarise(feature_1_mean = mean(feature_1))
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::summarise(feature_1_mean = mean(feature_1))
Summarize a flowSet.
## S3 method for class 'flowSet' summarise(.data, ..., .by = NULL, .groups = NULL)
## S3 method for class 'flowSet' summarise(.data, ..., .by = NULL, .groups = NULL)
.data |
.data A |
... |
Name-value pairs of summary functions. The name will be the name of the variable in the result. |
.by |
Optionally, a selection of columns to group by for just this operation, functioning as an alternative to group_by(). |
.groups |
Grouping structure of the result. * "drop_last": dropping the last level of grouping. * "drop": All levels of grouping are dropped. * "keep": Same grouping structure as .data. * "rowwise": Each row is its own group. |
A data.frame containing the summarized result.
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::summarise(feature_1_mean = mean(feature_1))
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::summarise(feature_1_mean = mean(feature_1))
Summarize a flowFrame.
## S3 method for class 'flowFrame' summarize(.data, ..., .by = NULL, .groups = NULL)
## S3 method for class 'flowFrame' summarize(.data, ..., .by = NULL, .groups = NULL)
.data |
.data A |
... |
Name-value pairs of summary functions. The name will be the name of the variable in the result. |
.by |
Optionally, a selection of columns to group by for just this operation, functioning as an alternative to group_by(). |
.groups |
Grouping structure of the result. * "drop_last": dropping the last level of grouping. * "drop": All levels of grouping are dropped. * "keep": Same grouping structure as .data. * "rowwise": Each row is its own group. |
A data.frame containing the summarized result.
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::summarize(feature_1_mean = mean(feature_1))
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::summarize(feature_1_mean = mean(feature_1))
Summarize a flowSet.
## S3 method for class 'flowSet' summarize(.data, ..., .by = NULL, .groups = NULL)
## S3 method for class 'flowSet' summarize(.data, ..., .by = NULL, .groups = NULL)
.data |
A |
... |
Name-value pairs of summary functions. The name will be the name of the variable in the result. |
.by |
Optionally, a selection of columns to group by for just this operation, functioning as an alternative to group_by(). |
.groups |
Grouping structure of the result. * "drop_last": dropping the last level of grouping. * "drop": All levels of grouping are dropped. * "keep": Same grouping structure as .data. * "rowwise": Each row is its own group. |
A data.frame containing the summarized result.
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::summarize(feature_1_mean = mean(feature_1))
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::summarize(feature_1_mean = mean(feature_1))
Using the character vectors obtained from the 'name' and 'desc' columns of the parameters of the data of a flowFrame, infer the cytometry panel used to collect the data and return it as a tidy tibble.
tof_find_panel_info(input_flowFrame)
tof_find_panel_info(input_flowFrame)
input_flowFrame |
A flowFrame (just read from an .fcs file) from which a high-dimensional cytometry panel should be extracted |
A tibble with 4 columns ('channels', 'antigens', '.flowCore_featureNames' and '.flowCore_colnames'). The first two columns correspond to the channels and antigens of the high-dimensional cytometry panel used during data acquisition, respectively. The last two channels represent the featureNames and colnames attributes used to represent each channel in the input flowFrame.
Get panel information from a tof_tibble
tof_get_panel(tof_tibble)
tof_get_panel(tof_tibble)
tof_tibble |
A 'tof_tbl'. |
A tibble containing information about the CyTOF panel that was used during data acquisition for the data contained in 'tof_tibble'.
Other tof_tbl utilities:
new_tof_tibble()
,
tof_set_panel()
NULL
NULL
Set panel information from a tof_tbl
tof_set_panel(tof_tibble, panel)
tof_set_panel(tof_tibble, panel)
tof_tibble |
A 'tof_tbl'. |
panel |
A data.frame containing two columns ('channels' and 'antigens') representing the information about a panel |
A 'tof_tbl' containing information about the CyTOF panel that was used during data acquisition for the data contained in the input 'tof_tibble'. Two columns are required: "metals" and "antigens".
Other tof_tbl utilities:
new_tof_tibble()
,
tof_get_panel()
NULL
NULL
Create, modify, and delete columns.
## S3 method for class 'flowFrame' transmute(.data, ...)
## S3 method for class 'flowFrame' transmute(.data, ...)
.data |
|
... |
Name-value pairs. The name (the left side of the equals sign)
gives the name of the column in the output. The right side of the equation
performs computations using the names of each channel according to
|
A flowFrame
. The output has the following
properties:
* Columns created or modified through ... will be returned in the order specified by ....
* The number of rows is not affected.
* Columns given the value NULL will be removed.
* The flowFrame
's identifier
will be preserved.
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::transmute(new_feature = feature_1 + feature_2)
my_flowframe <- simulate_cytometry_data()$flowframe my_flowframe |> dplyr::transmute(new_feature = feature_1 + feature_2)
Create, modify, and delete columns.
## S3 method for class 'flowSet' transmute(.data, ...)
## S3 method for class 'flowSet' transmute(.data, ...)
.data |
A |
... |
Name-value pairs. The name (the left side of the equals sign)
gives the name of the column in the output. The right side of the equation
performs computations using the names of each channel according to the
|
A flowSet
. The output has the following properties:
* Columns created or modified through ... will be returned in the order specified by ....
* The number of rows is not affected.
* Columns given the value NULL will be removed.
* The flowSet
's pData
will be preserved.
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::transmute(new_feature = feature_1 + feature_2)
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::transmute(new_feature = feature_1 + feature_2)
Ungroup a flowSet
## S3 method for class 'flowSet' ungroup(x, ...)
## S3 method for class 'flowSet' ungroup(x, ...)
x |
A |
... |
Variables/columns in |
A flowFrame
or
flowSet
depending on the degree of ungrouping.
Note that unnest-ing and ungrouping a flowSet
are
equivalent.
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::ungroup()
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> dplyr::ungroup()
flowSet
into a single
flowFrame
Unnest a flowSet
into a single
flowFrame
## S3 method for class 'flowSet' unnest( data, cols, ..., keep_empty = FALSE, ptype = NULL, names_sep = NULL, names_repair = "check_unique" )
## S3 method for class 'flowSet' unnest( data, cols, ..., keep_empty = FALSE, ptype = NULL, names_sep = NULL, names_repair = "check_unique" )
data |
A |
cols |
Columns in |
... |
Unused. |
keep_empty |
Unused. |
ptype |
Unused. |
names_sep |
Unused. |
names_repair |
Unused. |
A flowFrame
or flowSet
depending on the degree of unnest-ing. Note that unnest-ing and
ungrouping a flowSet
are equivalent.
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> tidyr::unnest(cols = c(patient, cell_type)) my_flowset |> tidyr::unnest(cols = patient)
my_flowset <- simulate_cytometry_data()$flowset my_flowset |> tidyr::unnest(cols = c(patient, cell_type)) my_flowset |> tidyr::unnest(cols = patient)