Title: | Batch Effects Quality Control Software |
---|---|
Description: | Sequencing and microarray samples often are collected or processed in multiple batches or at different times. This often produces technical biases that can lead to incorrect results in the downstream analysis. BatchQC is a software tool that streamlines batch preprocessing and evaluation by providing interactive diagnostics, visualizations, and statistical analyses to explore the extent to which batch variation impacts the data. BatchQC diagnostics help determine whether batch adjustment needs to be done, and how correction should be applied before proceeding with a downstream analysis. Moreover, BatchQC interactively applies multiple common batch effect approaches to the data and the user can quickly see the benefits of each method. BatchQC is developed as a Shiny App. The output is organized into multiple tabs and each tab features an important part of the batch effect analysis and visualization of the data. The BatchQC interface has the following analysis groups: Summary, Differential Expression, Median Correlations, Heatmaps, Circular Dendrogram, PCA Analysis, Shape, ComBat and SVA. |
Authors: | Jessica McClintock [aut, cre] , W. Evan Johnson [aut] , Solaiappan Manimaran [aut], Heather Selby [ctb], Claire Ruberman [ctb], Kwame Okrah [ctb], Hector Corrada Bravo [ctb], Michael Silverstein [ctb], Regan Conrad [ctb], Zhaorong Li [ctb], Evan Holmes [aut], Solomon Joseph [ctb] |
Maintainer: | Jessica McClintock <[email protected]> |
License: | MIT + file LICENSE |
Version: | 2.3.0 |
Built: | 2024-11-29 04:12:15 UTC |
Source: | https://github.com/bioc/BatchQC |
Batch Correct This function allows you to Add batch corrected count matrix to the SE object
batch_correct(se, method, assay_to_normalize, batch, group = NULL, covar, output_assay_name)
batch_correct(se, method, assay_to_normalize, batch, group = NULL, covar, output_assay_name)
se |
SummarizedExperiment object |
method |
Normalization Method |
assay_to_normalize |
Which assay use to do normalization |
batch |
The batch |
group |
The group variable |
covar |
Covariate Matrix |
output_assay_name |
name of results assay |
a summarized experiment object with normalized assay appended
library(scran) se <- mockSCE() se <- BatchQC::batch_correct(se, method = "ComBat-Seq", assay_to_normalize = "counts", batch = "Mutation_Status", covar = "Treatment", output_assay_name = "ComBat_Seq_Corrected") se <- BatchQC::batch_correct(se, method = "Combat", assay_to_normalize = "counts", batch = "Mutation_Status", covar = "Treatment", output_assay_name = "Combat_Corrected") se
library(scran) se <- mockSCE() se <- BatchQC::batch_correct(se, method = "ComBat-Seq", assay_to_normalize = "counts", batch = "Mutation_Status", covar = "Treatment", output_assay_name = "ComBat_Seq_Corrected") se <- BatchQC::batch_correct(se, method = "Combat", assay_to_normalize = "counts", batch = "Mutation_Status", covar = "Treatment", output_assay_name = "Combat_Corrected") se
This function allows you to make a batch design matrix
batch_design(se, batch, covariate)
batch_design(se, batch, covariate)
se |
summarized experiment |
batch |
batch variable |
covariate |
biological covariate |
design table
library(scran) se <- mockSCE() batch_design_tibble <- batch_design(se, batch = "Mutation_Status", covariate = "Treatment") batch_design_tibble
library(scran) se <- mockSCE() batch_design_tibble <- batch_design(se, batch = "Mutation_Status", covariate = "Treatment") batch_design_tibble
This dataset is from signature data captured when activating different growth pathway genes in human mammary epithelial cells (GEO accession: GSE73628). This data consists of three batches and ten different conditions corresponding to control and nine different pathways.
data(batch_indicator)
data(batch_indicator)
A data frame with 89 rows and 2 variables:
batch
condition
Run BatchQC shiny app
BatchQC(dev = FALSE)
BatchQC(dev = FALSE)
dev |
Run the application in developer mode |
The shiny app will open
if(interactive()){ BatchQC() }
if(interactive()){ BatchQC() }
Returns a list of explained variation by batch and condition combinations
batchqc_explained_variation(se, batch, condition = NULL, assay_name)
batchqc_explained_variation(se, batch, condition = NULL, assay_name)
se |
Summarized experiment object |
batch |
Batch covariate |
condition |
Condition covariate(s) of interest if desired, default is NULL |
assay_name |
Assay of choice |
List of explained variation by batch and condition
library(scran) se <- mockSCE() batchqc_explained_variation <- BatchQC::batchqc_explained_variation(se, batch = "Mutation_Status", condition = "Treatment", assay_name = "counts") batchqc_explained_variation
library(scran) se <- mockSCE() batchqc_explained_variation <- BatchQC::batchqc_explained_variation(se, batch = "Mutation_Status", condition = "Treatment", assay_name = "counts") batchqc_explained_variation
Bladder data upload This function uploads the Bladder data set from the bladderbatch package. This dataset is from bladder cancer data with 22,283 different microarray gene expression data. It has 57 bladder samples with 3 metadata variables (batch, outcome and cancer). It contains 5 batches, 3 cancer types (cancer, biopsy, control), and 5 outcomes (Biopsy, mTCC, sTCC-CIS, sTCC+CIS, and Normal). Batch 1 contains only cancer, 2 has cancer and controls, 3 has only controls, 4 contains only biopsy, and 5 contains cancer and biopsy
bladder_data_upload()
bladder_data_upload()
a SE object with counts data and metadata
library(bladderbatch) se_object <- bladder_data_upload()
library(bladderbatch) se_object <- bladder_data_upload()
Helper function to save variables as factors if not already factors
check_valid_input(se, batch, condition)
check_valid_input(se, batch, condition)
se |
se object |
batch |
batch |
condition |
condition |
se se object
This function creates the base color palette used in BatchQC
color_palette(n, first_hue = 25, last_hue = 360)
color_palette(n, first_hue = 25, last_hue = 360)
n |
numeric object representing number of colors to be created |
first_hue |
numeric object to set the first hue value |
last_hue |
numeric object to set the final hue value |
color_list list of colors generated
library(scran) n <- 100 color_list <- color_palette(n) color_list
library(scran) n <- 100 color_list <- color_palette(n) color_list
Combat Correction This function applies combat correction to your summarized experiment object
combat_correction(se, assay_to_normalize, batch, covar, output_assay_name)
combat_correction(se, assay_to_normalize, batch, covar, output_assay_name)
se |
SummarizedExperiment object |
assay_to_normalize |
Assay that should be corrected |
batch |
The variable that represents batch |
covar |
Covariate Matrix |
output_assay_name |
name of results assay |
SE object with an added combat corrected array
Combat-Seq Correction This function applies combat-seq correction to your summarized experiment object
combat_seq_correction(se, assay_to_normalize, batch, group, covar, output_assay_name)
combat_seq_correction(se, assay_to_normalize, batch, group, covar, output_assay_name)
se |
SummarizedExperiment object |
assay_to_normalize |
Assay that should be corrected |
batch |
The variable that represents batch |
group |
The group variable |
covar |
Covariate Matrix |
output_assay_name |
name of results assay |
SE object with an added combat-seq corrected array
Combine std. Pearson correlation coefficient and Cramer's V
confound_metrics(se, batch)
confound_metrics(se, batch)
se |
summarized experiment |
batch |
batch variable |
metrics of confounding
library(scran) se <- mockSCE() confound_table <- BatchQC::confound_metrics(se, batch = "Mutation_Status") confound_table
library(scran) se <- mockSCE() confound_table <- BatchQC::confound_metrics(se, batch = "Mutation_Status") confound_table
This function allows you to calculate correlation properties
cor_props(bd)
cor_props(bd)
bd |
batch design |
correlation properties
library(scran) se <- mockSCE() batch_design_tibble <- batch_design(se, batch = "Mutation_Status", covariate = "Treatment") correlation_property <- BatchQC::cor_props(batch_design_tibble) correlation_property
library(scran) se <- mockSCE() batch_design_tibble <- batch_design(se, batch = "Mutation_Status", covariate = "Treatment") correlation_property <- BatchQC::cor_props(batch_design_tibble) correlation_property
Returns list of covariates not confounded by batch; helper function for explained variation and for populating shiny app condition options
covariates_not_confounded(se, batch)
covariates_not_confounded(se, batch)
se |
Summarized experiment object |
batch |
Batch variable |
List of explained variation by batch and condition
library(scran) se <- mockSCE() covariates_not_confounded <- BatchQC::covariates_not_confounded(se, batch = "Mutation_Status") covariates_not_confounded
library(scran) se <- mockSCE() covariates_not_confounded <- BatchQC::covariates_not_confounded(se, batch = "Mutation_Status") covariates_not_confounded
This function allows you to calculate Cramer's V
cramers_v(bd)
cramers_v(bd)
bd |
batch design |
Cramer's V
library(scran) se <- mockSCE() batch_design_tibble <- batch_design(se, batch = "Mutation_Status", covariate = "Treatment") cramers_v_result <- BatchQC::cramers_v(batch_design_tibble) cramers_v_result
library(scran) se <- mockSCE() batch_design_tibble <- batch_design(se, batch = "Mutation_Status", covariate = "Treatment") cramers_v_result <- BatchQC::cramers_v(batch_design_tibble) cramers_v_result
This function runs DE analysis on a count matrix (DESeq) or a normalized log or log-CPM matrix (limma) contained in the se object
DE_analyze(se, method, batch, conditions, assay_to_analyze)
DE_analyze(se, method, batch, conditions, assay_to_analyze)
se |
SummarizedExperiment object |
method |
DE analysis method option (either 'DESeq2' or 'limma') |
batch |
metadata column in the se object representing batch |
conditions |
metadata columns in the se object representing additional analysis covariates |
assay_to_analyze |
Assay in the se object (either counts for DESeq2 or normalized data for limma) for DE analysis |
A named list containing the log2FoldChange, pvalue and adjusted pvalue (padj) for each analysis returned by DESeq2 or limma
library(scran) se <- mockSCE() differential_expression <- BatchQC::DE_analyze(se = se, method = "DESeq2", batch = "Treatment", conditions = c( "Mutation_Status"), assay_to_analyze = "counts") pval_summary(differential_expression) pval_plotter(differential_expression)
library(scran) se <- mockSCE() differential_expression <- BatchQC::DE_analyze(se = se, method = "DESeq2", batch = "Treatment", conditions = c( "Mutation_Status"), assay_to_analyze = "counts") pval_summary(differential_expression) pval_plotter(differential_expression)
This function checks if there is any numeric or strings for plotting legend
dendrogram_alpha_numeric_check(dendro_var)
dendrogram_alpha_numeric_check(dendro_var)
dendro_var |
column from dendrogram object representing category |
geom_label label for the legend of category variable
library(scran) se <- mockSCE() dendro_alpha_numeric_check <- dendrogram_alpha_numeric_check( dendro_var = "Treatment") dendro_alpha_numeric_check
library(scran) se <- mockSCE() dendro_alpha_numeric_check <- dendrogram_alpha_numeric_check( dendro_var = "Treatment") dendro_alpha_numeric_check
This function creates the color palette used in the dendrogram plotter
dendrogram_color_palette(col, dendrogram_info)
dendrogram_color_palette(col, dendrogram_info)
col |
string object representing color of the label |
dendrogram_info |
dendrogram_ends object |
annotation_color vector of colors corresponding to col variable
library(scran) se <- mockSCE() process_dendro <- BatchQC::process_dendrogram(se, "counts") dendrogram_ends <- process_dendro$dendrogram_ends col <- process_dendro$condition_var dendro_colors <- dendrogram_color_palette(col = "Treatment", dendrogram_info = dendrogram_ends) dendro_colors
library(scran) se <- mockSCE() process_dendro <- BatchQC::process_dendrogram(se, "counts") dendrogram_ends <- process_dendro$dendrogram_ends col <- process_dendro$condition_var dendro_colors <- dendrogram_color_palette(col = "Treatment", dendrogram_info = dendrogram_ends) dendro_colors
This function creates a dendrogram plot
dendrogram_plotter(se, assay, batch_var, category_var)
dendrogram_plotter(se, assay, batch_var, category_var)
se |
SummarizedExperiment object |
assay |
assay to plot |
batch_var |
sample metadata column representing batch |
category_var |
sample metadata column representing category of interest |
named list of dendrogram plots
dendrogram is a dendrogram ggplot
circular_dendrogram is a circular dendrogram ggplot
library(scran) se <- mockSCE() dendrogram_plot <- BatchQC::dendrogram_plotter(se, "counts", "Mutation_Status", "Treatment") dendrogram_plot$dendrogram dendrogram_plot$circular_dendrogram
library(scran) se <- mockSCE() dendrogram_plot <- BatchQC::dendrogram_plotter(se, "counts", "Mutation_Status", "Treatment") dendrogram_plot$dendrogram dendrogram_plot$circular_dendrogram
This function allows you to plot explained variation
EV_plotter(batchqc_ev)
EV_plotter(batchqc_ev)
batchqc_ev |
table of explained variation from batchqc_explained_variation |
boxplot of explained variation
library(scran) se <- mockSCE() se$Mutation_Status <- as.factor(se$Mutation_Status) se$Treatment <- as.factor(se$Treatment) expl_var_result <- batchqc_explained_variation(se, batch = "Mutation_Status", condition = "Treatment", assay_name = "counts") EV_boxplot <- BatchQC::EV_plotter(expl_var_result[[1]]) EV_boxplot
library(scran) se <- mockSCE() se$Mutation_Status <- as.factor(se$Mutation_Status) se$Treatment <- as.factor(se$Treatment) expl_var_result <- batchqc_explained_variation(se, batch = "Mutation_Status", condition = "Treatment", assay_name = "counts") EV_boxplot <- BatchQC::EV_plotter(expl_var_result[[1]]) EV_boxplot
EV Table Returns table with percent variation explained for specified number of genes
EV_table(batchqc_ev)
EV_table(batchqc_ev)
batchqc_ev |
explained variation results from batchqc_explained_variation |
List of explained variation by batch and condition
library(scran) se <- mockSCE() se$Mutation_Status <- as.factor(se$Mutation_Status) se$Treatment <- as.factor(se$Treatment) exp_var_result <- BatchQC::batchqc_explained_variation(se, batch = "Mutation_Status", condition = "Treatment", assay_name = "counts") EV_table <- BatchQC::EV_table(exp_var_result[[1]]) EV_table
library(scran) se <- mockSCE() se$Mutation_Status <- as.factor(se$Mutation_Status) se$Treatment <- as.factor(se$Treatment) exp_var_result <- BatchQC::batchqc_explained_variation(se, batch = "Mutation_Status", condition = "Treatment", assay_name = "counts") EV_table <- BatchQC::EV_table(exp_var_result[[1]]) EV_table
Helper function to get residuals
get.res(y, X)
get.res(y, X)
y |
assay |
X |
model matrix design |
residuals
This function calculates goodness-of-fit pvalues for all genes by looking at how the NB model by DESeq2 fit the data
goodness_of_fit_DESeq2( se, count_matrix, condition, other_variables = NULL, num_genes = 500, seeding = 13 )
goodness_of_fit_DESeq2( se, count_matrix, condition, other_variables = NULL, num_genes = 500, seeding = 13 )
se |
the se object where all the data is contained |
count_matrix |
name of the assay with gene expression matrix (in counts) |
condition |
name of the se colData with the condition status |
other_variables |
name of the se colData containing other variables of interest that should be considered in the DESeq2 model |
num_genes |
downsample value, default is 500 (or all genes if less) |
seeding |
integer to set the seed to for reproducibility; default is 13 |
a matrix of pvalues where each row is a gene and each column is a level within the condition of interest
# example code library(scran) se <- mockSCE(ncells = 20) se$Treatment <- as.factor(se$Treatment) se$Mutation_Status <- as.factor(se$Mutation_Status) nb_results <- goodness_of_fit_DESeq2(se = se, count_matrix = "counts", condition = "Treatment", other_variables = "Mutation_Status") nb_results[1] nb_results[2] nb_results[3]
# example code library(scran) se <- mockSCE(ncells = 20) se$Treatment <- as.factor(se$Treatment) se$Mutation_Status <- as.factor(se$Mutation_Status) nb_results <- goodness_of_fit_DESeq2(se = se, count_matrix = "counts", condition = "Treatment", other_variables = "Mutation_Status") nb_results[1] nb_results[2] nb_results[3]
This function converts any found numerics to characters
heatmap_num_to_char_converter(ann_col)
heatmap_num_to_char_converter(ann_col)
ann_col |
column data of heatmap |
ann_col modified column data of heatmap
library(scran) se <- mockSCE() col_info <- colData(se) ann_col <- heatmap_num_to_char_converter(ann_col = col_info) ann_col
library(scran) se <- mockSCE() col_info <- colData(se) ann_col <- heatmap_num_to_char_converter(ann_col = col_info) ann_col
This function allows you to plot a heatmap
heatmap_plotter(se, assay, nfeature, annotation_column, log_option)
heatmap_plotter(se, assay, nfeature, annotation_column, log_option)
se |
SummarizedExperiment |
assay |
normalized or corrected assay |
nfeature |
number of features to display |
annotation_column |
choose column |
log_option |
TRUE if data should be logged before plotting (recommended for sequencing counts), FALSE if data should not be logged (for instance, data is already logged) |
heatmap plot
library(scran) se <- mockSCE() heatmaps <- BatchQC::heatmap_plotter(se, assay = "counts", nfeature = 15, annotation_column = c("Mutation_Status", "Treatment"), log_option = FALSE) correlation_heatmap <- heatmaps$correlation_heatmap correlation_heatmap heatmap <- heatmaps$topn_heatmap heatmap
library(scran) se <- mockSCE() heatmaps <- BatchQC::heatmap_plotter(se, assay = "counts", nfeature = 15, annotation_column = c("Mutation_Status", "Treatment"), log_option = FALSE) correlation_heatmap <- heatmaps$correlation_heatmap correlation_heatmap heatmap <- heatmaps$topn_heatmap heatmap
This function creates a histogram from the negative binomial goodness-of-fit pvalues.
nb_histogram(p_val_table)
nb_histogram(p_val_table)
p_val_table |
table of p-values from the nb test |
a histogram of the number of genes within a p-value range
This function determines the proportion of p-values below a specific value and compares to the previously determined threshold of 0.42 for extreme low values.
nb_proportion(p_val_table, low_pval = 0.01, threshold = 0.42, num_samples)
nb_proportion(p_val_table, low_pval = 0.01, threshold = 0.42, num_samples)
p_val_table |
table of p-values from the nb test |
low_pval |
value of the p-value cut off to use in proportion |
threshold |
the value to compare the proportion of p-values to for data sets less than 20, default is 0.42 |
num_samples |
the number of samples in the analysis |
a statement about whether DESeq2 is appropriate to use for analysis
This function allows you to add normalized count matrix to the SE object
normalize_SE(se, method, log_bool, assay_to_normalize, output_assay_name)
normalize_SE(se, method, log_bool, assay_to_normalize, output_assay_name)
se |
SummarizedExperiment Object |
method |
Normalization Method, either 'CPM' or 'DESeq' or 'none' for log only |
log_bool |
True or False; True to log normalize the data set after normalization method |
assay_to_normalize |
Which SE assay to do normalization on |
output_assay_name |
name for the resulting normalized assay |
the original SE object with normalized assay appended
library(scran) se <- mockSCE() se_CPM_normalized <- BatchQC::normalize_SE(se, method = "CPM", log_bool = FALSE, assay_to_normalize = "counts", output_assay_name = "CPM_normalized_counts") se_DESeq_normalized <- BatchQC::normalize_SE(se, method = "DESeq", log_bool = FALSE, assay_to_normalize = "counts", output_assay_name = "DESeq_normalized_counts") se_CPM_normalized se_DESeq_normalized
library(scran) se <- mockSCE() se_CPM_normalized <- BatchQC::normalize_SE(se, method = "CPM", log_bool = FALSE, assay_to_normalize = "counts", output_assay_name = "CPM_normalized_counts") se_DESeq_normalized <- BatchQC::normalize_SE(se, method = "DESeq", log_bool = FALSE, assay_to_normalize = "counts", output_assay_name = "DESeq_normalized_counts") se_CPM_normalized se_DESeq_normalized
This function allows you to plot PCA
PCA_plotter(se, nfeature, color, shape, assays, xaxisPC, yaxisPC, log_option = FALSE)
PCA_plotter(se, nfeature, color, shape, assays, xaxisPC, yaxisPC, log_option = FALSE)
se |
SummarizedExperiment object |
nfeature |
number of features |
color |
choose a color |
shape |
choose a shape |
assays |
array of assay names from |
xaxisPC |
the PC to plot as the x axis |
yaxisPC |
the PC to plot as the y axis |
log_option |
TRUE if data should be logged before plotting (recommended for sequencing counts), FALSE if data should not be logged (for instance, data is already logged); FALSE by default |
List containing PCA info, PCA variance and PCA plot
library(scran) se <- mockSCE() se_object_ComBat_Seq <- BatchQC::batch_correct(se, method = "ComBat-Seq", assay_to_normalize = "counts", batch = "Mutation_Status", covar = "Treatment", output_assay_name = "ComBat_Seq_Corrected") pca_plot <- BatchQC::PCA_plotter(se = se_object_ComBat_Seq, nfeature = 2, color = "Mutation_Status", shape = "Treatment", assays = c("counts", "ComBat_Seq_Corrected"), xaxisPC = 1, yaxisPC = 2, log_option = FALSE) pca_plot$plot pca_plot$var_explained
library(scran) se <- mockSCE() se_object_ComBat_Seq <- BatchQC::batch_correct(se, method = "ComBat-Seq", assay_to_normalize = "counts", batch = "Mutation_Status", covar = "Treatment", output_assay_name = "ComBat_Seq_Corrected") pca_plot <- BatchQC::PCA_plotter(se = se_object_ComBat_Seq, nfeature = 2, color = "Mutation_Status", shape = "Treatment", assays = c("counts", "ComBat_Seq_Corrected"), xaxisPC = 1, yaxisPC = 2, log_option = FALSE) pca_plot$plot pca_plot$var_explained
This function formats the PCA plot using ggplot
plot_data(pca_plot_data, color, shape, xaxisPC, yaxisPC)
plot_data(pca_plot_data, color, shape, xaxisPC, yaxisPC)
pca_plot_data |
Data for all assays to plot |
color |
variable that will be plotted as color |
shape |
variable that will be plotted as shape |
xaxisPC |
the PC to plot as the x axis |
yaxisPC |
the PC to plot as the y axis |
PCA plot
Preprocess assay data
preprocess(se, assay, nfeature, log_option)
preprocess(se, assay, nfeature, log_option)
se |
Summarized Experiment object |
assay |
Assay from SummarizedExperiment object |
nfeature |
Number of variable features to use |
log_option |
"True" if data should be logged, "False" otherwise |
Returns processed data
This function processes count data for dendrogram plotting
process_dendrogram(se, assay)
process_dendrogram(se, assay)
se |
SummarizedExperiment object |
assay |
assay to plot |
named list of dendrogram data
dendrogram_segments is data representing segments of the dendrogram
dendrogram_ends is data representing ends of the dendrogram
library(scran) se <- mockSCE() process_dendro <- BatchQC::process_dendrogram(se, "counts") process_dendro
library(scran) se <- mockSCE() process_dendro <- BatchQC::process_dendrogram(se, "counts") process_dendro
This data consists of two batches and two conditions corresponding to case and control. The columns are case/control samples, and the rows represent 39 different proteins.
data(protein_data)
data(protein_data)
A data frame with 39 rows and 24 variables
This data consists of two batches and two conditions corresponding to case and control for the protein expression data
data(protein_sample_info)
data(protein_sample_info)
A data frame with 24 rows and 2 variables:
Batch Indicator
Condition (Case vs Control) Indicator
P-value Plotter This function allows you to plot p-values of explained variation
pval_plotter(DE_results)
pval_plotter(DE_results)
DE_results |
Differential Expression analysis result (a named list of dataframes corresponding to each analysis completed with a "pvalue" column) |
boxplots of pvalues for each condition
library(scran) se <- mockSCE() differential_expression <- BatchQC::DE_analyze(se = se, method = "DESeq2", batch = "Treatment", conditions = c( "Mutation_Status"), assay_to_analyze = "counts") pval_summary(differential_expression) pval_plotter(differential_expression)
library(scran) se <- mockSCE() differential_expression <- BatchQC::DE_analyze(se = se, method = "DESeq2", batch = "Treatment", conditions = c( "Mutation_Status"), assay_to_analyze = "counts") pval_summary(differential_expression) pval_plotter(differential_expression)
Returns summary table for p-values of explained variation
pval_summary(res_list)
pval_summary(res_list)
res_list |
Differential Expression analysis result (a named list of dataframes corresponding to each analysis completed with a "pvalue" column) |
summary table for p-values of explained variation for each analysis
library(scran) se <- mockSCE() differential_expression <- BatchQC::DE_analyze(se = se, method = "DESeq2", batch = "Treatment", conditions = c( "Mutation_Status"), assay_to_analyze = "counts") pval_summary(differential_expression)
library(scran) se <- mockSCE() differential_expression <- BatchQC::DE_analyze(se = se, method = "DESeq2", batch = "Treatment", conditions = c( "Mutation_Status"), assay_to_analyze = "counts") pval_summary(differential_expression)
This function allows you to plot ratios of explained variation
ratio_plotter(ev_ratio)
ratio_plotter(ev_ratio)
ev_ratio |
table of ratios from variation_ratios() |
boxplot of ratios
library(scran) se <- mockSCE() se$Mutation_Status <- as.factor(se$Mutation_Status) se$Treatment <- as.factor(se$Treatment) expl_var_result <- batchqc_explained_variation(se, batch = "Mutation_Status", condition = "Treatment", assay_name = "counts") ratios_results <- variation_ratios(expl_var_result[[1]], batch = "Mutation_Status") ratio_boxplot <- BatchQC::ratio_plotter(ratios_results) ratio_boxplot
library(scran) se <- mockSCE() se$Mutation_Status <- as.factor(se$Mutation_Status) se$Treatment <- as.factor(se$Treatment) expl_var_result <- batchqc_explained_variation(se, batch = "Mutation_Status", condition = "Treatment", assay_name = "counts") ratios_results <- variation_ratios(expl_var_result[[1]], batch = "Mutation_Status") ratio_boxplot <- BatchQC::ratio_plotter(ratios_results) ratio_boxplot
This data consists of three batches and ten conditions. The columns are samples, and the rows represent 1600 different genes.
data(signature_data)
data(signature_data)
A data frame with 1600 rows and 89 variables
Calculate a standardized Pearson correlation coefficient
std_pearson_corr_coef(bd)
std_pearson_corr_coef(bd)
bd |
batch design |
standardized Pearson correlation coefficient
library(scran) se <- mockSCE() batch_design_tibble <- batch_design(se, batch = "Mutation_Status", covariate = "Treatment") pearson_cor_result <- BatchQC::std_pearson_corr_coef(batch_design_tibble) pearson_cor_result
library(scran) se <- mockSCE() batch_design_tibble <- batch_design(se, batch = "Mutation_Status", covariate = "Treatment") pearson_cor_result <- BatchQC::std_pearson_corr_coef(batch_design_tibble) pearson_cor_result
This function creates a summarized experiment object from count and metadata files uploaded by the user
summarized_experiment(counts, columndata)
summarized_experiment(counts, columndata)
counts |
counts dataframe |
columndata |
metadata dataframe |
a summarized experiment object
data(protein_data) data(protein_sample_info) se_object <- summarized_experiment(protein_data, protein_sample_info)
data(protein_data) data(protein_sample_info) se_object <- summarized_experiment(protein_data, protein_sample_info)
Creates Ratios of batch to variable variation statistic
variation_ratios(ex_variation_table, batch)
variation_ratios(ex_variation_table, batch)
ex_variation_table |
table of explained variation results from batchqc_explained_variation |
batch |
batch |
dataframe with condition/batch ratios
library(scran) se <- mockSCE() se$Mutation_Status <- as.factor(se$Mutation_Status) se$Treatment <- as.factor(se$Treatment) expl_var_result <- batchqc_explained_variation(se, batch = "Mutation_Status", condition = "Treatment", assay_name = "counts") ratios_results <- variation_ratios(expl_var_result[[1]], batch = "Mutation_Status") ratios_results
library(scran) se <- mockSCE() se$Mutation_Status <- as.factor(se$Mutation_Status) se$Treatment <- as.factor(se$Treatment) expl_var_result <- batchqc_explained_variation(se, batch = "Mutation_Status", condition = "Treatment", assay_name = "counts") ratios_results <- variation_ratios(expl_var_result[[1]], batch = "Mutation_Status") ratios_results
This function allows you to plot DE analysis results as a volcano plot
volcano_plot(DE_results, pslider = 0.05, fcslider)
volcano_plot(DE_results, pslider = 0.05, fcslider)
DE_results |
a dataframe with the results of one of the DE Analysis; must include "log2FoldChange" and "pvalue" columns |
pslider |
Magnitude of significance value threshold, default is 0.05 |
fcslider |
Magnitude of expression change value threshold |
A volcano plot of expression change and significance value data
library(scran) se <- mockSCE() differential_expression <- BatchQC::DE_analyze(se = se, method = "DESeq2", batch = "Treatment", conditions = c( "Mutation_Status", "Cell_Cycle"), assay_to_analyze = "counts") value <- round((max(abs( differential_expression[[length(differential_expression)]][, 1])) + min(abs( differential_expression[[length(differential_expression)]][, 1]))) / 2) volcano_plot(differential_expression[[1]], pslider = 0.05, fcslider = value)
library(scran) se <- mockSCE() differential_expression <- BatchQC::DE_analyze(se = se, method = "DESeq2", batch = "Treatment", conditions = c( "Mutation_Status", "Cell_Cycle"), assay_to_analyze = "counts") value <- round((max(abs( differential_expression[[length(differential_expression)]][, 1])) + min(abs( differential_expression[[length(differential_expression)]][, 1]))) / 2) volcano_plot(differential_expression[[1]], pslider = 0.05, fcslider = value)