Title: | High Dimensional Stimulation Immune Mapping ('HDStIM') |
---|---|
Description: | A method for identifying responses to experimental stimulation in mass or flow cytometry that uses high dimensional analysis of measured parameters and can be performed with an end-to-end unsupervised approach. In the context of in vitro stimulation assays where high-parameter cytometry was used to monitor intracellular response markers, using cell populations annotated either through automated clustering or manual gating for a combined set of stimulated and unstimulated samples, 'HDStIM' labels cells as responding or non-responding. The package also provides auxiliary functions to rank intracellular markers based on their contribution to identifying responses and generating diagnostic plots. |
Authors: | Rohit Farmer [aut, cre] , Richard Apps [aut] , John Tsang [aut, pdr] |
Maintainer: | Rohit Farmer <[email protected]> |
License: | CC0 | file LICENSE |
Version: | 1.0.0 |
Built: | 2024-11-11 06:02:22 UTC |
Source: | https://github.com/niaid/hdstim |
A list
with the CyTOF stimulation assay data.
chi11
chi11
A list with one tibble
containig CyTOF expression data.
And four character vectors
for arguments in the HDStIM
function.
A 7,000 X 36 tibble
. Cells are on the rows
and variables on the columns. The first 6 columns contain
for each cell cluster_id
(from FlowSOM
clustering),
sample_id
(unique for each FSC file),
condition
(comparison groups), patient_id
(unique for each subject),
stim_type
(labels for types of stimulation assays including the unstim),
merging1
(meta culster labels from ConsensusClusterPlus
).
The last 30 columns contain the archsinh
transformed CyTOF expression
values for the 30 markers (20 type and 10 state) used in the sitmulation panel.
A character vector with the labels for type markers used in the stimulation panel.
A character vector with the labels for state markers used in the stimulation panel.
A character label of the meta-cluster/cluster ID column in chi11$expr_dat
tibble.
A character vector with the label(s) for the stimulation types corresponding to the
labels in thestim_type
column in chi11$expr_data
.
A character label for the unstim cells corresponding to the
labels in thestim_type
column in chi11$expr_data
.
Function to select cells from the stimulated samples that have likely responded to the stimulant.
HDStIM( dat, state_markers, cellpop_col, stim_lab, unstim_lab, p_value = 0.05, seed_val = NULL, umap = FALSE, umap_cells = NULL, verbose = FALSE )
HDStIM( dat, state_markers, cellpop_col, stim_lab, unstim_lab, p_value = 0.05, seed_val = NULL, umap = FALSE, umap_cells = NULL, verbose = FALSE )
dat |
A tibble with the single cell data. Cells on rows and variables/markers on columns. |
state_markers |
A character vector with the labels of state markers from the stimulation panel. |
cellpop_col |
Column in the tibble with the cell population IDs. |
stim_lab |
A character vector of stim label(s). |
unstim_lab |
A character of unstim label(s). |
p_value |
The P-value for Fisher's exact test. Default is 0.05. |
seed_val |
Seed value (integer) for |
umap |
Boolean (T/F) to carry out UMAP on the selected cells. Default is FALSE to skip UMAP calculation. |
umap_cells |
An integer; for calculating UMAPs take a minimum of |
verbose |
Logical. To make function more verbose. Default is FALSE. |
A list with tibbles for expression data for the selected cells, data to plot stacked bar plots, data to plot UMAP plots, and parameters passed to the function.
mapped_data <- HDStIM(chi11$expr_data, chi11$state_markers, chi11$cluster_col, chi11$stim_label, chi11$unstim_label, seed_val = 123, umap = FALSE, umap_cells = NULL, verbose = FALSE)
mapped_data <- HDStIM(chi11$expr_data, chi11$state_markers, chi11$cluster_col, chi11$stim_label, chi11$unstim_label, seed_val = 123, umap = FALSE, umap_cells = NULL, verbose = FALSE)
Function to run Boruta on the stimulation - cell population combinations that passed the Fisher's exact test to rank the markers according to their contribution to the response.
marker_ranking_boruta( mapped_data, path = NULL, n_cells = NULL, max_runs = 100, seed_val = 123, verbose = 0 )
marker_ranking_boruta( mapped_data, path = NULL, n_cells = NULL, max_runs = 100, seed_val = 123, verbose = 0 )
mapped_data |
Returned list from the |
path |
Path to the folder to save figures generated by this function. |
n_cells |
Number of cells to down sample the data. Default is NULL to include all the cells. |
max_runs |
Maximum number of runs for the random forest algorithm. Default is 100. |
seed_val |
Seed value for Boruta. Default is 123. |
verbose |
0, 1, or 2. Default is 0. |
A list with a tibble containing attribute statistics calculated by Boruta and ggplot objects. If the path is not NULL, plots are also rendered and saved in the specified folder in PNG format.
mapped_data <- HDStIM(chi11$expr_data, chi11$state_markers, chi11$cluster_col, chi11$stim_label, chi11$unstim_label, seed_val = 123, umap = FALSE, umap_cells = NULL, verbose = FALSE) marker_ranking <- marker_ranking_boruta(mapped_data, path = NULL, n_cells = NULL, max_runs = 1000, seed_val = 123, verbose = 0)
mapped_data <- HDStIM(chi11$expr_data, chi11$state_markers, chi11$cluster_col, chi11$stim_label, chi11$unstim_label, seed_val = 123, umap = FALSE, umap_cells = NULL, verbose = FALSE) marker_ranking <- marker_ranking_boruta(mapped_data, path = NULL, n_cells = NULL, max_runs = 1000, seed_val = 123, verbose = 0)
Diagnostic plots showing individual marker distribution before and after mapping by HDStIM
plot_exprs(mapped_data, path = NULL, verbose = FALSE)
plot_exprs(mapped_data, path = NULL, verbose = FALSE)
mapped_data |
List output of the |
path |
Path to the folder to save figures generated by this function. |
verbose |
Logical. To make function more verbose. Default is FALSE. |
A list of ggplot objects. If the path is not NULL, PNG files of the plots are saved in the specified folder.
mapped_data <- HDStIM(chi11$expr_data, chi11$state_markers, chi11$cluster_col, chi11$stim_label, chi11$unstim_label, seed_val = 123, umap = FALSE, umap_cells = NULL, verbose = FALSE) pe <- plot_exprs(mapped_data, path = NULL, verbose = FALSE)
mapped_data <- HDStIM(chi11$expr_data, chi11$state_markers, chi11$cluster_col, chi11$stim_label, chi11$unstim_label, seed_val = 123, umap = FALSE, umap_cells = NULL, verbose = FALSE) pe <- plot_exprs(mapped_data, path = NULL, verbose = FALSE)
Diagnostic plots explaining K-means clustering and Fisher's exact test carried out by HDStIM
plot_K_Fisher(mapped_data, path = NULL, verbose = FALSE)
plot_K_Fisher(mapped_data, path = NULL, verbose = FALSE)
mapped_data |
Returned list from the |
path |
Path to the folder to save figures generated by this function NULL by default. |
verbose |
Logical. To make function more verbose. Default is FALSE. |
A list of ggplot objects. If the path is not NULL, PNG files of the plots are saved in the specified folder.
mapped_data <- HDStIM(chi11$expr_data, chi11$state_markers, chi11$cluster_col, chi11$stim_label, chi11$unstim_label, seed_val = 123, umap = FALSE, umap_cells = NULL, verbose = FALSE) pk <- plot_K_Fisher(mapped_data, path = NULL, verbose = FALSE)
mapped_data <- HDStIM(chi11$expr_data, chi11$state_markers, chi11$cluster_col, chi11$stim_label, chi11$unstim_label, seed_val = 123, umap = FALSE, umap_cells = NULL, verbose = FALSE) pk <- plot_K_Fisher(mapped_data, path = NULL, verbose = FALSE)
A consolidated heatmap showing the importance scores of all the state markers (X-axis) from all the stimulation-cell population combinations that passed the Fisher's exact test (Y-axis).
plot_marker_ranking_heatmap(marker_ranking)
plot_marker_ranking_heatmap(marker_ranking)
marker_ranking |
Returned list from the |
A ComplexHeatmap object
mapped_data <- HDStIM(chi11$expr_data, chi11$state_markers, chi11$cluster_col, chi11$stim_label, chi11$unstim_label, seed_val = 123, umap = TRUE, umap_cells = 50, verbose = FALSE) marker_ranking <- marker_ranking_boruta(mapped_data, path = NULL, n_cells = NULL, max_runs = 1000, seed_val = 123, verbose = 0) pht <- plot_marker_ranking_heatmap(marker_ranking)
mapped_data <- HDStIM(chi11$expr_data, chi11$state_markers, chi11$cluster_col, chi11$stim_label, chi11$unstim_label, seed_val = 123, umap = TRUE, umap_cells = 50, verbose = FALSE) marker_ranking <- marker_ranking_boruta(mapped_data, path = NULL, n_cells = NULL, max_runs = 1000, seed_val = 123, verbose = 0) pht <- plot_marker_ranking_heatmap(marker_ranking)
Diagnostic UMAP plots showing the partitioning of cells into responding and non-responding groups by HDStIM
plot_umap(mapped_data, path = NULL, verbose = FALSE)
plot_umap(mapped_data, path = NULL, verbose = FALSE)
mapped_data |
Returned list from the |
path |
Path to the folder to save figures generated by this function. |
verbose |
Logical. To make function more verbose. Default is FALSE. |
A list of ggplot objects. If the path is not NULL, PNG files of the plots are saved in the specified folder.
mapped_data <- HDStIM(chi11$expr_data, chi11$state_markers, chi11$cluster_col, chi11$stim_label, chi11$unstim_label, seed_val = 123, umap = TRUE, umap_cells = 50, verbose = FALSE) pu <- plot_umap(mapped_data, path = NULL, verbose = FALSE)
mapped_data <- HDStIM(chi11$expr_data, chi11$state_markers, chi11$cluster_col, chi11$stim_label, chi11$unstim_label, seed_val = 123, umap = TRUE, umap_cells = 50, verbose = FALSE) pu <- plot_umap(mapped_data, path = NULL, verbose = FALSE)