| Title: | 'gDRplots' |
|---|---|
| Description: | gDRplots provides static visualization functions and dedicated helpers for the gDR drug response platform. Designed for high-throughput screening (HTS), pharmacogenomics, and chemical genomics research, it enables comprehensive analysis of single-agent, co-dilution, and drug combination cell viability assays. The package supports quality control (plate layouts, control mapping), data normalization inspection, dose-response curves, distribution boxplots, drug synergy heatmaps with overlaid isobolograms, and combination index plots. Additionally, it integrates with PRISM and DepMap datasets to generate volcano plots and correlation scatter plots for molecular feature associations. |
| Authors: | Marc Hafner [aut] (ORCID: <https://orcid.org/0000-0003-1337-7598>), Janina Smola [aut], Bartosz Czech [aut] (ORCID: <https://orcid.org/0000-0002-9908-3007>), Dariusz Scigocki [aut], Arkadiusz Gladki [aut, cre] (ORCID: <https://orcid.org/0000-0002-7059-6378>) |
| Maintainer: | Arkadiusz Gladki <[email protected]> |
| License: | Artistic-2.0 |
| Version: | 0.99.3 |
| Built: | 2026-10-01 13:42:58 UTC |
| Source: | https://github.com/BiocStaging/gDRplots |
This function analyzes chemical genomics (CGS) data, filters by compound mechanism of action (MOA), prepares the data for Gene Set Enrichment Analysis (GSEA), and performs GSEA for specified cell lines and metrics.
analyze_cgs( dt_metrics, metrics, cl_name = NULL, cellline1 = NULL, cellline2 = NULL, normalization_type = "RV" )analyze_cgs( dt_metrics, metrics, cl_name = NULL, cellline1 = NULL, cellline2 = NULL, normalization_type = "RV" )
dt_metrics |
A data.table containing screening data. Requires columns: 'drug_moa', 'DrugName', 'CellLineName', and columns specified in the 'metrics' argument. |
metrics |
A character vector specifying the response metrics to analyze: "x_mean", "x_AOC_range", "xc50", "ec50", "x_max". |
cl_name |
An optional string specifying a single cell line to analyze. If NULL (default),
all cell lines in the data are analyzed. Should be NULL if |
cellline1 |
An optional string representing the first cell line name.
Should be specified alongside |
cellline2 |
An optional string representing the second cell line name.
Should be specified alongside |
normalization_type |
A string with normalization types to be selected, one of:
"GR" ("GRvalue") or "RV" ("RelativeViability").
Passed to |
A list of results, where each element corresponds to a cell line or cell line difference. Each result contains:
fgsea: GSEA results for the specified metrics,
metrics_diff: The prepped data.table used for the GSEA analysis,
moa_list: A list of DrugNames grouped by drug_moa.
Bartosz Czech [email protected]
dt_metrics <- qs2::qs_read(system.file("testdata/cgs_data.qs2", package = "gDRplots")) analyze_cgs(dt_metrics, metrics = "xc50", cl_name = "CellLineName_1") cellline1 <- "CellLineName_1" cellline2 <- "CellLineName_2" analyze_cgs(dt_metrics, "xc50", cl_name = NULL, cellline1, cellline2)dt_metrics <- qs2::qs_read(system.file("testdata/cgs_data.qs2", package = "gDRplots")) analyze_cgs(dt_metrics, metrics = "xc50", cl_name = "CellLineName_1") cellline1 <- "CellLineName_1" cellline2 <- "CellLineName_2" analyze_cgs(dt_metrics, "xc50", cl_name = NULL, cellline1, cellline2)
This function was lifted from the package factoextra and slightly adjusted.
The default method was changed to "spearman" and an option was added to replace
missing values in the resulting distance matrix with an arbitrary value.
This option defaults to 0 so that the function can be called by
iheatmapr::add_row_clustering and iheatmapr::add_col_clustering.
compute_distances( x, method = "spearman", use = "pairwise.complete.obs", stand = FALSE, dummy = 0, ... )compute_distances( x, method = "spearman", use = "pairwise.complete.obs", stand = FALSE, dummy = 0, ... )
x |
numeric matrix |
method |
character string specifying the distance measure to be used; must be on of: "euclidean", "maximum", "manhattan", "canberra", "binary", "minkowski", "pearson", "spearman" or "kendall" |
use |
character string specifying the method for computing covariances in the presence of missing values. Only used when "pearson", "spearman" or "kendall" chosen as a distance measure |
stand |
logical flag specifying whether the data should be standardized;
if TRUE, columns are converted to z scores using |
dummy |
value to substitute for missing values; defaults to 0 |
... |
arguments passed to internally called functions |
Object of class dist. NA and NaN are substituted by the value of dummy.
The function offers different distance measures but since it is called internally,
it will always use default arguments. As a result, should you want to do
anything other than compute Spearman correlation distance and replace NAs with 0,
you must edit this function definition accordingly. At the moment (December 2020)
this is sufficient. If the control were to be given to the user,
remove defaults for this definition and create a wrapper within plotly_metric_clustering.
The function was originally named computeDistances
Alboukadel Kassambara [email protected]
[factoextra::get_dist()]
x <- matrix(1:9, nrow = 3, ncol = 3) rownames(x) <- letters[seq(NROW(x))] compute_distances(x)x <- matrix(1:9, nrow = 3, ncol = 3) rownames(x) <- letters[seq(NROW(x))] compute_distances(x)
Create a sequence of numbers growing in log-domain.
create_log_seq(start, end, length)create_log_seq(start, end, length)
start, end
|
numeric, lower and upper margins of the sequence |
length |
integer, resulting sequence length |
The result is a numeric vector of length length.
Differences between items are constant in logarithmic domain
and therefore geometrically increase in linear domain.
A numeric vector, see Details.
create_log_seq(1, 2, 5)create_log_seq(1, 2, 5)
Create a nested list of plots for PRISM data with combo metrics
create_PRISM_plot_list_combo( drug1_name_vec, drug2_name_vec, dt_metrics, dt_scores = NULL, normalization_type_vec = "RV", metric = c("xc50", "x_mean", "x_max"), metric_scores = c("hsa_score", "bliss_score"), fit_source = "gDR", meta_data_path, feat_data_path, feature_sets, metadata_columns = NULL, clear_taxonomy_info = TRUE, with_decoding = FALSE )create_PRISM_plot_list_combo( drug1_name_vec, drug2_name_vec, dt_metrics, dt_scores = NULL, normalization_type_vec = "RV", metric = c("xc50", "x_mean", "x_max"), metric_scores = c("hsa_score", "bliss_score"), fit_source = "gDR", meta_data_path, feat_data_path, feature_sets, metadata_columns = NULL, clear_taxonomy_info = TRUE, with_decoding = FALSE )
drug1_name_vec |
character vector with drug names to be plotted (identifiers |
drug2_name_vec |
character vector with co-drug names to be plotted (identifiers |
dt_metrics |
|
dt_scores |
|
normalization_type_vec |
character vector with normalization types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") or both |
metric |
character vector with names of metric;
chosen from: "xc50" ("GR50" or "IC50" - respectively depending on |
metric_scores |
character vector with names of combo metric;
chosen from: "hsa_score"("Bliss Excess GR" or "Bliss Excess RV" - respectively
depending on |
fit_source |
string source name for metrics |
meta_data_path |
string path to metadata file describing all cancer models/cell lines
which are referenced by a dataset contained within the DepMap portal.
It is usually a file named |
feat_data_path |
string path to the directory containing the molecular feature set file to load from DepMap. |
feature_sets |
character vector containing the names of the molecular feature sets to load from DepMap.
These names should also correspond to the file names containing the feature data
(without the extension, which is assumed to be |
metadata_columns |
character vector with the metadata columns to load for DepMap cell lines |
clear_taxonomy_info |
logical flag whether to remove taxonomy information for gene names in table with the molecular feature sets from DepMap. |
with_decoding |
logical whether the feature OmicsArmLevelCNA, OmicsSomaticMutationsMatrixHotspot and OmicsSomaticMutationsMatrixDamaging should be encoded into a 0-1 scheme |
A named list with elements:
ls_plot nested list of plots for selected type of experiment
ls_assoc_data nested list of table with association data
Janina Smoła [email protected]
mae <- qs2::qs_read(system.file("testdata/finalMAE_combo_matrix_small.qs2", package = "gDRtestData")) se_combo <- mae[[gDRutils::get_supported_experiments("combo")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se_combo, "Metrics") drug1 <- unique(dt_metrics[[gDRutils::get_env_identifiers("drug_name")]])[1] drug2 <- unique(dt_metrics[[gDRutils::get_env_identifiers("drug_name2")]])[1] create_PRISM_plot_list_combo( drug1_name_vec = drug1, drug2_name_vec = drug2, dt_metrics = dt_metrics, meta_data_path = system.file("depmap_data/Model.csv.gz", package = "gDRtestData"), feat_data_path = system.file("depmap_data", package = "gDRtestData"), feature_sets = c("CRISPRGeneEffect") )mae <- qs2::qs_read(system.file("testdata/finalMAE_combo_matrix_small.qs2", package = "gDRtestData")) se_combo <- mae[[gDRutils::get_supported_experiments("combo")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se_combo, "Metrics") drug1 <- unique(dt_metrics[[gDRutils::get_env_identifiers("drug_name")]])[1] drug2 <- unique(dt_metrics[[gDRutils::get_env_identifiers("drug_name2")]])[1] create_PRISM_plot_list_combo( drug1_name_vec = drug1, drug2_name_vec = drug2, dt_metrics = dt_metrics, meta_data_path = system.file("depmap_data/Model.csv.gz", package = "gDRtestData"), feat_data_path = system.file("depmap_data", package = "gDRtestData"), feature_sets = c("CRISPRGeneEffect") )
Create a nested list of plots for PRISM data with single-agent metrics
create_PRISM_plot_list_sa( drug_name_vec, dt_metrics, dt_average = NULL, normalization_type_vec = "RV", metric = c("xc50", "x_mean", "x_max"), fit_source = "gDR", meta_data_path, feat_data_path, feature_sets, metadata_columns = NULL, clear_taxonomy_info = TRUE, with_decoding = FALSE )create_PRISM_plot_list_sa( drug_name_vec, dt_metrics, dt_average = NULL, normalization_type_vec = "RV", metric = c("xc50", "x_mean", "x_max"), fit_source = "gDR", meta_data_path, feat_data_path, feature_sets, metadata_columns = NULL, clear_taxonomy_info = TRUE, with_decoding = FALSE )
drug_name_vec |
character vector with drug names to be plotted (identifiers |
dt_metrics |
|
dt_average |
|
normalization_type_vec |
character vector with normalization types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") or both |
metric |
character vector with names of metric;
chosen from: "xc50" ("GR50" or "IC50" - respectively depending on |
fit_source |
string source name for metrics |
meta_data_path |
string path to metadata file describing all cancer models/cell lines
which are referenced by a dataset contained within the DepMap portal.
It is usually a file named |
feat_data_path |
string path to the directory containing the molecular feature set file to load from DepMap. |
feature_sets |
character vector containing the names of the molecular feature sets to load from DepMap.
These names should also correspond to the file names containing the feature data
(without the extension, which is assumed to be |
metadata_columns |
character vector with the metadata columns to load for DepMap cell lines |
clear_taxonomy_info |
logical flag whether to remove taxonomy information for gene names in table with the molecular feature sets from DepMap. |
with_decoding |
logical whether the feature OmicsArmLevelCNA, OmicsSomaticMutationsMatrixHotspot and OmicsSomaticMutationsMatrixDamaging should be encoded into a 0-1 scheme |
A named list with elements:
ls_plot nested list of plots for selected type of experiment
ls_assoc_data nested list of table with association data
Janina Smoła [email protected]
mae <- qs2::qs_read(system.file("testdata/finalMAE_prism.qs2", package = "gDRtestData")) se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se, "Metrics") drug_name <- unique(dt_metrics[[gDRutils::get_env_identifiers("drug_name")]])[1] create_PRISM_plot_list_sa( drug_name_vec = drug_name, dt_metrics = dt_metrics, meta_data_path = system.file("depmap_data/Model.csv.gz", package = "gDRtestData"), feat_data_path = system.file("depmap_data", package = "gDRtestData"), feature_sets = c("CRISPRGeneEffect") )mae <- qs2::qs_read(system.file("testdata/finalMAE_prism.qs2", package = "gDRtestData")) se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se, "Metrics") drug_name <- unique(dt_metrics[[gDRutils::get_env_identifiers("drug_name")]])[1] create_PRISM_plot_list_sa( drug_name_vec = drug_name, dt_metrics = dt_metrics, meta_data_path = system.file("depmap_data/Model.csv.gz", package = "gDRtestData"), feat_data_path = system.file("depmap_data", package = "gDRtestData"), feature_sets = c("CRISPRGeneEffect") )
Create a list of PRISM association table
create_PRISM_summary_list(assoc_summary_RV, assoc_summary_GR = NULL)create_PRISM_summary_list(assoc_summary_RV, assoc_summary_GR = NULL)
assoc_summary_RV |
A |
assoc_summary_GR |
A |
A list of table split by drug name and normalization type
Janina Smoła [email protected]
dir_path <- system.file("testdata", package = "gDRplots") ls_file <- list.files(dir_path, pattern = "[.]xlsx$") assoc_tab <- prep_assoc_summary(dir_path = dir_path, ls_file = ls_file) create_PRISM_summary_list( assoc_summary_RV = assoc_tab[grepl("RV", assoc_tab[["src"]]), ], assoc_summary_GR = assoc_tab[grepl("GR", assoc_tab[["src"]]), ] )dir_path <- system.file("testdata", package = "gDRplots") ls_file <- list.files(dir_path, pattern = "[.]xlsx$") assoc_tab <- prep_assoc_summary(dir_path = dir_path, ls_file = ls_file) create_PRISM_summary_list( assoc_summary_RV = assoc_tab[grepl("RV", assoc_tab[["src"]]), ], assoc_summary_GR = assoc_tab[grepl("GR", assoc_tab[["src"]]), ] )
Fill missing values in the color map for annotation
fill_ann_color_map(dt_ann, map_ann)fill_ann_color_map(dt_ann, map_ann)
dt_ann |
|
map_ann |
|
list with color mapping for the annotations with missing items filled in
Janina Smoła [email protected]
pheatmap_with_anno_sa pheatmap_with_anno_combo
annotation_manual <- data.table::data.table( CellLineName = c("cellline_AA", "cellline_EA", "cellline_IB", "cellline_MC", "cellline_BC"), mut_A = c(0, 0, 1, 2, 3), mut_B = c("yes", "yes", "no", NA, NA), mut_C = c("AA", "AA", "AB", NA, "B") ) annotation_map <- list( mut_A = c("1" = "coral", "0" = "cadetblue"), mut_B = c("yes" = "black", "no" = "grey90", "not_checked" = "lightblue"), mut_C = c("AA" = "red", "AB" = "orange", "B" = "yellow") ) fill_ann_color_map(dt_ann = annotation_manual, map_ann = annotation_map)annotation_manual <- data.table::data.table( CellLineName = c("cellline_AA", "cellline_EA", "cellline_IB", "cellline_MC", "cellline_BC"), mut_A = c(0, 0, 1, 2, 3), mut_B = c("yes", "yes", "no", NA, NA), mut_C = c("AA", "AA", "AB", NA, "B") ) annotation_map <- list( mut_A = c("1" = "coral", "0" = "cadetblue"), mut_B = c("yes" = "black", "no" = "grey90", "not_checked" = "lightblue"), mut_C = c("AA" = "red", "AB" = "orange", "B" = "yellow") ) fill_ann_color_map(dt_ann = annotation_manual, map_ann = annotation_map)
Create color map for annotation
get_ann_color_map(dt_ann)get_ann_color_map(dt_ann)
dt_ann |
|
list with color mapping for the annotations
Janina Smoła [email protected]
mae <- gDRutils::get_synthetic_data("small") se <- mae[[gDRutils::get_supported_experiments("sa")]][2:5, ] dt_average <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "Averaged") dt_ann <- dt_average[,.SD, .SDcols = c("Tissue", "ReferenceDivisionTime")] get_ann_color_map(dt_ann)mae <- gDRutils::get_synthetic_data("small") se <- mae[[gDRutils::get_supported_experiments("sa")]][2:5, ] dt_average <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "Averaged") dt_ann <- dt_average[,.SD, .SDcols = c("Tissue", "ReferenceDivisionTime")] get_ann_color_map(dt_ann)
Calculate the luminance of a color
get_col_luminance(col_name)get_col_luminance(col_name)
col_name |
string representing a valid color |
single element numeric vector
get_col_luminance("blue") get_col_luminance("red") get_col_luminance("#000000") get_col_luminance("#906090") get_col_luminance("#906090F2")get_col_luminance("blue") get_col_luminance("red") get_col_luminance("#000000") get_col_luminance("#906090") get_col_luminance("#906090F2")
Get Legend Title
get_hm_title(metric = "xc50", normalization_type = "GR", dataset_name = NULL)get_hm_title(metric = "xc50", normalization_type = "GR", dataset_name = NULL)
metric |
string name of the metric
one of: "xc50"("GR50" or "IC50" - respectively depending on |
normalization_type |
string with normalization types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
dataset_name |
string name of dataset |
character title for heatmap
get_hm_title(dataset_name = "Dateset DX123", metric = "x_mean", normalization_type = "GR") get_hm_title(metric = "xc50", normalization_type = "GR")get_hm_title(dataset_name = "Dateset DX123", metric = "x_mean", normalization_type = "GR") get_hm_title(metric = "xc50", normalization_type = "GR")
get_iso_colors
get_iso_colors(normalization_type = c("RV", "GR"))get_iso_colors(normalization_type = c("RV", "GR"))
normalization_type |
charvec normalization_types expected in the data |
named charvec with iso colors
get_iso_colors()get_iso_colors()
Create list of qualitative colors
get_qual_colors(n = NULL)get_qual_colors(n = NULL)
n |
number of required colors |
vector with hex colors from qualitative palettes
Janina Smoła [email protected]
get_qual_colors() get_qual_colors(0) get_qual_colors(5) get_qual_colors(35)get_qual_colors() get_qual_colors(0) get_qual_colors(5) get_qual_colors(35)
Plot heatmaps of fitted values for combination metrics data
heatmap_combo_metrics( dt_excess, dt_isobolograms = NULL, drug1_name, drug2_name, cl_name, metric = "smooth", normalization_type = "GR", iso_levels = c("0.25", "0.5", "0.75"), colors_vec_smooth = NULL, colors_vec_excess = NULL, limit = NULL, no_breaks = 50, swap_axes = FALSE, show_values = FALSE )heatmap_combo_metrics( dt_excess, dt_isobolograms = NULL, drug1_name, drug2_name, cl_name, metric = "smooth", normalization_type = "GR", iso_levels = c("0.25", "0.5", "0.75"), colors_vec_smooth = NULL, colors_vec_excess = NULL, limit = NULL, no_breaks = 50, swap_axes = FALSE, show_values = FALSE )
dt_excess |
data.table representing data from the |
dt_isobolograms |
data.table representing data from the |
drug1_name |
string with drug name to be plotted (identifiers |
drug2_name |
string with co-drug name to be plotted (identifiers |
cl_name |
string with cell line to be plotted (identifiers |
metric |
string name of combo metric;
one of: "smooth"("Smooth GR" or "Smooth RV" - respectively depending on |
normalization_type |
string with normalization_types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
iso_levels |
character vector with isobologram levels to be selected |
colors_vec_smooth |
character vector of colors (valid names or hex codes) used in the heatmap for smooth values; the default is the dark purple-light grey palette |
colors_vec_excess |
character vector of colors (valid name or hex codes) used in the heatmap for excess values; the default is the blue-light grey-red color scale |
limit |
numeric vector of length two providing limits of the scale. Use NA to refer to the existing minimum or maximum |
no_breaks |
numeric number of breaks on scale |
swap_axes |
logical flag indicating whether to swap the axes with drugs of the heatmap |
show_values |
logical flag indicating whether to show values of the metric on the heatmap |
ggplot object containing heatmap with the values for the selected combo metric
for selected drugs and cell line with selected isoline (when chosen)
cl_name <- "cellline_BC" drug1_name <- "drug_001" drug2_name <- "drug_026" mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_excess <- gDRutils::convert_se_assay_to_dt(se, "excess") dt_isobolograms <- gDRutils::convert_se_assay_to_dt(se, "isobolograms") heatmap_combo_metrics(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "GR") heatmap_combo_metrics(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "GR", swap_axes = TRUE) heatmap_combo_metrics(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, metric = "hsa_excess", normalization_type = "GR", limit = c(NA, 0.1)) cl_name <- "cellline_JE" drug1_name <- "drug_011" drug2_name <- "drug_026" heatmap_combo_metrics(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, metric = "bliss_excess", normalization_type = "RV", iso_levels = "0.5") heatmap_combo_metrics(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, metric = "bliss_excess", normalization_type = "RV", iso_levels = NULL)cl_name <- "cellline_BC" drug1_name <- "drug_001" drug2_name <- "drug_026" mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_excess <- gDRutils::convert_se_assay_to_dt(se, "excess") dt_isobolograms <- gDRutils::convert_se_assay_to_dt(se, "isobolograms") heatmap_combo_metrics(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "GR") heatmap_combo_metrics(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "GR", swap_axes = TRUE) heatmap_combo_metrics(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, metric = "hsa_excess", normalization_type = "GR", limit = c(NA, 0.1)) cl_name <- "cellline_JE" drug1_name <- "drug_011" drug2_name <- "drug_026" heatmap_combo_metrics(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, metric = "bliss_excess", normalization_type = "RV", iso_levels = "0.5") heatmap_combo_metrics(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, metric = "bliss_excess", normalization_type = "RV", iso_levels = NULL)
Plot panel of heatmaps of fitted values for combination metrics data
heatmap_combo_metrics_panel( dt_excess, dt_isobolograms = NULL, drug1_name, drug2_name, cl_name, normalization_type = "GR", iso_levels = c("0.25", "0.5", "0.75"), colors_vec_smooth = NULL, colors_vec_excess = NULL, no_breaks = 50, as_list = FALSE, one_row_panel = FALSE, swap_axes = FALSE, show_values = FALSE )heatmap_combo_metrics_panel( dt_excess, dt_isobolograms = NULL, drug1_name, drug2_name, cl_name, normalization_type = "GR", iso_levels = c("0.25", "0.5", "0.75"), colors_vec_smooth = NULL, colors_vec_excess = NULL, no_breaks = 50, as_list = FALSE, one_row_panel = FALSE, swap_axes = FALSE, show_values = FALSE )
dt_excess |
data.table representing data from the |
dt_isobolograms |
data.table representing data from the |
drug1_name |
string with drug name to be plotted (identifiers |
drug2_name |
string with co-drug name to be plotted (identifiers |
cl_name |
string with cell line to be plotted (identifiers |
normalization_type |
string with normalization_types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
iso_levels |
character vector with isobologram levels to be selected |
colors_vec_smooth |
character vector of colors (valid names or hex codes) used in the heatmap for smooth values; the default is the dark purple-light grey palette |
colors_vec_excess |
character vector of colors (valid name or hex codes) used in the heatmap for excess values; the default is the blue-light grey-red color scale |
no_breaks |
numeric number of breaks on scale |
as_list |
logical flag whether return list of plot or panel |
one_row_panel |
logical flag whether return panel 2x2 (containing heatmaps for combination metrics and CI plot)
or 3x1 (containing only heatmaps for combination metrics); it is working only for |
swap_axes |
logical flag indicating whether to swap the axes with drugs of the heatmap |
show_values |
logical flag indicating whether to show values of the metric on the heatmap |
ggplot object containing panel with heatmaps with value for excess assays for
selected drugs and cell line with selected isoline and comparison of iso levels
or list of ggplot object containing these plots.
cl_name <- "cellline_BC" drug1_name <- "drug_001" drug2_name <- "drug_026" mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_excess <- gDRutils::convert_se_assay_to_dt(se, "excess") dt_isobolograms <- gDRutils::convert_se_assay_to_dt(se, "isobolograms") heatmap_combo_metrics_panel(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "GR") cl_name <- "cellline_JE" drug1_name <- "drug_011" drug2_name <- "drug_026" heatmap_combo_metrics_panel(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "RV", iso_levels = "0.5", as_list = TRUE) heatmap_combo_metrics_panel(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "RV", iso_levels = "0.5", one_row_panel = TRUE) heatmap_combo_metrics_panel(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "RV", iso_levels = NULL, as_list = FALSE, swap_axes = FALSE) heatmap_combo_metrics_panel(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "RV", iso_levels = NULL, as_list = FALSE, swap_axes = TRUE)cl_name <- "cellline_BC" drug1_name <- "drug_001" drug2_name <- "drug_026" mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_excess <- gDRutils::convert_se_assay_to_dt(se, "excess") dt_isobolograms <- gDRutils::convert_se_assay_to_dt(se, "isobolograms") heatmap_combo_metrics_panel(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "GR") cl_name <- "cellline_JE" drug1_name <- "drug_011" drug2_name <- "drug_026" heatmap_combo_metrics_panel(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "RV", iso_levels = "0.5", as_list = TRUE) heatmap_combo_metrics_panel(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "RV", iso_levels = "0.5", one_row_panel = TRUE) heatmap_combo_metrics_panel(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "RV", iso_levels = NULL, as_list = FALSE, swap_axes = FALSE) heatmap_combo_metrics_panel(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "RV", iso_levels = NULL, as_list = FALSE, swap_axes = TRUE)
Plot heatmaps of averaged values for combination data
heatmap_combo_with_isoref( dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "GR", metric = "smooth", iso_levels = "0.5", colors_vec = NULL, colors_vec_iso = NULL, no_breaks = 50, swap_axes = FALSE )heatmap_combo_with_isoref( dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "GR", metric = "smooth", iso_levels = "0.5", colors_vec = NULL, colors_vec_iso = NULL, no_breaks = 50, swap_axes = FALSE )
dt_excess |
data.table representing data from the |
dt_isobolograms |
data.table representing data from the |
drug1_name |
string with drug name to be plotted (identifiers |
drug2_name |
string with co-drug name to be plotted (identifiers |
cl_name |
string with cell line to be plotted (identifiers |
normalization_type |
string with normalization_types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
metric |
string name of the combo metric;
one of: "smooth" ("Smooth GR" or "Smooth RV" - respectively depending on |
iso_levels |
character vector with isobologram levels to be selected;
when |
colors_vec |
character vector of colors (valid name or hex) used in heatmap;
the default depends on |
colors_vec_iso |
character vector of colors (valid name or hex) used for the isolines; the default is the dark red-orange palette |
no_breaks |
numeric number of breaks on scale |
swap_axes |
logical flag whether to swap the axes with drugs of the heatmap |
ggplot object containing heatmap for fitted values and reference data
for isobolograms for selected drug and co-drug and selected cell line
cl_name <- "cellline_BC" drug1_name <- "drug_001" drug2_name <- "drug_026" mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_excess <- gDRutils::convert_se_assay_to_dt(se, "excess") dt_isobolograms <- gDRutils::convert_se_assay_to_dt(se, "isobolograms") heatmap_combo_with_isoref(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name) heatmap_combo_with_isoref(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, metric = "hsa_excess", iso_levels = c("-0.2", "0.2")) heatmap_combo_with_isoref(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, iso_levels = NULL, colors_vec = c("darkcyan", "snow", "darkorange")) heatmap_combo_with_isoref(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "RV", iso_levels = c("0.25", "0.75"), swap_axes = FALSE) heatmap_combo_with_isoref(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "RV", iso_levels = c("0.25", "0.75"), swap_axes = TRUE) heatmap_combo_with_isoref(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, metric = "hsa_excess", iso_levels = c("0.25", "0.75"), colors_vec_iso = c("0.25" = "darkcyan", "0.75" = "darkblue"), swap_axes = FALSE)cl_name <- "cellline_BC" drug1_name <- "drug_001" drug2_name <- "drug_026" mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_excess <- gDRutils::convert_se_assay_to_dt(se, "excess") dt_isobolograms <- gDRutils::convert_se_assay_to_dt(se, "isobolograms") heatmap_combo_with_isoref(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name) heatmap_combo_with_isoref(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, metric = "hsa_excess", iso_levels = c("-0.2", "0.2")) heatmap_combo_with_isoref(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, iso_levels = NULL, colors_vec = c("darkcyan", "snow", "darkorange")) heatmap_combo_with_isoref(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "RV", iso_levels = c("0.25", "0.75"), swap_axes = FALSE) heatmap_combo_with_isoref(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "RV", iso_levels = c("0.25", "0.75"), swap_axes = TRUE) heatmap_combo_with_isoref(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, metric = "hsa_excess", iso_levels = c("0.25", "0.75"), colors_vec_iso = c("0.25" = "darkcyan", "0.75" = "darkblue"), swap_axes = FALSE)
Plot panel of heatmaps with fitted and reference data for isobolograms
heatmap_combo_with_isoref_panel( dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names, normalization_type = "GR", metric = "smooth", iso_levels = "0.5", colors_vec = NULL, no_breaks = 50, swap_axes = FALSE )heatmap_combo_with_isoref_panel( dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names, normalization_type = "GR", metric = "smooth", iso_levels = "0.5", colors_vec = NULL, no_breaks = 50, swap_axes = FALSE )
dt_excess |
data.table representing data from the |
dt_isobolograms |
data.table representing data from the |
drug1_name |
string with drug name to be plotted (identifiers |
drug2_name |
string with co-drug name to be plotted (identifiers |
cl_names |
character vector with cell line names to be plotted (Cell Line Name);
if |
normalization_type |
string with normalization_types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
metric |
string name of the combo metric;
one of: "smooth" ("Smooth GR" or "Smooth RV" - respectively depending on |
iso_levels |
character vector with isobologram levels to be selected;
when |
colors_vec |
character vector of colors (valid name or hex) used in heatmap;
the default depends on |
no_breaks |
numeric number of breaks on scale |
swap_axes |
logical flag whether to swap the axes with drugs of the heatmap |
ggplot object containing panel with heatmaps for fitted values and reference data
for isobolograms for selected drug and co-drug and all selected cell line
cl_names <- c("cellline_AA", "cellline_EA", "cellline_IB", "cellline_MC", "cellline_BC", "cellline_FD") drug1_name <- "drug_001" drug2_name <- "drug_026" mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_excess <- gDRutils::convert_se_assay_to_dt(se, "excess") dt_isobolograms <- gDRutils::convert_se_assay_to_dt(se, "isobolograms") heatmap_combo_with_isoref_panel(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names) dt_excess_2 <- data.table::copy(dt_excess) invisible(dt_excess_2[CellLineName %in% cl_names[1:2], Concentration := Concentration / 10]) heatmap_combo_with_isoref_panel(dt_excess_2, dt_isobolograms, drug1_name, drug2_name, cl_names, iso_levels = c("0.25", "0.75"), colors_vec = c("darkcyan", "snow", "coral"))cl_names <- c("cellline_AA", "cellline_EA", "cellline_IB", "cellline_MC", "cellline_BC", "cellline_FD") drug1_name <- "drug_001" drug2_name <- "drug_026" mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_excess <- gDRutils::convert_se_assay_to_dt(se, "excess") dt_isobolograms <- gDRutils::convert_se_assay_to_dt(se, "isobolograms") heatmap_combo_with_isoref_panel(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names) dt_excess_2 <- data.table::copy(dt_excess) invisible(dt_excess_2[CellLineName %in% cl_names[1:2], Concentration := Concentration / 10]) heatmap_combo_with_isoref_panel(dt_excess_2, dt_isobolograms, drug1_name, drug2_name, cl_names, iso_levels = c("0.25", "0.75"), colors_vec = c("darkcyan", "snow", "coral"))
#' Plot panel of heatmaps with fitted and reference data for isobolograms
heatmap_combo_with_isoref_panel_common( dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names, normalization_type = "GR", metric = "smooth", iso_levels = "0.5", colors_vec = NULL, no_breaks = 50, swap_axes = FALSE )heatmap_combo_with_isoref_panel_common( dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names, normalization_type = "GR", metric = "smooth", iso_levels = "0.5", colors_vec = NULL, no_breaks = 50, swap_axes = FALSE )
dt_excess |
data.table representing data from the |
dt_isobolograms |
data.table representing data from the |
drug1_name |
string with drug name to be plotted (identifiers |
drug2_name |
string with co-drug name to be plotted (identifiers |
cl_names |
character vector with cell line names to be plotted (Cell Line Name);
if |
normalization_type |
string with normalization_types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
metric |
string name of the combo metric;
one of: "smooth" ("Smooth GR" or "Smooth RV" - respectively depending on |
iso_levels |
character vector with isobologram levels to be selected;
when |
colors_vec |
character vector of colors (valid name or hex) used in heatmap;
the default depends on |
no_breaks |
numeric number of breaks on scale |
swap_axes |
logical flag whether to swap the axes with drugs of the heatmap |
ggplot object containing panel with heatmaps for fitted values and reference data
for isobolograms for selected drug and co-drug by list of cell lines
cl_names <- c("cellline_AA", "cellline_EA", "cellline_IB", "cellline_MC", "cellline_BC", "cellline_FD") drug1_name <- "drug_001" drug2_name <- "drug_026" mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_excess <- gDRutils::convert_se_assay_to_dt(se, "excess") dt_isobolograms <- gDRutils::convert_se_assay_to_dt(se, "isobolograms") heatmap_combo_with_isoref_panel_common(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names) heatmap_combo_with_isoref_panel_common(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names, iso_levels = c("0.25", "0.5")) heatmap_combo_with_isoref_panel_common(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names, metric = "hsa_excess", iso_levels = c("-0.25", "0.25")) heatmap_combo_with_isoref_panel_common(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names, normalization_type = "RV", iso_levels = NULL, colors_vec = c("darkcyan", "snow", "darkorange"), swap_axes = FALSE) heatmap_combo_with_isoref_panel_common(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names, normalization_type = "RV", iso_levels = NULL, colors_vec = c("darkcyan", "snow", "darkorange"), swap_axes = TRUE) heatmap_combo_with_isoref_panel_common(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names, metric = "hsa_excess", iso_levels = NULL, swap_axes = FALSE)cl_names <- c("cellline_AA", "cellline_EA", "cellline_IB", "cellline_MC", "cellline_BC", "cellline_FD") drug1_name <- "drug_001" drug2_name <- "drug_026" mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_excess <- gDRutils::convert_se_assay_to_dt(se, "excess") dt_isobolograms <- gDRutils::convert_se_assay_to_dt(se, "isobolograms") heatmap_combo_with_isoref_panel_common(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names) heatmap_combo_with_isoref_panel_common(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names, iso_levels = c("0.25", "0.5")) heatmap_combo_with_isoref_panel_common(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names, metric = "hsa_excess", iso_levels = c("-0.25", "0.25")) heatmap_combo_with_isoref_panel_common(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names, normalization_type = "RV", iso_levels = NULL, colors_vec = c("darkcyan", "snow", "darkorange"), swap_axes = FALSE) heatmap_combo_with_isoref_panel_common(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names, normalization_type = "RV", iso_levels = NULL, colors_vec = c("darkcyan", "snow", "darkorange"), swap_axes = TRUE) heatmap_combo_with_isoref_panel_common(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names, metric = "hsa_excess", iso_levels = NULL, swap_axes = FALSE)
This function is dedicated to cases in which given cell lines are exposed to drugs of different concentrations and have almost no or no common values.
heatmap_combo_with_isoref_panel_independent( dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names, normalization_type = "GR", metric = "smooth", iso_levels = "0.5", colors_vec = NULL, no_breaks = 50, swap_axes = FALSE )heatmap_combo_with_isoref_panel_independent( dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names, normalization_type = "GR", metric = "smooth", iso_levels = "0.5", colors_vec = NULL, no_breaks = 50, swap_axes = FALSE )
dt_excess |
data.table representing data from the |
dt_isobolograms |
data.table representing data from the |
drug1_name |
string with drug name to be plotted (identifiers |
drug2_name |
string with co-drug name to be plotted (identifiers |
cl_names |
character vector with cell line names to be plotted (Cell Line Name);
if |
normalization_type |
string with normalization_types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
metric |
string name of the combo metric;
one of: "smooth" ("Smooth GR" or "Smooth RV" - respectively depending on |
iso_levels |
character vector with isobologram levels to be selected;
when |
colors_vec |
character vector of colors (valid name or hex) used in heatmap;
the default depends on |
no_breaks |
numeric number of breaks on scale |
swap_axes |
logical flag whether to swap the axes with drugs of the heatmap |
ggplot object containing panel with heatmaps for fitted values and reference data
for isobolograms for selected drug and co-drug by list of cell lines
cl_names <- c("cellline_AA", "cellline_EA", "cellline_IB", "cellline_MC", "cellline_BC", "cellline_FD") drug1_name <- "drug_001" drug2_name <- "drug_026" mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_excess <- gDRutils::convert_se_assay_to_dt(se, "excess") dt_isobolograms <- gDRutils::convert_se_assay_to_dt(se, "isobolograms") heatmap_combo_with_isoref_panel_independent(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names) heatmap_combo_with_isoref_panel_independent(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names, iso_levels = c("-0.25", "0.25")) heatmap_combo_with_isoref_panel_independent( dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names = c("cellline_FD", "cellline_MC", "cellline_AA", "cellline_EA"), iso_levels = c("-0.25", "-0.05", "0.2", "0.65")) heatmap_combo_with_isoref_panel_independent(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names, normalization_type = "RV", iso_levels = NULL, colors_vec = c("darkcyan", "snow", "darkorange"), swap_axes = TRUE)cl_names <- c("cellline_AA", "cellline_EA", "cellline_IB", "cellline_MC", "cellline_BC", "cellline_FD") drug1_name <- "drug_001" drug2_name <- "drug_026" mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_excess <- gDRutils::convert_se_assay_to_dt(se, "excess") dt_isobolograms <- gDRutils::convert_se_assay_to_dt(se, "isobolograms") heatmap_combo_with_isoref_panel_independent(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names) heatmap_combo_with_isoref_panel_independent(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names, iso_levels = c("-0.25", "0.25")) heatmap_combo_with_isoref_panel_independent( dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names = c("cellline_FD", "cellline_MC", "cellline_AA", "cellline_EA"), iso_levels = c("-0.25", "-0.05", "0.2", "0.65")) heatmap_combo_with_isoref_panel_independent(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_names, normalization_type = "RV", iso_levels = NULL, colors_vec = c("darkcyan", "snow", "darkorange"), swap_axes = TRUE)
Plot heatmap of mapping controls to treated for single-agent and combo data to control quality of the data
heatmap_control_mapping_qc(dt_treat, dt_controls)heatmap_control_mapping_qc(dt_treat, dt_controls)
dt_treat |
data.table representation of the data in |
dt_controls |
data.table representation of the data in |
pheatmap object containing hetamap of mapping controls to treated
Bartosz Czech [email protected]
mae <- gDRutils::get_synthetic_data("small") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_treat <- gDRutils::convert_se_assay_to_dt(se, "RawTreated") dt_controls <- gDRutils::convert_se_assay_to_dt(se, "Controls") heatmap_control_mapping_qc(dt_treat = dt_treat, dt_controls = dt_controls) heatmap_control_mapping_qc(dt_treat = dt_treat[1:1350, ], dt_controls = dt_controls) dt_treat_NA <- dt_treat[-c(1:135, 270:405),] heatmap_control_mapping_qc(dt_treat = dt_treat_NA, dt_controls = dt_controls) dt_controls_NA <- dt_controls[-c(1:305, 611:763, 1221:1750),] heatmap_control_mapping_qc(dt_treat = dt_treat, dt_controls = dt_controls_NA) heatmap_control_mapping_qc(dt_treat = dt_treat, dt_controls = dt_controls[1:3660, ])mae <- gDRutils::get_synthetic_data("small") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_treat <- gDRutils::convert_se_assay_to_dt(se, "RawTreated") dt_controls <- gDRutils::convert_se_assay_to_dt(se, "Controls") heatmap_control_mapping_qc(dt_treat = dt_treat, dt_controls = dt_controls) heatmap_control_mapping_qc(dt_treat = dt_treat[1:1350, ], dt_controls = dt_controls) dt_treat_NA <- dt_treat[-c(1:135, 270:405),] heatmap_control_mapping_qc(dt_treat = dt_treat_NA, dt_controls = dt_controls) dt_controls_NA <- dt_controls[-c(1:305, 611:763, 1221:1750),] heatmap_control_mapping_qc(dt_treat = dt_treat, dt_controls = dt_controls_NA) heatmap_control_mapping_qc(dt_treat = dt_treat, dt_controls = dt_controls[1:3660, ])
Determine whether or not a color is dark
is_color_dark(col_name)is_color_dark(col_name)
col_name |
string representing a valid color |
logical flag
is_color_dark("blue") is_color_dark("red") is_color_dark("#000000")is_color_dark("blue") is_color_dark("red") is_color_dark("#000000")
A name of color is valid when either is a color name
listed by grDevices::colors
or a hexadecimal string of the form #rrggbb
is_valid_color(col_name)is_valid_color(col_name)
col_name |
string representing a valid color |
logical flag
is_valid_color("darkblue") is_valid_color("#FF8C00") is_valid_color("#FF8C00DC") is_valid_color("RED")is_valid_color("darkblue") is_valid_color("#FF8C00") is_valid_color("#FF8C00DC") is_valid_color("RED")
Plot pretty heatmap for single-agent or combo data to control quality of the data
pheatmap_qc( dt_average, normalization_type = "GR", metric = "x", fit_source = "gDR", hm_title = NA, colors_vec = c("black", "grey99"), no_breaks = 50, cluster_rows = TRUE, distfun = compute_distances, lbl_by_CellLineName = FALSE, lbl_by_DrugName = FALSE )pheatmap_qc( dt_average, normalization_type = "GR", metric = "x", fit_source = "gDR", hm_title = NA, colors_vec = c("black", "grey99"), no_breaks = 50, cluster_rows = TRUE, distfun = compute_distances, lbl_by_CellLineName = FALSE, lbl_by_DrugName = FALSE )
dt_average |
|
normalization_type |
string with normalization types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
metric |
string name of the metric;
one of: "x" (value of "GR" or "RV" itself - respectively depending on |
fit_source |
string source name for metrics |
hm_title |
string plot title |
colors_vec |
character vector of colors (valid name or hex) used in heatmap
note that for |
no_breaks |
numeric number of breaks on scale used for mapping values to colors |
cluster_rows |
logical flag whether rows should be clustered; the dendrogram will not be shown for the matrix with any dimension greater than 200. |
distfun |
function used to compute the distance (dissimilarity) between rows;
used for the dendrogram when |
lbl_by_CellLineName |
logical flag whether heatmap should be described by CellLineNames instead of clid |
lbl_by_DrugName |
logical flag whether heatmap should be described by DrugName instead of Gnumber |
pheatmap object containing heatmap for selected metric with annotation - if given
mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("sa")]][2:5, ] dt_average <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "Averaged") hm_1 <- pheatmap_qc(dt_average = dt_average) hm_2 <- pheatmap_qc(dt_average = dt_average, normalization_type = "RV", colors_vec = c("darkblue", "grey90"), lbl_by_CellLineName = TRUE, lbl_by_DrugName = TRUE) patchwork::wrap_elements(hm_1[["gtable"]]) patchwork::wrap_elements(hm_2[["gtable"]]) se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_average <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "Averaged") hm_3 <- pheatmap_qc(dt_average = dt_average, cluster_rows = FALSE) hm_4 <- pheatmap_qc(dt_average = dt_average, metric = "x_std", cluster_rows = FALSE) patchwork::wrap_elements(hm_3[["gtable"]]) patchwork::wrap_elements(hm_4[["gtable"]])mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("sa")]][2:5, ] dt_average <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "Averaged") hm_1 <- pheatmap_qc(dt_average = dt_average) hm_2 <- pheatmap_qc(dt_average = dt_average, normalization_type = "RV", colors_vec = c("darkblue", "grey90"), lbl_by_CellLineName = TRUE, lbl_by_DrugName = TRUE) patchwork::wrap_elements(hm_1[["gtable"]]) patchwork::wrap_elements(hm_2[["gtable"]]) se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_average <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "Averaged") hm_3 <- pheatmap_qc(dt_average = dt_average, cluster_rows = FALSE) hm_4 <- pheatmap_qc(dt_average = dt_average, metric = "x_std", cluster_rows = FALSE) patchwork::wrap_elements(hm_3[["gtable"]]) patchwork::wrap_elements(hm_4[["gtable"]])
Plot pretty heatmap with annotations for co-dilution data
pheatmap_with_anno_cd( dt_metrics, normalization_type = "GR", metric = "xc50", fit_source = "gDR", hm_title = NA, colors_vec = NULL, no_breaks = 50, cluster_rows = TRUE, cluster_cols = TRUE, distfun = compute_distances, annotation_row = NULL, annotation_col = NULL, annotation_colors = NULL )pheatmap_with_anno_cd( dt_metrics, normalization_type = "GR", metric = "xc50", fit_source = "gDR", hm_title = NA, colors_vec = NULL, no_breaks = 50, cluster_rows = TRUE, cluster_cols = TRUE, distfun = compute_distances, annotation_row = NULL, annotation_col = NULL, annotation_colors = NULL )
dt_metrics |
|
normalization_type |
string with normalization types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
metric |
string name of the metric;
one of: "xc50" ("GR50" or "IC50" - respectively depending on |
fit_source |
string source name for metrics |
hm_title |
string plot title |
colors_vec |
character vector of colors (valid name or hex) used in heatmap; note that the first color will be assigned to the min value, and the last one - to the max |
no_breaks |
numeric number of breaks on scale used for mapping values to colors |
cluster_rows |
logical flag whether indicating rows should be clustered; the dendrogram will not be shown for the matrix with any dimension greater than 200. |
cluster_cols |
logical flag indicating whether columns should be clustered; the dendrogram will not be shown for the matrix with any dimension greater than 200. |
distfun |
function used to compute the distance (dissimilarity) between both rows and columns;
used for the dendrogram when |
annotation_row |
|
annotation_col |
|
annotation_colors |
named list for specifying |
A named list with elements:
data a list containing the information visualized in the heatmap:
matrix data shown in the heatmap for the selected metric.
annotation_row a table with row annotations (for DrugName), if provided.
annotation_col a table with column annotations (for CellLineName), if provided.
pheatmap object containing the heatmap itself.
Janina Smoła [email protected]
mae <- gDRutils::get_synthetic_data("combo_codilution_small") se <- mae[[gDRutils::get_supported_experiments("cd")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "Metrics") output <- pheatmap_with_anno_cd(dt_metrics = dt_metrics) hm_1 <- output[["heatmap"]] patchwork::wrap_elements(hm_1[["gtable"]]) annotation_manual_col <- unique(dt_metrics[, c("CellLineName", "Tissue"), with = FALSE]) annotation_manual_row <- unique(dt_metrics[, c("DrugName", "DrugName_2", "Concentration_2", "drug_moa", "drug_moa_2"), with = FALSE]) annotation_map <- get_ann_color_map(unique(dt_metrics[, c("Tissue", "drug_moa", "drug_moa_2"), with = FALSE])) output <- pheatmap_with_anno_cd(dt_metrics = dt_metrics, normalization_type = "RV", metric = "x_mean", colors_vec = c("darkblue", "grey90"), annotation_row = annotation_manual_row, annotation_col = annotation_manual_col, annotation_colors = annotation_map) hm_2 <- output[["heatmap"]] patchwork::wrap_elements(hm_2[["gtable"]]) annotation_manual <- data.table::data.table( CellLineName = c("cellline_AA", "cellline_EA", "cellline_IB", "cellline_MC", "cellline_BC"), mut_A = c(1, 1, 1, 0, 0), mut_B = c("yes", "yes", "no", "no", "no") ) annotation_map <- list( mut_A = c("1" = "coral", "0" = "cadetblue"), mut_B = c("yes" = "black", "no" = "grey90") ) output <- pheatmap_with_anno_cd(dt_metrics = dt_metrics, annotation_col = annotation_manual, annotation_colors = annotation_map, hm_title = get_hm_title( normalization_type = "GR", metric = "hsa_score", dataset_name = "Co-dilution data")) hm_3 <- output[["heatmap"]] patchwork::wrap_elements(hm_3[["gtable"]])mae <- gDRutils::get_synthetic_data("combo_codilution_small") se <- mae[[gDRutils::get_supported_experiments("cd")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "Metrics") output <- pheatmap_with_anno_cd(dt_metrics = dt_metrics) hm_1 <- output[["heatmap"]] patchwork::wrap_elements(hm_1[["gtable"]]) annotation_manual_col <- unique(dt_metrics[, c("CellLineName", "Tissue"), with = FALSE]) annotation_manual_row <- unique(dt_metrics[, c("DrugName", "DrugName_2", "Concentration_2", "drug_moa", "drug_moa_2"), with = FALSE]) annotation_map <- get_ann_color_map(unique(dt_metrics[, c("Tissue", "drug_moa", "drug_moa_2"), with = FALSE])) output <- pheatmap_with_anno_cd(dt_metrics = dt_metrics, normalization_type = "RV", metric = "x_mean", colors_vec = c("darkblue", "grey90"), annotation_row = annotation_manual_row, annotation_col = annotation_manual_col, annotation_colors = annotation_map) hm_2 <- output[["heatmap"]] patchwork::wrap_elements(hm_2[["gtable"]]) annotation_manual <- data.table::data.table( CellLineName = c("cellline_AA", "cellline_EA", "cellline_IB", "cellline_MC", "cellline_BC"), mut_A = c(1, 1, 1, 0, 0), mut_B = c("yes", "yes", "no", "no", "no") ) annotation_map <- list( mut_A = c("1" = "coral", "0" = "cadetblue"), mut_B = c("yes" = "black", "no" = "grey90") ) output <- pheatmap_with_anno_cd(dt_metrics = dt_metrics, annotation_col = annotation_manual, annotation_colors = annotation_map, hm_title = get_hm_title( normalization_type = "GR", metric = "hsa_score", dataset_name = "Co-dilution data")) hm_3 <- output[["heatmap"]] patchwork::wrap_elements(hm_3[["gtable"]])
Plot pretty heatmap with annotations for combo data
pheatmap_with_anno_combo( dt_scores, normalization_type = "GR", metric = "hsa_score", fit_source = "gDR", hm_title = NA, colors_vec = NULL, no_breaks = 50, cluster_rows = TRUE, cluster_cols = TRUE, distfun = compute_distances, annotation_row = NULL, annotation_col = NULL, annotation_colors = NULL, max_hm_lbl_length = .get_setting("MAX_HM_LBL_LENGTH") )pheatmap_with_anno_combo( dt_scores, normalization_type = "GR", metric = "hsa_score", fit_source = "gDR", hm_title = NA, colors_vec = NULL, no_breaks = 50, cluster_rows = TRUE, cluster_cols = TRUE, distfun = compute_distances, annotation_row = NULL, annotation_col = NULL, annotation_colors = NULL, max_hm_lbl_length = .get_setting("MAX_HM_LBL_LENGTH") )
dt_scores |
|
normalization_type |
string with normalization types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
metric |
string name of the combo metric;
one of: "hsa_score"("Bliss Excess GR" or "Bliss Excess RV" - respectively
depending on |
fit_source |
string source name for metrics |
hm_title |
string plot title |
colors_vec |
character vector of colors (valid name or hex) used in heatmap; note that the first color will be assigned to the min value, and the last one - to the max |
no_breaks |
numeric number of breaks on scale used for mapping values to colors |
cluster_rows |
logical flag whether rows should be clustered; the dendrogram will not be shown for the matrix with any dimension greater than 200. |
cluster_cols |
logical flag whether columns should be clustered; the dendrogram will not be shown for the matrix with any dimension greater than 200. |
distfun |
function used to compute the distance (dissimilarity) between both rows and columns;
used for the dendrogram when |
annotation_row |
|
annotation_col |
|
annotation_colors |
named list for specifying |
max_hm_lbl_length |
numeric value for the maximum number of characters in the label; if set to Inf, no trimming will be performed; for better readability, it is recommended to use the default number. |
A named list with elements:
data a list containing the information visualized in the heatmap:
matrix data shown in the heatmap for the selected metric.
annotation_row a table with row annotations (for DrugName), if provided.
annotation_col a table with column annotations (for CellLineName), if provided.
pheatmap object containing the heatmap itself.
Janina Smoła [email protected]
mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_scores <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "scores") annotation_manual_col <- unique(dt_scores[, c("CellLineName", "Tissue"), with = FALSE]) annotation_manual_row <- unique(dt_scores[, c("DrugName", "DrugName_2", "drug_moa", "drug_moa_2"), with = FALSE]) annotation_map <- get_ann_color_map(unique(dt_scores[, c("Tissue", "drug_moa", "drug_moa_2"), with = FALSE])) output <- pheatmap_with_anno_combo(dt_scores = dt_scores, normalization_type = "RV", metric = "bliss_score", colors_vec = c("darkblue", "grey90", "darkred"), annotation_row = annotation_manual_row, annotation_col = annotation_manual_col, annotation_colors = annotation_map) hm_1 <- output[["heatmap"]] patchwork::wrap_elements(hm_1[["gtable"]]) annotation_manual <- data.table::data.table( CellLineName = c("cellline_AA", "cellline_EA", "cellline_IB", "cellline_MC", "cellline_BC"), mut_A = c(1, 1, 1, 0, 0), mut_B = c("yes", "yes", "no", "no", "no") ) annotation_map <- list( mut_A = c("1" = "coral", "0" = "cadetblue"), mut_B = c("yes" = "black", "no" = "grey90") ) output <- pheatmap_with_anno_combo(dt_scores = dt_scores, cluster_cols = FALSE, annotation_col = annotation_manual, annotation_colors = annotation_map, hm_title = get_hm_title( normalization_type = "GR", metric = "hsa_score", dataset_name = "Combo Matrix - combo data")) hm_2 <- output[["heatmap"]] patchwork::wrap_elements(hm_2[["gtable"]])mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_scores <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "scores") annotation_manual_col <- unique(dt_scores[, c("CellLineName", "Tissue"), with = FALSE]) annotation_manual_row <- unique(dt_scores[, c("DrugName", "DrugName_2", "drug_moa", "drug_moa_2"), with = FALSE]) annotation_map <- get_ann_color_map(unique(dt_scores[, c("Tissue", "drug_moa", "drug_moa_2"), with = FALSE])) output <- pheatmap_with_anno_combo(dt_scores = dt_scores, normalization_type = "RV", metric = "bliss_score", colors_vec = c("darkblue", "grey90", "darkred"), annotation_row = annotation_manual_row, annotation_col = annotation_manual_col, annotation_colors = annotation_map) hm_1 <- output[["heatmap"]] patchwork::wrap_elements(hm_1[["gtable"]]) annotation_manual <- data.table::data.table( CellLineName = c("cellline_AA", "cellline_EA", "cellline_IB", "cellline_MC", "cellline_BC"), mut_A = c(1, 1, 1, 0, 0), mut_B = c("yes", "yes", "no", "no", "no") ) annotation_map <- list( mut_A = c("1" = "coral", "0" = "cadetblue"), mut_B = c("yes" = "black", "no" = "grey90") ) output <- pheatmap_with_anno_combo(dt_scores = dt_scores, cluster_cols = FALSE, annotation_col = annotation_manual, annotation_colors = annotation_map, hm_title = get_hm_title( normalization_type = "GR", metric = "hsa_score", dataset_name = "Combo Matrix - combo data")) hm_2 <- output[["heatmap"]] patchwork::wrap_elements(hm_2[["gtable"]])
Plots a heatmap for metrics data (e.g., "xc50", "x_inf") covering both Single Agents and Combinations. Rows are sorted alphabetically by the primary drug, prioritizing Single Agent conditions first, followed by combinations sorted by co-treatment name and concentration.
pheatmap_with_anno_combo_metrics( dt_metrics, dt_metrics_capped = NULL, normalization_type = "GR", metric = "x_mean", fit_source = "gDR", hm_title = NA, colors_vec = NULL, no_breaks = 50, cluster_rows = FALSE, cluster_cols = TRUE, distfun = compute_distances, annotation_col = NULL, annotation_colors = NULL, max_hm_lbl_length = .get_setting("MAX_HM_LBL_LENGTH") )pheatmap_with_anno_combo_metrics( dt_metrics, dt_metrics_capped = NULL, normalization_type = "GR", metric = "x_mean", fit_source = "gDR", hm_title = NA, colors_vec = NULL, no_breaks = 50, cluster_rows = FALSE, cluster_cols = TRUE, distfun = compute_distances, annotation_col = NULL, annotation_colors = NULL, max_hm_lbl_length = .get_setting("MAX_HM_LBL_LENGTH") )
dt_metrics |
|
dt_metrics_capped |
|
normalization_type |
string with normalization types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
metric |
string name of the metric;
one of: "xc50" ("GR50" or "IC50" - respectively depending on |
fit_source |
string source name for metrics |
hm_title |
string plot title |
colors_vec |
character vector of colors (valid name or hex) used in heatmap; note that the first color will be assigned to the min value, and the last one - to the max |
no_breaks |
numeric number of breaks on scale used for mapping values to colors |
cluster_rows |
logical flag whether rows should be clustered; the dendrogram will not be shown for the matrix with any dimension greater than 200. |
cluster_cols |
logical flag whether columns should be clustered; the dendrogram will not be shown for the matrix with any dimension greater than 200. |
distfun |
function used to compute the distance (dissimilarity) between both rows and columns;
used for the dendrogram when |
annotation_col |
|
annotation_colors |
named list for specifying |
max_hm_lbl_length |
numeric value for the maximum number of characters in the label; if set to Inf, no trimming will be performed; for better readability, it is recommended to use the default number. |
A named list with elements:
data a list containing the information visualized in the heatmap:
matrix data shown in the heatmap for the selected metric.
annotation_row a table with row annotations (auto-generated).
annotation_col a table with column annotations, if provided.
heatmap the pheatmap object.
Bartosz Czech [email protected]
mae <- gDRutils::get_synthetic_data("combo_matrix_small") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "Metrics") output <- pheatmap_with_anno_combo_metrics(dt_metrics = dt_metrics, normalization_type = "RV", metric = "x_mean") hm_1 <- output[["heatmap"]] patchwork::wrap_elements(hm_1[["gtable"]]) annotation_manual <- data.table::data.table( CellLineName = c("cellline_AA", "cellline_GB", "cellline_HB"), mut_A = c(0, 1, 1), mut_B = c("yes", "yes", "no") ) annotation_map <- list( mut_A = c("1" = "coral", "0" = "cadetblue"), mut_B = c("yes" = "black", "no" = "grey90") ) output <- pheatmap_with_anno_combo_metrics(dt_metrics = dt_metrics, metric = "ec50", normalization_type = "GR", annotation_col = annotation_manual, annotation_colors = annotation_map, hm_title = get_hm_title( normalization_type = "GR", metric = "EC50 for combo data ", dataset_name = "Combo data")) mae <- gDRutils::get_synthetic_data("combo_triple") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "Metrics", merge_additional_variables = TRUE) output <- pheatmap_with_anno_combo_metrics(dt_metrics = dt_metrics, normalization_type = "RV", metric = "x_mean") hm_4 <- output[["heatmap"]] patchwork::wrap_elements(hm_4[["gtable"]])mae <- gDRutils::get_synthetic_data("combo_matrix_small") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "Metrics") output <- pheatmap_with_anno_combo_metrics(dt_metrics = dt_metrics, normalization_type = "RV", metric = "x_mean") hm_1 <- output[["heatmap"]] patchwork::wrap_elements(hm_1[["gtable"]]) annotation_manual <- data.table::data.table( CellLineName = c("cellline_AA", "cellline_GB", "cellline_HB"), mut_A = c(0, 1, 1), mut_B = c("yes", "yes", "no") ) annotation_map <- list( mut_A = c("1" = "coral", "0" = "cadetblue"), mut_B = c("yes" = "black", "no" = "grey90") ) output <- pheatmap_with_anno_combo_metrics(dt_metrics = dt_metrics, metric = "ec50", normalization_type = "GR", annotation_col = annotation_manual, annotation_colors = annotation_map, hm_title = get_hm_title( normalization_type = "GR", metric = "EC50 for combo data ", dataset_name = "Combo data")) mae <- gDRutils::get_synthetic_data("combo_triple") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "Metrics", merge_additional_variables = TRUE) output <- pheatmap_with_anno_combo_metrics(dt_metrics = dt_metrics, normalization_type = "RV", metric = "x_mean") hm_4 <- output[["heatmap"]] patchwork::wrap_elements(hm_4[["gtable"]])
Plot pretty heatmap with annotations for single-agent data
pheatmap_with_anno_sa( dt_metrics, dt_metrics_capped = NULL, normalization_type = "GR", metric = "xc50", fit_source = "gDR", hm_title = NA, colors_vec = NULL, no_breaks = 50, cluster_rows = TRUE, cluster_cols = TRUE, distfun = compute_distances, annotation_row = NULL, annotation_col = NULL, annotation_colors = NULL, max_hm_lbl_length = .get_setting("MAX_HM_LBL_LENGTH") )pheatmap_with_anno_sa( dt_metrics, dt_metrics_capped = NULL, normalization_type = "GR", metric = "xc50", fit_source = "gDR", hm_title = NA, colors_vec = NULL, no_breaks = 50, cluster_rows = TRUE, cluster_cols = TRUE, distfun = compute_distances, annotation_row = NULL, annotation_col = NULL, annotation_colors = NULL, max_hm_lbl_length = .get_setting("MAX_HM_LBL_LENGTH") )
dt_metrics |
|
dt_metrics_capped |
|
normalization_type |
string with normalization types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
metric |
string name of the metric;
one of: "xc50" ("GR50" or "IC50" - respectively depending on |
fit_source |
string source name for metrics |
hm_title |
string plot title |
colors_vec |
character vector of colors (valid name or hex) used in heatmap; note that the first color will be assigned to the min value, and the last one - to the max |
no_breaks |
numeric number of breaks on scale used for mapping values to colors |
cluster_rows |
logical flag whether rows should be clustered; the dendrogram will not be shown for the matrix with any dimension greater than 200. |
cluster_cols |
logical flag whether columns should be clustered; the dendrogram will not be shown for the matrix with any dimension greater than 200. |
distfun |
function used to compute the distance (dissimilarity) between both rows and columns;
used for the dendrogram when |
annotation_row |
|
annotation_col |
|
annotation_colors |
named list for specifying |
max_hm_lbl_length |
numeric value for the maximum number of characters in the label; if set to Inf, no trimming will be performed; for better readability, it is recommended to use the default number. |
A named list with elements:
data a list containing the information visualized in the heatmap:
matrix data shown in the heatmap for the selected metric.
annotation_row a table with row annotations (for DrugName), if provided.
annotation_col a table with column annotations (for CellLineName), if provided.
pheatmap object containing the heatmap itself.
Janina Smoła [email protected]
mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "Metrics") dt_averaged <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "Averaged") dt_metrics_capped <- gDRutils::cap_assay_infinities( conc_assay_dt = dt_averaged, assay_dt = dt_metrics, experiment_name = gDRutils::get_supported_experiments("sa"), col = "xc50", capping_fold = 5) output <- pheatmap_with_anno_sa(dt_metrics = dt_metrics) hm_0 <- output[["heatmap"]] patchwork::wrap_elements(hm_0[["gtable"]]) output <- pheatmap_with_anno_sa(dt_metrics = dt_metrics, dt_metrics_capped = dt_metrics_capped) hm_1 <- output[["heatmap"]] patchwork::wrap_elements(hm_1[["gtable"]]) annotation_manual_col <- unique(dt_metrics[, c("CellLineName", "Tissue"), with = FALSE]) annotation_manual_row <- unique(dt_metrics[, c("DrugName", "drug_moa"), with = FALSE]) annotation_map <- get_ann_color_map(unique(dt_metrics[, c("Tissue", "drug_moa"), with = FALSE])) output <- pheatmap_with_anno_sa(dt_metrics = dt_metrics, normalization_type = "RV", metric = "x_mean", colors_vec = c("darkblue", "grey90"), annotation_row = annotation_manual_row, annotation_col = annotation_manual_col, annotation_colors = annotation_map) hm_2 <- output[["heatmap"]] patchwork::wrap_elements(hm_2[["gtable"]]) annotation_manual <- data.table::data.table( CellLineName = c("cellline_AA", "cellline_EA", "cellline_IB", "cellline_MC", "cellline_BC"), mut_A = c(1, 1, 1, 0, 0), mut_B = c("yes", "yes", "no", "no", "no") ) annotation_map <- list( mut_A = c("1" = "coral", "0" = "cadetblue"), mut_B = c("yes" = "black", "no" = "grey90") ) output <- pheatmap_with_anno_sa(dt_metrics = dt_metrics, annotation_col = annotation_manual, annotation_colors = annotation_map, hm_title = get_hm_title( normalization_type = "GR", metric = "hsa_score", dataset_name = "Combo Matrix - combo data")) hm_3 <- output[["heatmap"]] patchwork::wrap_elements(hm_3[["gtable"]])mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "Metrics") dt_averaged <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "Averaged") dt_metrics_capped <- gDRutils::cap_assay_infinities( conc_assay_dt = dt_averaged, assay_dt = dt_metrics, experiment_name = gDRutils::get_supported_experiments("sa"), col = "xc50", capping_fold = 5) output <- pheatmap_with_anno_sa(dt_metrics = dt_metrics) hm_0 <- output[["heatmap"]] patchwork::wrap_elements(hm_0[["gtable"]]) output <- pheatmap_with_anno_sa(dt_metrics = dt_metrics, dt_metrics_capped = dt_metrics_capped) hm_1 <- output[["heatmap"]] patchwork::wrap_elements(hm_1[["gtable"]]) annotation_manual_col <- unique(dt_metrics[, c("CellLineName", "Tissue"), with = FALSE]) annotation_manual_row <- unique(dt_metrics[, c("DrugName", "drug_moa"), with = FALSE]) annotation_map <- get_ann_color_map(unique(dt_metrics[, c("Tissue", "drug_moa"), with = FALSE])) output <- pheatmap_with_anno_sa(dt_metrics = dt_metrics, normalization_type = "RV", metric = "x_mean", colors_vec = c("darkblue", "grey90"), annotation_row = annotation_manual_row, annotation_col = annotation_manual_col, annotation_colors = annotation_map) hm_2 <- output[["heatmap"]] patchwork::wrap_elements(hm_2[["gtable"]]) annotation_manual <- data.table::data.table( CellLineName = c("cellline_AA", "cellline_EA", "cellline_IB", "cellline_MC", "cellline_BC"), mut_A = c(1, 1, 1, 0, 0), mut_B = c("yes", "yes", "no", "no", "no") ) annotation_map <- list( mut_A = c("1" = "coral", "0" = "cadetblue"), mut_B = c("yes" = "black", "no" = "grey90") ) output <- pheatmap_with_anno_sa(dt_metrics = dt_metrics, annotation_col = annotation_manual, annotation_colors = annotation_map, hm_title = get_hm_title( normalization_type = "GR", metric = "hsa_score", dataset_name = "Combo Matrix - combo data")) hm_3 <- output[["heatmap"]] patchwork::wrap_elements(hm_3[["gtable"]])
Plot boxplot for metric values grouped by metadata from DepMap
plot_boxplot_meta( dt_response, dt_depmap, selected_feat_meta_col, with_1_item_grp = TRUE, max_x_lbl_length = 60, with_inf = FALSE )plot_boxplot_meta( dt_response, dt_depmap, selected_feat_meta_col, with_1_item_grp = TRUE, max_x_lbl_length = 60, with_inf = FALSE )
dt_response |
|
dt_depmap |
|
selected_feat_meta_col |
string with the name of the selected metadata from |
with_1_item_grp |
logical flag indicating whether to show group with only one item |
max_x_lbl_length |
numeric value for the maximum number of characters in the x-axis label |
with_inf |
a logical flag indicating whether infinite values should be shown on boxplots |
ggplot object containing boxplots for variable levels
Janina Smoła [email protected]
mae_prism <- gDRutils::get_synthetic_data("prism") se_prism <- mae_prism[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se_prism, "Metrics") dt_response <- prep_dt_response_metric_sa( dt_metrics = dt_metrics, d_name = unique(dt_metrics[["DrugName"]])[1], normalization_type = "RV", metric = "x_mean") meta_data_path <- system.file("depmap_data/Model.csv.gz", package = "gDRtestData") obj_depmap_meta <- prep_dt_depmap_meta(meta_data_path, metadata_col = "OncotreeLineage") plot_boxplot_meta( dt_response = dt_response, dt_depmap = obj_depmap_meta[["dt_depmap"]], selected_feat_meta_col = obj_depmap_meta[["selected_feat_meta_col"]])mae_prism <- gDRutils::get_synthetic_data("prism") se_prism <- mae_prism[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se_prism, "Metrics") dt_response <- prep_dt_response_metric_sa( dt_metrics = dt_metrics, d_name = unique(dt_metrics[["DrugName"]])[1], normalization_type = "RV", metric = "x_mean") meta_data_path <- system.file("depmap_data/Model.csv.gz", package = "gDRtestData") obj_depmap_meta <- prep_dt_depmap_meta(meta_data_path, metadata_col = "OncotreeLineage") plot_boxplot_meta( dt_response = dt_response, dt_depmap = obj_depmap_meta[["dt_depmap"]], selected_feat_meta_col = obj_depmap_meta[["selected_feat_meta_col"]])
Plot box plots for metric for combo data grouped by selected variable
plot_boxplot_metric_combo( dt_scores, group_var, normalization_type = "GR", metric = "hsa_score", fit_source = "gDR", grouped_flag = FALSE, colored_pts_flag = FALSE, colors_vec = NULL )plot_boxplot_metric_combo( dt_scores, group_var, normalization_type = "GR", metric = "hsa_score", fit_source = "gDR", grouped_flag = FALSE, colored_pts_flag = FALSE, colors_vec = NULL )
dt_scores |
|
group_var |
string name of group variable; one of: |
normalization_type |
string with normalization types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
metric |
string name of the combo metric;
one of: "hsa_score"("Bliss Excess GR" or "Bliss Excess RV" - respectively
depending on |
fit_source |
string source name for metrics |
grouped_flag |
a logical flag whether the boxplots should be grouped and
colored by |
colored_pts_flag |
a logical flag whether the points should be colored by grouped variable -
for |
colors_vec |
character vector with colors (name or hex value) to color boxplots;
for |
ggplot object containing boxplots for selected combo metric
grouped by group_var
Janina Smoła [email protected]
mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_scores <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "scores") plot_boxplot_metric_combo(dt_scores, group_var = "DrugName") plot_boxplot_metric_combo(dt_scores, group_var = "DrugName", colored_pts_flag = TRUE, colors_vec = "grey") plot_boxplot_metric_combo(dt_scores, group_var = "CellLineName", metric = "hsa_score", normalization_type = "RV", grouped_flag = TRUE) plot_boxplot_metric_combo( dt_scores, group_var = "CellLineName", metric = "hsa_score", grouped_flag = TRUE, colors_vec = c("deeppink", "darkblue"))mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_scores <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "scores") plot_boxplot_metric_combo(dt_scores, group_var = "DrugName") plot_boxplot_metric_combo(dt_scores, group_var = "DrugName", colored_pts_flag = TRUE, colors_vec = "grey") plot_boxplot_metric_combo(dt_scores, group_var = "CellLineName", metric = "hsa_score", normalization_type = "RV", grouped_flag = TRUE) plot_boxplot_metric_combo( dt_scores, group_var = "CellLineName", metric = "hsa_score", grouped_flag = TRUE, colors_vec = c("deeppink", "darkblue"))
Plot box plots for metric for combo data grouped by cell line names
plot_boxplot_metric_combo_by_CLs( dt_scores, normalization_type = "GR", metric = "hsa_score", fit_source = "gDR", grouped_flag = FALSE, colored_pts_flag = FALSE, colors_vec = NULL )plot_boxplot_metric_combo_by_CLs( dt_scores, normalization_type = "GR", metric = "hsa_score", fit_source = "gDR", grouped_flag = FALSE, colored_pts_flag = FALSE, colors_vec = NULL )
dt_scores |
|
normalization_type |
string with normalization types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
metric |
string name of the combo metric;
one of: "hsa_score"("Bliss Excess GR" or "Bliss Excess RV" - respectively
depending on |
fit_source |
string source name for metrics |
grouped_flag |
a logical flag whether the boxplots should be grouped and
colored by |
colored_pts_flag |
a logical flag whether the points should be colored by grouped variable -
for |
colors_vec |
character vector with colors (name or hex value) to color boxplots;
for |
ggplot object containing boxplots for selected combo metric
grouped by cell line names
Janina Smoła [email protected]
mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_scores <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "scores") plot_boxplot_metric_combo_by_CLs(dt_scores) plot_boxplot_metric_combo_by_CLs(dt_scores, normalization_type = "RV", grouped_flag = TRUE) plot_boxplot_metric_combo_by_CLs(dt_scores, metric = "bliss_score", colors_vec = "gold") plot_boxplot_metric_combo_by_CLs( dt_scores, metric = "bliss_score", colored_pts_flag = TRUE) plot_boxplot_metric_combo_by_CLs( dt_scores, metric = "hsa_score", normalization_type = "RV", grouped_flag = TRUE, colors_vec = c("tomato", "darkgreen", "orange", "darkblue"))mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_scores <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "scores") plot_boxplot_metric_combo_by_CLs(dt_scores) plot_boxplot_metric_combo_by_CLs(dt_scores, normalization_type = "RV", grouped_flag = TRUE) plot_boxplot_metric_combo_by_CLs(dt_scores, metric = "bliss_score", colors_vec = "gold") plot_boxplot_metric_combo_by_CLs( dt_scores, metric = "bliss_score", colored_pts_flag = TRUE) plot_boxplot_metric_combo_by_CLs( dt_scores, metric = "hsa_score", normalization_type = "RV", grouped_flag = TRUE, colors_vec = c("tomato", "darkgreen", "orange", "darkblue"))
Plot box plots for metric for combo data grouped by drug names
plot_boxplot_metric_combo_by_drugs( dt_scores, normalization_type = "GR", metric = "hsa_score", fit_source = "gDR", colored_pts_flag = FALSE, colors_vec = NULL )plot_boxplot_metric_combo_by_drugs( dt_scores, normalization_type = "GR", metric = "hsa_score", fit_source = "gDR", colored_pts_flag = FALSE, colors_vec = NULL )
dt_scores |
|
normalization_type |
string with normalization types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
metric |
string name of the combo metric;
one of: "hsa_score"("Bliss Excess GR" or "Bliss Excess RV" - respectively
depending on |
fit_source |
string source name for metrics |
colored_pts_flag |
a logical flag whether the points should be colored by grouped variable -
for |
colors_vec |
character vector with colors (name or hex value) to color boxplots;
for |
ggplot object containing boxplots for selected combo metric
grouped by drug names
Janina Smoła [email protected]
mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_scores <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "scores") plot_boxplot_metric_combo_by_drugs(dt_scores) plot_boxplot_metric_combo_by_drugs(dt_scores, normalization_type = "RV", colors_vec = "gold") plot_boxplot_metric_combo_by_drugs(dt_scores, metric = "bliss_score", normalization_type = "RV", colored_pts_flag = TRUE)mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_scores <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "scores") plot_boxplot_metric_combo_by_drugs(dt_scores) plot_boxplot_metric_combo_by_drugs(dt_scores, normalization_type = "RV", colors_vec = "gold") plot_boxplot_metric_combo_by_drugs(dt_scores, metric = "bliss_score", normalization_type = "RV", colored_pts_flag = TRUE)
Plot box plots for metric for combo data grouped by selected variable
plot_boxplot_metric_combo_by_grp( dt_scores, selection_var, selection_name, group_var, group_names = NULL, normalization_type = "GR", metric = "hsa_score", fit_source = "gDR", named_n = 5, named_n_mode = "top", grouped_flag = FALSE, colors_vec = NULL )plot_boxplot_metric_combo_by_grp( dt_scores, selection_var, selection_name, group_var, group_names = NULL, normalization_type = "GR", metric = "hsa_score", fit_source = "gDR", named_n = 5, named_n_mode = "top", grouped_flag = FALSE, colors_vec = NULL )
dt_scores |
|
selection_var |
string name of selected main variable - one value from column
|
selection_name |
string name of selected variable value from column |
group_var |
string name of group variable; should to be not numeric variable from |
group_names |
character vector with names to subset from column |
normalization_type |
string with normalization types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
metric |
string name of the combo metric;
one of: "hsa_score"("Bliss Excess GR" or "Bliss Excess RV" - respectively
depending on |
fit_source |
string source name for metrics |
named_n |
number of points to label based on the highest or lowest |
named_n_mode |
string determines whether the labels are applied to the highest or lowest
values of |
grouped_flag |
logical flag whether the boxplots should be colored by |
colors_vec |
character vector with colors (name or hex value) to color boxplots;
for |
ggplot object containing boxplots for selected combo metric
grouped by selected variable
Janina Smoła [email protected]
mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_scores <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "scores") invisible(dt_scores[, Tissue_grp := data.table::fifelse(Tissue == "tissue_w", "tissue_w", "tissue_other")]) plot_boxplot_metric_combo_by_grp(dt_scores, selection_var = "DrugName", selection_name = c("drug_001", "drug_021"), group_var = "Tissue") plot_boxplot_metric_combo_by_grp(dt_scores, selection_var = "DrugName", selection_name = c("drug_001", "drug_021"), group_var = "Tissue_grp", grouped_flag = TRUE, colors_vec = c("darkblue", "deeppink")) plot_boxplot_metric_combo_by_grp(dt_scores, selection_var = "DrugName", selection_name = c("drug_001", "drug_021"), group_var = "Tissue", grouped_flag = TRUE) plot_boxplot_metric_combo_by_grp(dt_scores, selection_var = "DrugName", selection_name = c("drug_001", "drug_021"), group_var = "Tissue", colors_vec = c("darkblue", "orange"))mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_scores <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "scores") invisible(dt_scores[, Tissue_grp := data.table::fifelse(Tissue == "tissue_w", "tissue_w", "tissue_other")]) plot_boxplot_metric_combo_by_grp(dt_scores, selection_var = "DrugName", selection_name = c("drug_001", "drug_021"), group_var = "Tissue") plot_boxplot_metric_combo_by_grp(dt_scores, selection_var = "DrugName", selection_name = c("drug_001", "drug_021"), group_var = "Tissue_grp", grouped_flag = TRUE, colors_vec = c("darkblue", "deeppink")) plot_boxplot_metric_combo_by_grp(dt_scores, selection_var = "DrugName", selection_name = c("drug_001", "drug_021"), group_var = "Tissue", grouped_flag = TRUE) plot_boxplot_metric_combo_by_grp(dt_scores, selection_var = "DrugName", selection_name = c("drug_001", "drug_021"), group_var = "Tissue", colors_vec = c("darkblue", "orange"))
Plot box plots for metric for single-agent data grouped by selected variable
plot_boxplot_metric_sa( dt_metrics, group_var, normalization_type = "GR", metric = "xc50", fit_source = "gDR", grouped_flag = FALSE, colored_pts_flag = FALSE, colors_vec = NULL, with_inf = FALSE )plot_boxplot_metric_sa( dt_metrics, group_var, normalization_type = "GR", metric = "xc50", fit_source = "gDR", grouped_flag = FALSE, colored_pts_flag = FALSE, colors_vec = NULL, with_inf = FALSE )
dt_metrics |
data.table representing data from the |
group_var |
string name of group variable; one of: |
normalization_type |
string with normalization types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
metric |
string name of the metric;
one of: "xc50" ("GR50" or "IC50" - respectively depending on |
fit_source |
string source name for metrics |
grouped_flag |
a logical flag whether the boxplots should be grouped and
colored by |
colored_pts_flag |
a logical flag whether the points should be colored by grouped variable -
for |
colors_vec |
character vector with colors (name or hex value) to color boxplots;
for |
with_inf |
a logical flag indicating whether infinite values should be shown on boxplots |
ggplot object containing boxplots for selected single-agent metric
grouped by group_var
Janina Smoła [email protected]
mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se, "Metrics") plot_boxplot_metric_sa(dt_metrics, group_var = "CellLineName") plot_boxplot_metric_sa(dt_metrics, group_var = "DrugName") plot_boxplot_metric_sa(dt_metrics, group_var = "DrugName", metric = "x_AOC_range", colors_vec = "grey", colored_pts_flag = TRUE) plot_boxplot_metric_sa(dt_metrics, group_var = "CellLineName", normalization_type = "RV", metric = "x_max", colors_vec = c("gold", "darkorange", "darkcyan", "darkblue"), grouped_flag = TRUE)mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se, "Metrics") plot_boxplot_metric_sa(dt_metrics, group_var = "CellLineName") plot_boxplot_metric_sa(dt_metrics, group_var = "DrugName") plot_boxplot_metric_sa(dt_metrics, group_var = "DrugName", metric = "x_AOC_range", colors_vec = "grey", colored_pts_flag = TRUE) plot_boxplot_metric_sa(dt_metrics, group_var = "CellLineName", normalization_type = "RV", metric = "x_max", colors_vec = c("gold", "darkorange", "darkcyan", "darkblue"), grouped_flag = TRUE)
Plot box plots for metric for single-agent data grouped by cell line names
plot_boxplot_metric_sa_by_CLs( dt_metrics, normalization_type = "GR", metric = "xc50", fit_source = "gDR", grouped_flag = FALSE, colored_pts_flag = FALSE, colors_vec = NULL, with_inf = FALSE )plot_boxplot_metric_sa_by_CLs( dt_metrics, normalization_type = "GR", metric = "xc50", fit_source = "gDR", grouped_flag = FALSE, colored_pts_flag = FALSE, colors_vec = NULL, with_inf = FALSE )
dt_metrics |
data.table representing data from the |
normalization_type |
string with normalization types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
metric |
string name of the metric;
one of: "xc50" ("GR50" or "IC50" - respectively depending on |
fit_source |
string source name for metrics |
grouped_flag |
a logical flag whether the boxplots should be grouped and
colored by |
colored_pts_flag |
a logical flag whether the points should be colored by grouped variable -
for |
colors_vec |
character vector with colors (name or hex value) to color boxplots;
for |
with_inf |
a logical flag indicating whether infinite values should be shown on boxplots |
ggplot object containing boxplots for selected single-agent metric
grouped by cellline names
Janina Smoła [email protected]
mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se, "Metrics") plot_boxplot_metric_sa_by_CLs(dt_metrics) plot_boxplot_metric_sa_by_CLs(dt_metrics, grouped_flag = TRUE) plot_boxplot_metric_sa_by_CLs(dt_metrics, with_inf = TRUE) plot_boxplot_metric_sa_by_CLs(dt_metrics, metric = "x_AOC", colors_vec = "gold") plot_boxplot_metric_sa_by_CLs( dt_metrics, metric = "x_max", colored_pts_flag = TRUE) plot_boxplot_metric_sa_by_CLs( dt_metrics, metric = "x_mean", grouped_flag = TRUE, colors_vec = c("deeppink", "darkcyan", "orange", "darkblue"))mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se, "Metrics") plot_boxplot_metric_sa_by_CLs(dt_metrics) plot_boxplot_metric_sa_by_CLs(dt_metrics, grouped_flag = TRUE) plot_boxplot_metric_sa_by_CLs(dt_metrics, with_inf = TRUE) plot_boxplot_metric_sa_by_CLs(dt_metrics, metric = "x_AOC", colors_vec = "gold") plot_boxplot_metric_sa_by_CLs( dt_metrics, metric = "x_max", colored_pts_flag = TRUE) plot_boxplot_metric_sa_by_CLs( dt_metrics, metric = "x_mean", grouped_flag = TRUE, colors_vec = c("deeppink", "darkcyan", "orange", "darkblue"))
Plot box plots for metric for single-agent data grouped by drug names
plot_boxplot_metric_sa_by_drugs( dt_metrics, normalization_type = "GR", metric = "xc50", fit_source = "gDR", grouped_flag = FALSE, colored_pts_flag = FALSE, colors_vec = NULL, with_inf = FALSE )plot_boxplot_metric_sa_by_drugs( dt_metrics, normalization_type = "GR", metric = "xc50", fit_source = "gDR", grouped_flag = FALSE, colored_pts_flag = FALSE, colors_vec = NULL, with_inf = FALSE )
dt_metrics |
data.table representing data from the |
normalization_type |
string with normalization types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
metric |
string name of the metric;
one of: "xc50" ("GR50" or "IC50" - respectively depending on |
fit_source |
string source name for metrics |
grouped_flag |
a logical flag whether the boxplots should be grouped and
colored by |
colored_pts_flag |
a logical flag whether the points should be colored by grouped variable -
for |
colors_vec |
character vector with colors (name or hex value) to color boxplots;
for |
with_inf |
a logical flag indicating whether infinite values should be shown on boxplots |
ggplot object containing boxplots for selected single-agent metric
grouped by drug names
Janina Smoła [email protected]
mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se, "Metrics") plot_boxplot_metric_sa_by_drugs(dt_metrics, normalization_type = "RV") plot_boxplot_metric_sa_by_drugs(dt_metrics, normalization_type = "RV", grouped_flag = TRUE) plot_boxplot_metric_sa_by_drugs(dt_metrics, metric = "x_AOC", colors_vec = "gold") plot_boxplot_metric_sa_by_drugs( dt_metrics, metric = "x_max", colored_pts_flag = TRUE) plot_boxplot_metric_sa_by_drugs( dt_metrics, metric = "x_mean", grouped_flag = TRUE, colors_vec = c("deeppink", "darkcyan", "orange", "darkblue", "limegreen"))mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se, "Metrics") plot_boxplot_metric_sa_by_drugs(dt_metrics, normalization_type = "RV") plot_boxplot_metric_sa_by_drugs(dt_metrics, normalization_type = "RV", grouped_flag = TRUE) plot_boxplot_metric_sa_by_drugs(dt_metrics, metric = "x_AOC", colors_vec = "gold") plot_boxplot_metric_sa_by_drugs( dt_metrics, metric = "x_max", colored_pts_flag = TRUE) plot_boxplot_metric_sa_by_drugs( dt_metrics, metric = "x_mean", grouped_flag = TRUE, colors_vec = c("deeppink", "darkcyan", "orange", "darkblue", "limegreen"))
Plot box plots for metric for single-agent data grouped by selected variable
plot_boxplot_metric_sa_by_grp( dt_metrics, selection_var, selection_name, group_var, group_names = NULL, normalization_type = "GR", metric = "xc50", fit_source = "gDR", named_n = 5, named_n_mode = "bottom", grouped_flag = FALSE, colors_vec = NULL, with_inf = FALSE )plot_boxplot_metric_sa_by_grp( dt_metrics, selection_var, selection_name, group_var, group_names = NULL, normalization_type = "GR", metric = "xc50", fit_source = "gDR", named_n = 5, named_n_mode = "bottom", grouped_flag = FALSE, colors_vec = NULL, with_inf = FALSE )
dt_metrics |
data.table representing data from the |
selection_var |
string name of selected main variable - one value from column
|
selection_name |
string name of selected variable value from column |
group_var |
string name of group variable; should to be not numeric variable from |
group_names |
character vector with names to subset from column |
normalization_type |
string with normalization types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
metric |
string name of the metric;
one of: "xc50" ("GR50" or "IC50" - respectively depending on |
fit_source |
string source name for metrics |
named_n |
number of points to label based on the highest or lowest |
named_n_mode |
string determines whether the labels are applied to the highest or lowest
values of |
grouped_flag |
logical flag whether the boxplots should be colored by |
colors_vec |
character vector with colors (name or hex value) to color boxplots;
for |
with_inf |
a logical flag indicating whether infinite values should be shown on boxplots |
ggplot object containing boxplots for selected single-agent metric
grouped by selected variable
Janina Smoła [email protected]
mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se, "Metrics") invisible(dt_metrics[, Tissue_grp := data.table::fifelse(Tissue == "tissue_w", "tissue_w", "tissue_other")]) plot_boxplot_metric_sa_by_grp(dt_metrics, selection_var = "DrugName", selection_name = "drug_001", group_var = "Tissue") plot_boxplot_metric_sa_by_grp(dt_metrics, selection_var = "DrugName", selection_name = "drug_001", group_var = "Tissue_grp") plot_boxplot_metric_sa_by_grp(dt_metrics, selection_var = "DrugName", selection_name = "drug_001", group_var = "Tissue", with_inf = TRUE) plot_boxplot_metric_sa_by_grp(dt_metrics, selection_var = "DrugName", selection_name = "drug_001", group_var = "Tissue", named_n = 0) plot_boxplot_metric_sa_by_grp(dt_metrics, selection_var = "DrugName", selection_name = "drug_001", group_var = "Tissue", grouped_flag = TRUE) plot_boxplot_metric_sa_by_grp(dt_metrics, selection_var = "DrugName", selection_name = "drug_001", group_var = "Tissue", colors_vec = c("darkblue", "deeppink"))mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se, "Metrics") invisible(dt_metrics[, Tissue_grp := data.table::fifelse(Tissue == "tissue_w", "tissue_w", "tissue_other")]) plot_boxplot_metric_sa_by_grp(dt_metrics, selection_var = "DrugName", selection_name = "drug_001", group_var = "Tissue") plot_boxplot_metric_sa_by_grp(dt_metrics, selection_var = "DrugName", selection_name = "drug_001", group_var = "Tissue_grp") plot_boxplot_metric_sa_by_grp(dt_metrics, selection_var = "DrugName", selection_name = "drug_001", group_var = "Tissue", with_inf = TRUE) plot_boxplot_metric_sa_by_grp(dt_metrics, selection_var = "DrugName", selection_name = "drug_001", group_var = "Tissue", named_n = 0) plot_boxplot_metric_sa_by_grp(dt_metrics, selection_var = "DrugName", selection_name = "drug_001", group_var = "Tissue", grouped_flag = TRUE) plot_boxplot_metric_sa_by_grp(dt_metrics, selection_var = "DrugName", selection_name = "drug_001", group_var = "Tissue", colors_vec = c("darkblue", "deeppink"))
Plot boxplot for categorical features
plot_boxplot_num( dt_response, dt_depmap, selected_feat, selected_feat_meta_col = NULL )plot_boxplot_num( dt_response, dt_depmap, selected_feat, selected_feat_meta_col = NULL )
dt_response |
|
dt_depmap |
|
selected_feat |
string with name of selected feature from |
selected_feat_meta_col |
string with the name of a feature column in DepMap (will be used as a plot title) that has 0-1 values only (categorical character but without relation one-to-one for ids and feature) |
ggplot object containing boxplots for variable levels
Janina Smoła [email protected]
mae_prism <- gDRutils::get_synthetic_data("prism") se_prism <- mae_prism[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se_prism, "Metrics") dt_response <- prep_dt_response_metric_sa( dt_metrics = dt_metrics, d_name = unique(dt_metrics[["DrugName"]])[1], normalization_type = "RV", metric = "x_mean") meta_data_path <- system.file("depmap_data/Model.csv.gz", package = "gDRtestData") obj_depmap_meta <- prep_dt_depmap_meta(meta_data_path, metadata_col = "OncotreeLineage") plot_boxplot_num( dt_response = dt_response, dt_depmap = obj_depmap_meta[["dt_depmap"]], selected_feat = names(obj_depmap_meta[["dt_depmap"]])[3])mae_prism <- gDRutils::get_synthetic_data("prism") se_prism <- mae_prism[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se_prism, "Metrics") dt_response <- prep_dt_response_metric_sa( dt_metrics = dt_metrics, d_name = unique(dt_metrics[["DrugName"]])[1], normalization_type = "RV", metric = "x_mean") meta_data_path <- system.file("depmap_data/Model.csv.gz", package = "gDRtestData") obj_depmap_meta <- prep_dt_depmap_meta(meta_data_path, metadata_col = "OncotreeLineage") plot_boxplot_num( dt_response = dt_response, dt_depmap = obj_depmap_meta[["dt_depmap"]], selected_feat = names(obj_depmap_meta[["dt_depmap"]])[3])
Plot panel with boxplots
plot_boxplot_num_panel( dt_response, dt_depmap, selected_feats, selected_feat_meta_col = NULL, ncol = NULL )plot_boxplot_num_panel( dt_response, dt_depmap, selected_feats, selected_feat_meta_col = NULL, ncol = NULL )
dt_response |
|
dt_depmap |
|
selected_feats |
character vector with names of selected features from |
selected_feat_meta_col |
string with the name of a feature column in DepMap (will be used as a plot title) that has 0-1 values only (categorical character but without relation one-to-one for ids and feature) |
ncol |
number of plot column in panel |
ggplot object containing boxplots for variable levels (0-1)
Janina Smoła [email protected]
mae_prism <- gDRutils::get_synthetic_data("prism") se_prism <- mae_prism[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se_prism, "Metrics") dt_response <- prep_dt_response_metric_sa( dt_metrics = dt_metrics, d_name = unique(dt_metrics[["DrugName"]])[1], normalization_type = "RV", metric = "x_mean") meta_data_path <- system.file("depmap_data/Model.csv.gz", package = "gDRtestData") obj_depmap_meta <- prep_dt_depmap_meta(meta_data_path, metadata_col = "OncotreeLineage") plot_boxplot_num_panel( dt_response = dt_response, dt_depmap = obj_depmap_meta[["dt_depmap"]], selected_feats = names(obj_depmap_meta[["dt_depmap"]])[3:5])mae_prism <- gDRutils::get_synthetic_data("prism") se_prism <- mae_prism[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se_prism, "Metrics") dt_response <- prep_dt_response_metric_sa( dt_metrics = dt_metrics, d_name = unique(dt_metrics[["DrugName"]])[1], normalization_type = "RV", metric = "x_mean") meta_data_path <- system.file("depmap_data/Model.csv.gz", package = "gDRtestData") obj_depmap_meta <- prep_dt_depmap_meta(meta_data_path, metadata_col = "OncotreeLineage") plot_boxplot_num_panel( dt_response = dt_response, dt_depmap = obj_depmap_meta[["dt_depmap"]], selected_feats = names(obj_depmap_meta[["dt_depmap"]])[3:5])
Generates a ggplot2 visualization of chemical genomics screening data, highlighting GSEA results.
plot_cgs_ranking( results, cl_name, metric, padj_threshold = 0.1, top_results_no_sig = 5, max_results_with_sig = 15 )plot_cgs_ranking( results, cl_name, metric, padj_threshold = 0.1, top_results_no_sig = 5, max_results_with_sig = 15 )
results |
A list object returned from 'analyze_cgs'. |
cl_name |
A string specifying the cell line included in the |
metric |
A string specifying the metric included in the |
padj_threshold |
A numeric value specifying the threshold for filtering significant GSEA results based on adjusted p-value. |
top_results_no_sig |
A numeric value specifying the number of top results to plot if there are no significant values. |
max_results_with_sig |
A numeric value specifying the maximum number of results to plot when there are more than this number of significant values. |
A ggplot2 object with cgs results
Bartosz Czech [email protected]
dt_metrics <- qs2::qs_read(system.file("testdata/cgs_data.qs2", package = "gDRplots")) results <- analyze_cgs(dt_metrics, metrics = c("xc50"), cl_name = "CellLineName_1") plot_cgs_ranking(results, cl_name = "CellLineName_1", metric = "xc50", padj_threshold = 0.1, top_results_no_sig = 5, max_results_with_sig = 15)dt_metrics <- qs2::qs_read(system.file("testdata/cgs_data.qs2", package = "gDRplots")) results <- analyze_cgs(dt_metrics, metrics = c("xc50"), cl_name = "CellLineName_1") plot_cgs_ranking(results, cl_name = "CellLineName_1", metric = "xc50", padj_threshold = 0.1, top_results_no_sig = 5, max_results_with_sig = 15)
Plot line plot of combination index
plot_combination_index( dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "GR", iso_levels = c("0.25", "0.5", "0.75"), colors_vec_iso = NULL )plot_combination_index( dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "GR", iso_levels = c("0.25", "0.5", "0.75"), colors_vec_iso = NULL )
dt_excess |
data.table representing data from the |
dt_isobolograms |
data.table representing data from the |
drug1_name |
string with drug name to be plotted (identifiers |
drug2_name |
string with co-drug name to be plotted (identifiers |
cl_name |
string with cell line to be plotted (identifiers |
normalization_type |
string with normalization_types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
iso_levels |
character vector with isobologram levels to be selected |
colors_vec_iso |
character vector of colors (valid name or hex) used for the isolines; the default is the dark red-orange palette |
ggplot object containing combination index plot at different ratios of the two drugs
cl_name <- "cellline_BC" drug1_name <- "drug_001" drug2_name <- "drug_026" mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_excess <- gDRutils::convert_se_assay_to_dt(se, "excess") dt_isobolograms <- gDRutils::convert_se_assay_to_dt(se, "isobolograms") plot_combination_index(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "GR") plot_combination_index(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "RV", colors_vec_iso = c("darkblue", "darkcyan")) cl_name <- "cellline_JE" drug1_name <- "drug_011" drug2_name <- "drug_026" plot_combination_index(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "RV", iso_levels = "0.5")cl_name <- "cellline_BC" drug1_name <- "drug_001" drug2_name <- "drug_026" mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_excess <- gDRutils::convert_se_assay_to_dt(se, "excess") dt_isobolograms <- gDRutils::convert_se_assay_to_dt(se, "isobolograms") plot_combination_index(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "GR") plot_combination_index(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "RV", colors_vec_iso = c("darkblue", "darkcyan")) cl_name <- "cellline_JE" drug1_name <- "drug_011" drug2_name <- "drug_026" plot_combination_index(dt_excess, dt_isobolograms, drug1_name, drug2_name, cl_name, normalization_type = "RV", iso_levels = "0.5")
Plot drug response curves for combo data
plot_dose_response_combo( dt_average, drug1_name, drug2_name, cl_name, normalization_type = "GR", colors_vec = NULL, split_by_conc = FALSE )plot_dose_response_combo( dt_average, drug1_name, drug2_name, cl_name, normalization_type = "GR", colors_vec = NULL, split_by_conc = FALSE )
dt_average |
data.table representing data from the |
drug1_name |
string with drug name to be plotted (identifiers |
drug2_name |
string with co-drug name to be plotted (identifiers |
cl_name |
string with cell line name to be plotted (identifiers |
normalization_type |
string with normalization_types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
colors_vec |
character vector with colors for |
split_by_conc |
split_by_conc logical flag indicating whether curves
for |
ggplot object containing plot with dose-response curves for combo data
mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_average <- gDRutils::convert_se_assay_to_dt(se, "Averaged") cl_name <- "cellline_BC" drug1_name <- "drug_011" drug2_name <- "drug_021" plot_dose_response_combo(dt_average = dt_average, drug1_name = drug1_name, drug2_name = drug2_name, cl_name = cl_name) plot_dose_response_combo(dt_average = dt_average, drug1_name = drug1_name, drug2_name = drug2_name, cl_name = cl_name, split_by_conc = TRUE) plot_dose_response_combo(dt_average = dt_average, drug1_name = drug1_name, drug2_name = drug2_name, cl_name = cl_name, normalization_type = "RV", colors_vec = c("lightblue", "darkblue"))mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_average <- gDRutils::convert_se_assay_to_dt(se, "Averaged") cl_name <- "cellline_BC" drug1_name <- "drug_011" drug2_name <- "drug_021" plot_dose_response_combo(dt_average = dt_average, drug1_name = drug1_name, drug2_name = drug2_name, cl_name = cl_name) plot_dose_response_combo(dt_average = dt_average, drug1_name = drug1_name, drug2_name = drug2_name, cl_name = cl_name, split_by_conc = TRUE) plot_dose_response_combo(dt_average = dt_average, drug1_name = drug1_name, drug2_name = drug2_name, cl_name = cl_name, normalization_type = "RV", colors_vec = c("lightblue", "darkblue"))
Plot panel with drug response curves for single-agent data to control quality of the data
plot_dose_response_combo_panel( dt_average, cl_name, d_names = NULL, normalization_type = "GR", colors_vec = NULL )plot_dose_response_combo_panel( dt_average, cl_name, d_names = NULL, normalization_type = "GR", colors_vec = NULL )
dt_average |
data.table representing data from the |
cl_name |
string with cell line name to be plotted (identifiers |
d_names |
character vector with drug names to be plotted (Drug Name); if NULL - all available drugs will be plotted |
normalization_type |
string with normalization_types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
colors_vec |
character vector with colors for |
ggplot object containing panel with plot with dose-response curves
for selected cell line by drugs
mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_average <- gDRutils::convert_se_assay_to_dt(se, "Averaged") cl_name <- "cellline_IB" plot_dose_response_combo_panel(dt_average = dt_average, cl_name = cl_name) d_names <- c("drug_001", "drug_002") plot_dose_response_combo_panel(dt_average = dt_average, cl_name = cl_name, d_names = d_names)mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_average <- gDRutils::convert_se_assay_to_dt(se, "Averaged") cl_name <- "cellline_IB" plot_dose_response_combo_panel(dt_average = dt_average, cl_name = cl_name) d_names <- c("drug_001", "drug_002") plot_dose_response_combo_panel(dt_average = dt_average, cl_name = cl_name, d_names = d_names)
Plot drug response curves for single-agent data
plot_dose_response_sa( dt_metrics, dt_average, selection_name, group_var, group_names = NULL, normalization_type = "GR", colors_vec = NULL, plot_averaged_flag = TRUE, plot_fit_flag = TRUE, fit_source = "gDR" )plot_dose_response_sa( dt_metrics, dt_average, selection_name, group_var, group_names = NULL, normalization_type = "GR", colors_vec = NULL, plot_averaged_flag = TRUE, plot_fit_flag = TRUE, fit_source = "gDR" )
dt_metrics |
data.table representing data from the |
dt_average |
data.table representing data from the |
selection_name |
string name of selected main variable - one value from column
|
group_var |
string name of group variable; one of: |
group_names |
character vector with names to subset from se (the same dim as |
normalization_type |
string with normalization_types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
colors_vec |
character vector with colors for |
plot_averaged_flag |
logical flag whether plot points with average values |
plot_fit_flag |
logical flag whether plot points with fitted values |
fit_source |
string source name for metrics |
ggplot object containing plot of dose-response curves
inspired by the grob_SA function written by Marc Hafner
mae <- gDRutils::get_synthetic_data("small") se <- mae[[gDRutils::get_supported_experiments("sa")]] selected_drug <- "drug_002" group_var <- "CellLineName" dt_metrics <- gDRutils::convert_se_assay_to_dt(se, "Metrics") dt_average <- gDRutils::convert_se_assay_to_dt(se, "Averaged") celline_names <- unique(dt_metrics[[group_var]])[1:3] plot_dose_response_sa(dt_metrics = dt_metrics, dt_average = dt_average, selection_name = selected_drug, group_var = group_var, group_names = celline_names) plot_dose_response_sa(dt_metrics = dt_metrics, dt_average = NULL, selection_name = selected_drug, group_var = group_var, group_names = celline_names) selected_cellline <- "cellline_HB" group_var <- "DrugName" dt_metrics <- gDRutils::convert_se_assay_to_dt(se, "Metrics") dt_average <- gDRutils::convert_se_assay_to_dt(se, "Averaged") group_names <- unique(dt_metrics[[group_var]])[1:3] plot_dose_response_sa(dt_metrics = dt_metrics, dt_average = dt_average, selection_name = selected_cellline, group_var = group_var, group_names = group_names)mae <- gDRutils::get_synthetic_data("small") se <- mae[[gDRutils::get_supported_experiments("sa")]] selected_drug <- "drug_002" group_var <- "CellLineName" dt_metrics <- gDRutils::convert_se_assay_to_dt(se, "Metrics") dt_average <- gDRutils::convert_se_assay_to_dt(se, "Averaged") celline_names <- unique(dt_metrics[[group_var]])[1:3] plot_dose_response_sa(dt_metrics = dt_metrics, dt_average = dt_average, selection_name = selected_drug, group_var = group_var, group_names = celline_names) plot_dose_response_sa(dt_metrics = dt_metrics, dt_average = NULL, selection_name = selected_drug, group_var = group_var, group_names = celline_names) selected_cellline <- "cellline_HB" group_var <- "DrugName" dt_metrics <- gDRutils::convert_se_assay_to_dt(se, "Metrics") dt_average <- gDRutils::convert_se_assay_to_dt(se, "Averaged") group_names <- unique(dt_metrics[[group_var]])[1:3] plot_dose_response_sa(dt_metrics = dt_metrics, dt_average = dt_average, selection_name = selected_cellline, group_var = group_var, group_names = group_names)
Plot drug response curves for single-agent data for selected call lines and drugs
plot_dose_response_sa_by_CLs( dt_metrics, dt_average, cellline_name_vec = NULL, drug_name_vec = NULL, normalization_type = "GR", colors_vec = NULL, plot_averaged_flag = TRUE, plot_fit_flag = TRUE, fit_source = "gDR" )plot_dose_response_sa_by_CLs( dt_metrics, dt_average, cellline_name_vec = NULL, drug_name_vec = NULL, normalization_type = "GR", colors_vec = NULL, plot_averaged_flag = TRUE, plot_fit_flag = TRUE, fit_source = "gDR" )
dt_metrics |
data.table representing data from the |
dt_average |
data.table representing data from the |
cellline_name_vec |
character vector with cell line names to be plotted (Cell Line Name) |
drug_name_vec |
character vector with drug names to be plotted (Drug Name) |
normalization_type |
string with normalization_types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
colors_vec |
character vector with colors for |
plot_averaged_flag |
logical flag whether plot points with average values |
plot_fit_flag |
logical flag whether plot points with fitted values |
fit_source |
string source name for metrics |
list of ggplot objects containing plots of dose-response curves
mae <- gDRutils::get_synthetic_data("small") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se, "Metrics") dt_average <- gDRutils::convert_se_assay_to_dt(se, "Averaged") cellline_name_vec <- unique(dt_metrics[["CellLineName"]])[2:5] drug_name_vec <- unique(dt_metrics[["DrugName"]])[5:7] plot_dose_response_sa_by_CLs(dt_metrics = dt_metrics, dt_average = dt_average, cellline_name_vec = cellline_name_vec, drug_name_vec = drug_name_vec, normalization_type = "RV", colors_vec = c("#00008B", "#FF6347", "#4CBB17"))mae <- gDRutils::get_synthetic_data("small") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se, "Metrics") dt_average <- gDRutils::convert_se_assay_to_dt(se, "Averaged") cellline_name_vec <- unique(dt_metrics[["CellLineName"]])[2:5] drug_name_vec <- unique(dt_metrics[["DrugName"]])[5:7] plot_dose_response_sa_by_CLs(dt_metrics = dt_metrics, dt_average = dt_average, cellline_name_vec = cellline_name_vec, drug_name_vec = drug_name_vec, normalization_type = "RV", colors_vec = c("#00008B", "#FF6347", "#4CBB17"))
Plot drug response curves for single-agent data for selected call lines and drugs
plot_dose_response_sa_by_drugs( dt_metrics, dt_average, cellline_name_vec = NULL, drug_name_vec = NULL, normalization_type = "GR", colors_vec = NULL, plot_averaged_flag = TRUE, plot_fit_flag = TRUE, fit_source = "gDR" )plot_dose_response_sa_by_drugs( dt_metrics, dt_average, cellline_name_vec = NULL, drug_name_vec = NULL, normalization_type = "GR", colors_vec = NULL, plot_averaged_flag = TRUE, plot_fit_flag = TRUE, fit_source = "gDR" )
dt_metrics |
data.table representing data from the |
dt_average |
data.table representing data from the |
cellline_name_vec |
character vector with cell line names to be plotted (Cell Line Name) |
drug_name_vec |
character vector with drug names to be plotted (Drug Name) |
normalization_type |
string with normalization_types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
colors_vec |
character vector with colors for |
plot_averaged_flag |
logical flag whether plot points with average values |
plot_fit_flag |
logical flag whether plot points with fitted values |
fit_source |
string source name for metrics |
list of ggplot objects containing plots of dose-response curves
mae <- gDRutils::get_synthetic_data("small") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se, "Metrics") dt_average <- gDRutils::convert_se_assay_to_dt(se, "Averaged") cellline_name_vec <- unique(dt_metrics[["CellLineName"]])[2:5] drug_name_vec <- unique(dt_metrics[["DrugName"]])[5:7] plot_dose_response_sa_by_drugs(dt_metrics = dt_metrics, dt_average = dt_average, cellline_name_vec = cellline_name_vec, drug_name_vec = drug_name_vec, normalization_type = "RV", colors_vec = c("#00008B", "#FF6347", "#4CBB17"))mae <- gDRutils::get_synthetic_data("small") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se, "Metrics") dt_average <- gDRutils::convert_se_assay_to_dt(se, "Averaged") cellline_name_vec <- unique(dt_metrics[["CellLineName"]])[2:5] drug_name_vec <- unique(dt_metrics[["DrugName"]])[5:7] plot_dose_response_sa_by_drugs(dt_metrics = dt_metrics, dt_average = dt_average, cellline_name_vec = cellline_name_vec, drug_name_vec = drug_name_vec, normalization_type = "RV", colors_vec = c("#00008B", "#FF6347", "#4CBB17"))
Plot drug response curves for single-agent data to control quality of the data
plot_dose_response_sa_qc( dt_metrics, dt_average, cl_name, d_name, normalization_type = "GR", fit_source = "gDR" )plot_dose_response_sa_qc( dt_metrics, dt_average, cl_name, d_name, normalization_type = "GR", fit_source = "gDR" )
dt_metrics |
data.table representing data from the |
dt_average |
data.table representing data from the |
cl_name |
string cell line name to be plotted (Cell Line Name) |
d_name |
string vector with drug name to be plotted (Drug Name) |
normalization_type |
string with normalization_types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
fit_source |
string source name for metrics |
ggplot object containing plot of dose-response curves (observed and fitted values)
mae <- gDRutils::get_synthetic_data("small") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se, "Metrics") dt_average <- gDRutils::convert_se_assay_to_dt(se, "Averaged") cl_name <- dt_metrics[["CellLineName"]][1] d_name <- dt_metrics[["DrugName"]][1] plot_dose_response_sa_qc(dt_metrics = dt_metrics, dt_average = dt_average, cl_name = cl_name, d_name = d_name)mae <- gDRutils::get_synthetic_data("small") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se, "Metrics") dt_average <- gDRutils::convert_se_assay_to_dt(se, "Averaged") cl_name <- dt_metrics[["CellLineName"]][1] d_name <- dt_metrics[["DrugName"]][1] plot_dose_response_sa_qc(dt_metrics = dt_metrics, dt_average = dt_average, cl_name = cl_name, d_name = d_name)
Plot panel with drug response curves for single-agent data to control quality of the data
plot_dose_response_sa_qc_panel( dt_metrics, dt_average, cl_name, d_names = NULL, normalization_type = "GR", fit_source = "gDR" )plot_dose_response_sa_qc_panel( dt_metrics, dt_average, cl_name, d_names = NULL, normalization_type = "GR", fit_source = "gDR" )
dt_metrics |
data.table representing data from the |
dt_average |
data.table representing data from the |
cl_name |
string cell line name to be plotted (Cell Line Name) |
d_names |
character vector with drug names to be plotted (Drug Name); if NULL - all available drugs will be plotted |
normalization_type |
string with normalization_types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
fit_source |
string source name for metrics |
ggplot object with panel with plots of dose-response curves for selected
cell line by drugs (observed and fitted values)
mae <- gDRutils::get_synthetic_data("small") se <- mae[[1]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se, "Metrics") dt_average <- gDRutils::convert_se_assay_to_dt(se, "Averaged") cl_name <- dt_metrics[["CellLineName"]][1] d_names <- unique(dt_metrics[["DrugName"]])[1:5] plot_dose_response_sa_qc_panel(dt_metrics = dt_metrics, dt_average = dt_average, cl_name = cl_name) plot_dose_response_sa_qc_panel(dt_metrics = dt_metrics, dt_average = dt_average, cl_name = cl_name, d_names = d_names)mae <- gDRutils::get_synthetic_data("small") se <- mae[[1]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se, "Metrics") dt_average <- gDRutils::convert_se_assay_to_dt(se, "Averaged") cl_name <- dt_metrics[["CellLineName"]][1] d_names <- unique(dt_metrics[["DrugName"]])[1:5] plot_dose_response_sa_qc_panel(dt_metrics = dt_metrics, dt_average = dt_average, cl_name = cl_name) plot_dose_response_sa_qc_panel(dt_metrics = dt_metrics, dt_average = dt_average, cl_name = cl_name, d_names = d_names)
Visualization for the quality control of the fitting for single-agent data
plot_fitting_acc(dt_assay, cl_name, normalization_type = "GR")plot_fitting_acc(dt_assay, cl_name, normalization_type = "GR")
dt_assay |
data.table representing data from the |
cl_name |
string cell line name to be plotted (Cell Line Name) |
normalization_type |
string with normalization_types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
ggplot object containing panel with lollipop plots with r2 and rss values for each drug
Bartosz Czech [email protected]
mae <- gDRutils::get_synthetic_data("small") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se, "Metrics") cl_name <- dt_metrics[["CellLineName"]][1] plot_fitting_acc(dt_assay = dt_metrics, cl_name = cl_name, normalization_type = "RV")mae <- gDRutils::get_synthetic_data("small") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se, "Metrics") cl_name <- dt_metrics[["CellLineName"]][1] plot_fitting_acc(dt_assay = dt_metrics, cl_name = cl_name, normalization_type = "RV")
Plot data from a specific column
plot_plate(dt_plate, column_name)plot_plate(dt_plate, column_name)
dt_plate |
The data table containing plate information |
column_name |
The name of the column to plot |
A named list of ggplot objects for each barcode and column
Bartosz Czech [email protected]
test_data <- data.table::data.table( WellColumn = rep(1:12, each = 8), WellRow = rep(LETTERS[1:8], times = 12), clid = "A", Gnumber = c(rep("untreated", 48), sample(1:5, size = 48, replace = TRUE)), Gnumber_2 = c(rep("untreated", 48), sample(1:5, size = 48, replace = TRUE)), Concentration = runif(96, min = 0, max = 100), ReadoutValue = runif(96, min = 0, max = 100), Barcode = rep(c("A", "B"), 48) ) plot_plate(test_data, "Gnumber")[["A"]]test_data <- data.table::data.table( WellColumn = rep(1:12, each = 8), WellRow = rep(LETTERS[1:8], times = 12), clid = "A", Gnumber = c(rep("untreated", 48), sample(1:5, size = 48, replace = TRUE)), Gnumber_2 = c(rep("untreated", 48), sample(1:5, size = 48, replace = TRUE)), Concentration = runif(96, min = 0, max = 100), ReadoutValue = runif(96, min = 0, max = 100), Barcode = rep(c("A", "B"), 48) ) plot_plate(test_data, "Gnumber")[["A"]]
Plot plate data (Heatmap + Dose Ranks + Smart Legend + Explicit QC)
plot_plate_stack_info( dt_plate, ctrl_fail_threshold = 0.6, n_sd = 1, use_sd_threshold = TRUE, items_per_line = 6 )plot_plate_stack_info( dt_plate, ctrl_fail_threshold = 0.6, n_sd = 1, use_sd_threshold = TRUE, items_per_line = 6 )
dt_plate |
|
ctrl_fail_threshold |
|
n_sd |
|
use_sd_threshold |
|
items_per_line |
|
A named list of ggplot objects for each barcode
Bartosz Czech [email protected]
conc_series <- c(0, 0.001, 0.003, 0.01, 0.03, 0.1, 0.3, 1, 3, 10) test_data <- data.table::data.table( WellColumn = sprintf("%02d", rep(1:12, each = 8)), WellRow = rep(LETTERS[1:8], times = 12), Barcode = rep(c("Plate_1", "Plate_2"), each = 48), clid = "CellLineA" ) invisible(test_data[, Concentration := rep(rep(conc_series, length.out = 48), 2)]) invisible(test_data[, Gnumber := ifelse(Concentration == 0, "vehicle", "Drug_A")]) invisible(test_data[Gnumber == "vehicle", Concentration := 0]) invisible(test_data[, ReadoutValue := ifelse(Gnumber == "vehicle", rnorm(.N, 1000, 50), rnorm(.N, 500, 100))]) library(ggtext) plots <- plot_plate_stack_info(test_data) plots[[1]] combo_data <- data.table::copy(test_data) invisible(combo_data[, Barcode := "Plate_Combo"]) invisible(combo_data[, Concentration_2 := rep(rev(conc_series), length.out = .N)]) invisible(combo_data[, Gnumber_2 := ifelse(Concentration_2 == 0, "vehicle", "Drug_B")]) invisible(combo_data[Gnumber_2 == "vehicle", Concentration_2 := 0]) combo_plots <- plot_plate_stack_info(combo_data) combo_plots[[1]]conc_series <- c(0, 0.001, 0.003, 0.01, 0.03, 0.1, 0.3, 1, 3, 10) test_data <- data.table::data.table( WellColumn = sprintf("%02d", rep(1:12, each = 8)), WellRow = rep(LETTERS[1:8], times = 12), Barcode = rep(c("Plate_1", "Plate_2"), each = 48), clid = "CellLineA" ) invisible(test_data[, Concentration := rep(rep(conc_series, length.out = 48), 2)]) invisible(test_data[, Gnumber := ifelse(Concentration == 0, "vehicle", "Drug_A")]) invisible(test_data[Gnumber == "vehicle", Concentration := 0]) invisible(test_data[, ReadoutValue := ifelse(Gnumber == "vehicle", rnorm(.N, 1000, 50), rnorm(.N, 500, 100))]) library(ggtext) plots <- plot_plate_stack_info(test_data) plots[[1]] combo_data <- data.table::copy(test_data) invisible(combo_data[, Barcode := "Plate_Combo"]) invisible(combo_data[, Concentration_2 := rep(rev(conc_series), length.out = .N)]) invisible(combo_data[, Gnumber_2 := ifelse(Concentration_2 == 0, "vehicle", "Drug_B")]) invisible(combo_data[Gnumber_2 == "vehicle", Concentration_2 := 0]) combo_plots <- plot_plate_stack_info(combo_data) combo_plots[[1]]
Plot scatter with correlation
plot_scatter_with_corr( dt_response, dt_depmap, selected_feat, selected_feat_meta_col = NULL )plot_scatter_with_corr( dt_response, dt_depmap, selected_feat, selected_feat_meta_col = NULL )
dt_response |
|
dt_depmap |
|
selected_feat |
string with name of selected feature from |
selected_feat_meta_col |
string with the name of a feature column in DepMap (will be used as a plot title) |
ggplot object containing a scatter plot with correlation
Janina Smoła [email protected]
mae_prism <- gDRutils::get_synthetic_data("prism") se_prism <- mae_prism[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se_prism, "Metrics") dt_response <- prep_dt_response_metric_sa( dt_metrics = dt_metrics, d_name = unique(dt_metrics[["DrugName"]])[1], normalization_type = "RV", metric = "x_mean") feat_data_path <- system.file("depmap_data", package = "gDRtestData") meta_data_path <- system.file("depmap_data/Model.csv.gz", package = "gDRtestData") obj_depmap_feat <- prep_dt_depmap_feat(feat_data_path, meta_data_path, feature_set = "OmicsCNGene") plot_scatter_with_corr( dt_response = dt_response, dt_depmap = obj_depmap_feat[["dt_depmap"]], selected_feat = names(obj_depmap_feat[["dt_depmap"]])[3])mae_prism <- gDRutils::get_synthetic_data("prism") se_prism <- mae_prism[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se_prism, "Metrics") dt_response <- prep_dt_response_metric_sa( dt_metrics = dt_metrics, d_name = unique(dt_metrics[["DrugName"]])[1], normalization_type = "RV", metric = "x_mean") feat_data_path <- system.file("depmap_data", package = "gDRtestData") meta_data_path <- system.file("depmap_data/Model.csv.gz", package = "gDRtestData") obj_depmap_feat <- prep_dt_depmap_feat(feat_data_path, meta_data_path, feature_set = "OmicsCNGene") plot_scatter_with_corr( dt_response = dt_response, dt_depmap = obj_depmap_feat[["dt_depmap"]], selected_feat = names(obj_depmap_feat[["dt_depmap"]])[3])
Plot panel with scatter with correlation
plot_scatter_with_corr_panel( dt_response, dt_depmap, selected_feats, selected_feat_meta_col = NULL, ncol = NULL )plot_scatter_with_corr_panel( dt_response, dt_depmap, selected_feats, selected_feat_meta_col = NULL, ncol = NULL )
dt_response |
|
dt_depmap |
|
selected_feats |
character vector with names of selected features from |
selected_feat_meta_col |
string with the name of a feature column in DepMap (will be used as a plot title) |
ncol |
number of plot column in panel |
ggplot object containing panel of scatter plot with correlation for selected features
Janina Smoła [email protected]
mae_prism <- gDRutils::get_synthetic_data("prism") se_prism <- mae_prism[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se_prism, "Metrics") dt_response <- prep_dt_response_metric_sa( dt_metrics = dt_metrics, d_name = unique(dt_metrics[["DrugName"]])[1], normalization_type = "RV", metric = "x_mean") feat_data_path <- system.file("depmap_data", package = "gDRtestData") meta_data_path <- system.file("depmap_data/Model.csv.gz", package = "gDRtestData") obj_depmap_feat <- prep_dt_depmap_feat(feat_data_path, meta_data_path, feature_set = "OmicsCNGene") plot_scatter_with_corr_panel( dt_response = dt_response, dt_depmap = obj_depmap_feat[["dt_depmap"]], selected_feats = names(obj_depmap_feat[["dt_depmap"]])[3:5])mae_prism <- gDRutils::get_synthetic_data("prism") se_prism <- mae_prism[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se_prism, "Metrics") dt_response <- prep_dt_response_metric_sa( dt_metrics = dt_metrics, d_name = unique(dt_metrics[["DrugName"]])[1], normalization_type = "RV", metric = "x_mean") feat_data_path <- system.file("depmap_data", package = "gDRtestData") meta_data_path <- system.file("depmap_data/Model.csv.gz", package = "gDRtestData") obj_depmap_feat <- prep_dt_depmap_feat(feat_data_path, meta_data_path, feature_set = "OmicsCNGene") plot_scatter_with_corr_panel( dt_response = dt_response, dt_depmap = obj_depmap_feat[["dt_depmap"]], selected_feats = names(obj_depmap_feat[["dt_depmap"]])[3:5])
Generates the QC and dose-rank heatmap for a single plate subset. Handles all necessary data transformations (factor conversion, ranking, color mapping) internally.
plot_single_plate_stack_info( dt_subset, plate_id = NULL, drug_color_mapping = NULL, ctrl_fail_threshold = 0.6, n_sd = 1, use_sd_threshold = TRUE, items_per_line = 6 )plot_single_plate_stack_info( dt_subset, plate_id = NULL, drug_color_mapping = NULL, ctrl_fail_threshold = 0.6, n_sd = 1, use_sd_threshold = TRUE, items_per_line = 6 )
dt_subset |
|
plate_id |
|
drug_color_mapping |
|
ctrl_fail_threshold |
|
n_sd |
|
use_sd_threshold |
|
items_per_line |
|
A ggplot object.
Bartosz Czech [email protected]
conc_series <- c(0, 0.001, 0.003, 0.01, 0.03, 0.1, 0.3, 1, 3, 10) test_data <- data.table::data.table( WellColumn = rep(1:12, each = 8), WellRow = rep(LETTERS[1:8], times = 12), clid = "CellLineA", Barcode = "Plate_1" ) invisible(test_data[, Concentration := rep(conc_series, length.out = .N)]) invisible(test_data[, Gnumber := ifelse(Concentration == 0, "vehicle", "Drug_A")]) invisible(test_data[Gnumber == "vehicle", Concentration := 0]) invisible(test_data[, ReadoutValue := ifelse(Gnumber == "vehicle", rnorm(.N, 1000, 50), rnorm(.N, 1000 * (1 / (1 + Concentration)), 50))]) library(ggtext) plot_single_plate_stack_info(test_data) invisible(test_data[, Concentration_2 := rep(rev(conc_series), length.out = .N)]) invisible(test_data[, Gnumber_2 := ifelse(Concentration_2 == 0, "vehicle", "Drug_B")]) invisible(test_data[Gnumber_2 == "vehicle", Concentration_2 := 0]) plot_single_plate_stack_info(test_data)conc_series <- c(0, 0.001, 0.003, 0.01, 0.03, 0.1, 0.3, 1, 3, 10) test_data <- data.table::data.table( WellColumn = rep(1:12, each = 8), WellRow = rep(LETTERS[1:8], times = 12), clid = "CellLineA", Barcode = "Plate_1" ) invisible(test_data[, Concentration := rep(conc_series, length.out = .N)]) invisible(test_data[, Gnumber := ifelse(Concentration == 0, "vehicle", "Drug_A")]) invisible(test_data[Gnumber == "vehicle", Concentration := 0]) invisible(test_data[, ReadoutValue := ifelse(Gnumber == "vehicle", rnorm(.N, 1000, 50), rnorm(.N, 1000 * (1 / (1 + Concentration)), 50))]) library(ggtext) plot_single_plate_stack_info(test_data) invisible(test_data[, Concentration_2 := rep(rev(conc_series), length.out = .N)]) invisible(test_data[, Gnumber_2 := ifelse(Concentration_2 == 0, "vehicle", "Drug_B")]) invisible(test_data[Gnumber_2 == "vehicle", Concentration_2 := 0]) plot_single_plate_stack_info(test_data)
Plot a violin plot for normalized or averaged data (single-agent and combo) to control the quality of the data
plot_var_distribution_qc( dt_assay, cl_name, metric = "x", normalization_type = "GR" )plot_var_distribution_qc( dt_assay, cl_name, metric = "x", normalization_type = "GR" )
dt_assay |
data.table representing data from the assay,
outputted by |
cl_name |
string cell line name to be plotted (Cell Line Name) |
metric |
string with variable name to be plotted; it has to be in |
normalization_type |
string with normalization_types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
ggplot object containing plot with violin for each drug
mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_norm <- gDRutils::convert_se_assay_to_dt(se, "Normalized") cl_name <- dt_norm[["CellLineName"]][1] plot_var_distribution_qc(dt_assay = dt_norm, cl_name = cl_name) dt_average <- gDRutils::convert_se_assay_to_dt(se, "Averaged") plot_var_distribution_qc(dt_assay = dt_average, cl_name = cl_name, normalization_type = "RV") plot_var_distribution_qc(dt_assay = dt_average, cl_name = cl_name, metric = "x_std", normalization_type = "RV") mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_norm <- gDRutils::convert_se_assay_to_dt(se, "Normalized") cl_name <- dt_norm[["CellLineName"]][1] plot_var_distribution_qc(dt_assay = dt_norm, cl_name = cl_name) dt_average <- gDRutils::convert_se_assay_to_dt(se, "Averaged") plot_var_distribution_qc(dt_assay = dt_average, cl_name = cl_name, normalization_type = "RV")mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_norm <- gDRutils::convert_se_assay_to_dt(se, "Normalized") cl_name <- dt_norm[["CellLineName"]][1] plot_var_distribution_qc(dt_assay = dt_norm, cl_name = cl_name) dt_average <- gDRutils::convert_se_assay_to_dt(se, "Averaged") plot_var_distribution_qc(dt_assay = dt_average, cl_name = cl_name, normalization_type = "RV") plot_var_distribution_qc(dt_assay = dt_average, cl_name = cl_name, metric = "x_std", normalization_type = "RV") mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_norm <- gDRutils::convert_se_assay_to_dt(se, "Normalized") cl_name <- dt_norm[["CellLineName"]][1] plot_var_distribution_qc(dt_assay = dt_norm, cl_name = cl_name) dt_average <- gDRutils::convert_se_assay_to_dt(se, "Averaged") plot_var_distribution_qc(dt_assay = dt_average, cl_name = cl_name, normalization_type = "RV")
Lollipop plot for metric single-agent data to control quality of the data
plot_var_stat_qc( dt_assay, cl_name, metric = "r2", normalization_type = "GR", with_table = FALSE )plot_var_stat_qc( dt_assay, cl_name, metric = "r2", normalization_type = "GR", with_table = FALSE )
dt_assay |
data.table representing data from the |
cl_name |
string cell line name to be plotted (Cell Line Name) |
metric |
string with variable name to be plotted; it has to be in |
normalization_type |
string with normalization_types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
with_table |
logical whether table with metric values should be shown next to the plot |
ggplot object containing lollipop plot with stat value for each drug
Bartosz Czech [email protected]
mae <- gDRutils::get_synthetic_data("small") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se, "Metrics") cl_name <- dt_metrics[["CellLineName"]][1] plot_var_stat_qc(dt_assay = dt_metrics, cl_name = cl_name) plot_var_stat_qc(dt_assay = dt_metrics, cl_name = cl_name, metric = "r2", normalization_type = "RV") plot_var_stat_qc(dt_assay = dt_metrics, cl_name = cl_name, metric = "x_AOC", normalization_type = "RV", with_table = TRUE)mae <- gDRutils::get_synthetic_data("small") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se, "Metrics") cl_name <- dt_metrics[["CellLineName"]][1] plot_var_stat_qc(dt_assay = dt_metrics, cl_name = cl_name) plot_var_stat_qc(dt_assay = dt_metrics, cl_name = cl_name, metric = "r2", normalization_type = "RV") plot_var_stat_qc(dt_assay = dt_metrics, cl_name = cl_name, metric = "x_AOC", normalization_type = "RV", with_table = TRUE)
Volcano plot with association
plot_volcano_assoc( dt_assoc, selected_feat_meta_col, selected_metric, condition_info = NULL, alpha = 0.05, named_p_top = 10, max_N = NULL )plot_volcano_assoc( dt_assoc, selected_feat_meta_col, selected_metric, condition_info = NULL, alpha = 0.05, named_p_top = 10, max_N = NULL )
dt_assoc |
|
selected_feat_meta_col |
string describing the name of the associated feature/metadata from DepMap |
selected_metric |
string describing the name of the selected metric used the association calculation |
condition_info |
string describing experiment condition
(preferred: |
alpha |
numeric cutoff to identify statistically significant correlations |
named_p_top |
numeric value for p-top statistically significant correlations to be labeled on the plot |
max_N |
numeric value for limit the maximum number of non-statistically
significant points to plot; for default |
ggplot object containing a volcano plot with association
Y <- matrix(seq(0.5, 2, length.out = 50), nrow = 50, dimnames = list(sprintf("row_%s", 1:50), "met_1")) X <- matrix( withr::with_seed(42, sample(c(NA, seq(0.35, 23.5, 1.25)), size = 50*20, replace = TRUE)), nrow = 50, dimnames = list(sprintf("row_%s", 1:50), sprintf("feat_%s", 1:20))) tab_assoc <- calc_assoc(X, Y) plot_volcano_assoc(tab_assoc, selected_feat_meta_col = "feat_XY", selected_metric = "met_RV")Y <- matrix(seq(0.5, 2, length.out = 50), nrow = 50, dimnames = list(sprintf("row_%s", 1:50), "met_1")) X <- matrix( withr::with_seed(42, sample(c(NA, seq(0.35, 23.5, 1.25)), size = 50*20, replace = TRUE)), nrow = 50, dimnames = list(sprintf("row_%s", 1:50), sprintf("feat_%s", 1:20))) tab_assoc <- calc_assoc(X, Y) plot_volcano_assoc(tab_assoc, selected_feat_meta_col = "feat_XY", selected_metric = "met_RV")
Plot panel with volcano plot and according to the data type - scatter plots or box plots
plot_volcano_assoc_panel( dt_response, dt_depmap, selected_metric, selected_feat_meta_col )plot_volcano_assoc_panel( dt_response, dt_depmap, selected_metric, selected_feat_meta_col )
dt_response |
|
dt_depmap |
|
selected_metric |
string name of the metric in |
selected_feat_meta_col |
string with name of selected feature from |
A named list with elements:
assoc_data table with association data
panel ggplot object containing a panel with volcano plot and depending
on data type: a scatter plots with correlation for top 4 variables or boxplots for variable levels
Janina Smoła [email protected]
mae_prism <- gDRutils::get_synthetic_data("prism") se_prism <- mae_prism[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se_prism, "Metrics") dt_response <- prep_dt_response_metric_sa( dt_metrics = dt_metrics, d_name = unique(dt_metrics[["DrugName"]])[1], normalization_type = "RV", metric = "x_mean") feat_data_path <- system.file("depmap_data", package = "gDRtestData") meta_data_path <- system.file("depmap_data/Model.csv.gz", package = "gDRtestData") obj_depmap_feat <- prep_dt_depmap_feat(feat_data_path, meta_data_path, feature_set = "OmicsCNGene") plot_volcano_assoc_panel( dt_response = dt_response, dt_depmap = obj_depmap_feat[["dt_depmap"]], selected_metric = "RV_gDR_x_mean", selected_feat_meta_col = obj_depmap_feat[["selected_feat_meta_col"]])mae_prism <- gDRutils::get_synthetic_data("prism") se_prism <- mae_prism[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se_prism, "Metrics") dt_response <- prep_dt_response_metric_sa( dt_metrics = dt_metrics, d_name = unique(dt_metrics[["DrugName"]])[1], normalization_type = "RV", metric = "x_mean") feat_data_path <- system.file("depmap_data", package = "gDRtestData") meta_data_path <- system.file("depmap_data/Model.csv.gz", package = "gDRtestData") obj_depmap_feat <- prep_dt_depmap_feat(feat_data_path, meta_data_path, feature_set = "OmicsCNGene") plot_volcano_assoc_panel( dt_response = dt_response, dt_depmap = obj_depmap_feat[["dt_depmap"]], selected_metric = "RV_gDR_x_mean", selected_feat_meta_col = obj_depmap_feat[["selected_feat_meta_col"]])
Prep table with calculated linear associations
prep_dt_assoc(dt_response, dt_depmap, selected_feat_meta_col = NULL)prep_dt_assoc(dt_response, dt_depmap, selected_feat_meta_col = NULL)
dt_response |
|
dt_depmap |
|
selected_feat_meta_col |
string name of feature/meta column in DepMap |
A named list with elements, that may be input to plot_volcano_assoc
dt_assoc data.table with calculated association values between
feature/meta of DepMap and selected metric,
condition_info string describing experiment condition (drugs),
selected_feat_meta_col string name of feature/meta.
Janina Smoła [email protected]
mae_prism <- gDRutils::get_synthetic_data("prism") se_prism <- mae_prism[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se_prism, "Metrics") dt_response <- prep_dt_response_metric_sa( dt_metrics = dt_metrics, d_name = unique(dt_metrics[["DrugName"]])[1], normalization_type = "RV", metric = "x_mean") feat_data_path <- system.file("depmap_data", package = "gDRtestData") meta_data_path <- system.file("depmap_data/Model.csv.gz", package = "gDRtestData") obj_depmap_feat <- prep_dt_depmap_feat(feat_data_path, meta_data_path, feature_set = "OmicsCNGene") prep_dt_assoc( dt_response = dt_response, dt_depmap = obj_depmap_feat[["dt_depmap"]], selected_feat_meta_col = obj_depmap_feat[["selected_feat_meta_col"]])mae_prism <- gDRutils::get_synthetic_data("prism") se_prism <- mae_prism[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se_prism, "Metrics") dt_response <- prep_dt_response_metric_sa( dt_metrics = dt_metrics, d_name = unique(dt_metrics[["DrugName"]])[1], normalization_type = "RV", metric = "x_mean") feat_data_path <- system.file("depmap_data", package = "gDRtestData") meta_data_path <- system.file("depmap_data/Model.csv.gz", package = "gDRtestData") obj_depmap_feat <- prep_dt_depmap_feat(feat_data_path, meta_data_path, feature_set = "OmicsCNGene") prep_dt_assoc( dt_response = dt_response, dt_depmap = obj_depmap_feat[["dt_depmap"]], selected_feat_meta_col = obj_depmap_feat[["selected_feat_meta_col"]])
Prep table with metric values by doses for single-agent experiment
prep_dt_response_dose_sa( dt_average, d_name, normalization_type = "RV", metric = "x", fit_source = "gDR" )prep_dt_response_dose_sa( dt_average, d_name, normalization_type = "RV", metric = "x", fit_source = "gDR" )
dt_average |
|
d_name |
string with drug name to be plotted (identifiers |
normalization_type |
string with normalization types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
metric |
string name of the metric;
one of: "x" (value of "GR" or "RV" itself - respectively depending on |
fit_source |
string source name for metrics |
data.table with selected metric, input to prep_dt_assoc
mae <- gDRutils::get_synthetic_data("combo_matrix_small") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_average <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "Averaged") d_name <- "drug_004" dt_response <- prep_dt_response_dose_sa(dt_average, d_name)mae <- gDRutils::get_synthetic_data("combo_matrix_small") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_average <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "Averaged") d_name <- "drug_004" dt_response <- prep_dt_response_dose_sa(dt_average, d_name)
Prep table with metric values for combination experiment
prep_dt_response_metric_diff( dt_metrics, d_name, d_name2, cellline1 = NULL, cellline2 = NULL, normalization_type = "RV", metric = "xc50", fit_source = "gDR", additional_cols = NULL )prep_dt_response_metric_diff( dt_metrics, d_name, d_name2, cellline1 = NULL, cellline2 = NULL, normalization_type = "RV", metric = "xc50", fit_source = "gDR", additional_cols = NULL )
dt_metrics |
|
d_name |
string representing the drug name to be plotted (identifier |
d_name2 |
string representing the drug name to be plotted (identifier |
cellline1 |
string representing the first cell line name. If set to NULL, the function will return a table for all available cell lines. |
cellline2 |
string representing the second cell line name. If set to NULL, the function will return a table for all available cell lines. |
normalization_type |
string with normalization types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
metric |
string name of the metric;
one of: "xc50" ("GR50" or "IC50" - respectively depending on |
fit_source |
string source name for metrics |
additional_cols |
character vector with additional cols that should be included in the output |
data.table with selected metric, input to prep_dt_assoc
mae <- gDRutils::get_synthetic_data("combo_matrix_small") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "Metrics") d_name <- "drug_004" d_name2 <- "drug_026" dt_response <- prep_dt_response_metric_diff(dt_metrics, d_name, d_name2, metric = c("xc50", "x_mean", "x_max")) cellline1 <- "cellline_GB" cellline2 <- "cellline_HB" dt_response <- prep_dt_response_metric_diff(dt_metrics, d_name = NULL, d_name2 = NULL, cellline1, cellline2, metric = c("xc50", "x_mean", "x_max"))mae <- gDRutils::get_synthetic_data("combo_matrix_small") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "Metrics") d_name <- "drug_004" d_name2 <- "drug_026" dt_response <- prep_dt_response_metric_diff(dt_metrics, d_name, d_name2, metric = c("xc50", "x_mean", "x_max")) cellline1 <- "cellline_GB" cellline2 <- "cellline_HB" dt_response <- prep_dt_response_metric_diff(dt_metrics, d_name = NULL, d_name2 = NULL, cellline1, cellline2, metric = c("xc50", "x_mean", "x_max"))
Prep table with metric values for single-agent experiment
prep_dt_response_metric_sa( dt_metrics, d_name, normalization_type = "RV", metric = "xc50", fit_source = "gDR" )prep_dt_response_metric_sa( dt_metrics, d_name, normalization_type = "RV", metric = "xc50", fit_source = "gDR" )
dt_metrics |
|
d_name |
string with drug name to be plotted (identifiers |
normalization_type |
string with normalization types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
metric |
string name of the metric;
one of: "xc50" ("GR50" or "IC50" - respectively depending on |
fit_source |
string source name for metrics |
data.table with selected metric, input to prep_dt_assoc
mae <- gDRutils::get_synthetic_data("combo_matrix_small") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "Metrics") d_name <- "drug_004" dt_response <- prep_dt_response_metric_sa(dt_metrics, d_name) dt_response <- prep_dt_response_metric_sa(dt_metrics, d_name, metric = c("xc50", "x_mean", "x_max")) dt_averaged <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "Averaged") dt_metrics_capped <- gDRutils::cap_assay_infinities(conc_assay_dt = dt_averaged, assay_dt = dt_metrics, experiment_name = gDRutils::get_supported_experiments("sa"), capping_fold = 5) d_name <- "drug_026" dt_response <- prep_dt_response_metric_sa(dt_metrics, d_name) dt_response <- prep_dt_response_metric_sa(dt_metrics, d_name, metric = c("xc50", "x_mean", "x_max"))mae <- gDRutils::get_synthetic_data("combo_matrix_small") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "Metrics") d_name <- "drug_004" dt_response <- prep_dt_response_metric_sa(dt_metrics, d_name) dt_response <- prep_dt_response_metric_sa(dt_metrics, d_name, metric = c("xc50", "x_mean", "x_max")) dt_averaged <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "Averaged") dt_metrics_capped <- gDRutils::cap_assay_infinities(conc_assay_dt = dt_averaged, assay_dt = dt_metrics, experiment_name = gDRutils::get_supported_experiments("sa"), capping_fold = 5) d_name <- "drug_026" dt_response <- prep_dt_response_metric_sa(dt_metrics, d_name) dt_response <- prep_dt_response_metric_sa(dt_metrics, d_name, metric = c("xc50", "x_mean", "x_max"))
Prep table with metric values for combination experiment
prep_dt_response_scores( dt_scores, d_name, d_name2, normalization_type = "RV", metric = "hsa_score", fit_source = "gDR" )prep_dt_response_scores( dt_scores, d_name, d_name2, normalization_type = "RV", metric = "hsa_score", fit_source = "gDR" )
dt_scores |
|
d_name |
string with drug name to be plotted (identifiers |
d_name2 |
string with drug name to be plotted (identifiers |
normalization_type |
string with normalization types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
metric |
string name of the combo metric;
one of: "hsa_score"("Bliss Excess GR" or "Bliss Excess RV" - respectively
depending on |
fit_source |
string source name for metrics |
data.table with selected metric, input to prep_dt_assoc
mae <- gDRutils::get_synthetic_data("combo_matrix_small") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_scores <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "scores") d_name <- "drug_004" d_name2 <- "drug_026" dt_response <- prep_dt_response_scores(dt_scores, d_name, d_name2) dt_response <- prep_dt_response_scores(dt_scores, d_name, d_name2, metric = c("hsa_score", "bliss_score"))mae <- gDRutils::get_synthetic_data("combo_matrix_small") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_scores <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "scores") d_name <- "drug_004" d_name2 <- "drug_026" dt_response <- prep_dt_response_scores(dt_scores, d_name, d_name2) dt_response <- prep_dt_response_scores(dt_scores, d_name, d_name2, metric = c("hsa_score", "bliss_score"))
Prep matrix with metric value based on the Metrics assay
prep_pheatmap_matrix( dt_response, normalization_type = "GR", metric = "xc50", fit_source = "gDR", experiment_type = gDRutils::get_supported_experiments("sa") )prep_pheatmap_matrix( dt_response, normalization_type = "GR", metric = "xc50", fit_source = "gDR", experiment_type = gDRutils::get_supported_experiments("sa") )
dt_response |
|
normalization_type |
string with normalization types to be selected one of: "GR" ("GRvalue") or "RV" ("RelativeViability") |
metric |
string name of the metric;
one of: "xc50" ("GR50" or "IC50" - respectively depending on |
fit_source |
string source name for metrics |
experiment_type |
string with experiment name; one of: "single-agent", "combination" or "co-dilution" |
matrix with values for selected metric with CellLinName in the rows
and DrugName (or combination of DrugName and DrugName_2) in the columns
Janina Smoła [email protected]
mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "Metrics") mat <- prep_pheatmap_matrix(dt_response = dt_metrics, experiment_type = gDRutils::get_supported_experiments("sa")) mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_scores <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "scores") mat <- prep_pheatmap_matrix(dt_response = dt_scores, metric = "hsa_score", normalization_type = "RV", experiment_type = gDRutils::get_supported_experiments("combo"))mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("sa")]] dt_metrics <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "Metrics") mat <- prep_pheatmap_matrix(dt_response = dt_metrics, experiment_type = gDRutils::get_supported_experiments("sa")) mae <- gDRutils::get_synthetic_data("combo_matrix") se <- mae[[gDRutils::get_supported_experiments("combo")]] dt_scores <- gDRutils::convert_se_assay_to_dt(se = se, assay_name = "scores") mat <- prep_pheatmap_matrix(dt_response = dt_scores, metric = "hsa_score", normalization_type = "RV", experiment_type = gDRutils::get_supported_experiments("combo"))
Rounds a numeric vector to the minimum precision needed to ensure uniqueness
round_to_unique_string(num_vec, initial_digits = 4)round_to_unique_string(num_vec, initial_digits = 4)
num_vec |
a numeric vector to be rounded and change into character |
initial_digits |
numeric value for number of decimal places to start rounding with |
a character vector of unique numeric strings.
Janina Smoła [email protected]
vec <- c(0.00000000, 0.00000256, 0.00001280, 0.00006400, 0.00032000, 0.00160000, 0.00800000, 0.04000000, 0.20000000, 1.00000000) round_to_unique_string(vec)vec <- c(0.00000000, 0.00000256, 0.00001280, 0.00006400, 0.00032000, 0.00160000, 0.00800000, 0.04000000, 0.20000000, 1.00000000) round_to_unique_string(vec)