title: "Quantitative meta-analysis results"
author: "Amanida R package"
date: "r format(Sys.time(), '%d %B, %Y')
"
output:
html_document:
toc: true
toc_float: true
theme: lumen
params:
file_name: input_file
separator: ";"
analysis_type: "quan"
column_id: coln
pvalue_cutoff: 0.05
fc_cutoff: 4
votecount_lim: 1
comp_inf: F
show_code: FALSE
set.seed(123) knitr::opts_chunk$set(echo = TRUE) library(knitr) library(kableExtra, include.only = c('kbl', 'kable_styling', 'scroll_box', 'footnote')) library(amanida)
Data is loaded using amanida_read
function:
coln = c("Compound Name", "P-value", "Fold-change", "N total", "References") input_file <- system.file("extdata", "dataset2.csv", package = "amanida") datafile <- amanida_read(input_file, mode = "quan", coln, separator=";")
Your data:
datafile <- amanida_read(params$file_name, params$analysis_type, params$column_id, params$separator)
Here is shown the imported table:
data_imp <- datafile |> mutate(foldchange = round(foldchange,2), pvalue = format(pvalue, scientific = T, digits = 3), trend = case_when(trend == -1 ~ "Down-regulated", T ~ "Up-regulated")) |> rename("ID" = id, "P-value" = pvalue, "Fold-Change" = foldchange, "Number of participants" = N, "Reference" = ref, "Behaviour" = trend) kbl(data_imp, booktabs = T, caption = "Table 1: Data exploration", align = "c") |> kable_styling(latex_options = c("basic", "scale_down")) |> scroll_box(width = "100%", height = "400px")
Before the meta-analysis the IDs can be checked using public databases information. The IDs in format chemical name, InChI, InChIKey, and SMILES are searched in PubChem to transform all into a common nomenclature. If comp_inf = T:
if(params$comp_inf == T) { datafile <- check_names(datafile) }
Quantitative analysis is done for each different identifier. It combines the statistical significance and the effect size reported on the different studies, as follows:
compute_amanida
function is used to combine p-values and fold-change.
amanida_result <- compute_amanida(datafile, comp.inf = params$comp_inf)
Here are shown your results:
amanida_result@stat
kbl(amanida_result@stat |> arrange(pval) |> group_by(id) |> mutate(id = case_when((trend == 1 & fc > params$fc_cutoff & pval < params$pvalue_cutoff) ~ paste(id, "*"), (trend == -1 & fc < (1/params$fc_cutoff) & pval < params$pvalue_cutoff) ~ paste(id, "*"), T ~ id)) |> ungroup() |> mutate(pval = format(pval, scientific = T, digits = 3), fc = round(fc, 2)) |> rename("ID" = id, "Trend" = trend, "P-value combined" = pval, "Fold-change combined" = fc, "Total sample size" = N_total), booktabs = T, caption = "Table 2: Quantitative analysis", align = "c") |> kable_styling(latex_options = c("basic", "scale_down")) |> scroll_box(width = "100%", height = "400px") |> footnote(symbol = c("Value over cut-offs"))
Note: * indicates the result is statistical significant
sig_res <- amanida_result@stat |> filter(pval < params$pvalue_cutoff, fc > params$fc_cutoff | fc < 1/params$fc_cutoff)
The cut-off selected by the user for significant results are:
r params$pvalue_cutoff
.r params$fc_cutoff
for up-regulated and r round(1/params$fc_cutoff, 2)
for down-regulated.Using indicated cut-offs there are r nrow(sig_res)
compounds significant, r sum(sig_res$trend == 1)
up-regulated and r sum(sig_res$trend == -1)
down-regulated compounds.
To see graphically the results obtained is used volcano_plot
:
With r params$file_name
and a p-value cut-off of r params$pvalue_cutoff
and fold-change cut-off of r params$fc_cutoff
(up-regulated) or r round(1/params$fc_cutoff, 2)
(down-regulated):
volcano_plot(amanida_result, cutoff = c(params$pvalue_cutoff, params$fc_cutoff))
Note: labeled compounds are the ones found significant for the cut-off indicated
Discrepancies on the results obtained are evaluated comparing the number of articles where an element is found up-regulated and down-regulated. It is also ploted the total results, as vote-counting, obtained by the difference between up-regulated and down-regulated number of reports.
Here, the explore_plot will only display the relevant identifiers (elements bigger than number of votes specified) or those with discrepancies between studies.
As dataset is big, on the following plot will be only displayed elements bigger than r params$votecount_lim
votes and the elements with discrepancies between studies:
amanida::explore_plot(datafile, type = "mix", params$votecount_lim)
Note: Plots are limited to 30 compounds for readability, for complete plot download from ubidi.shinyapps.io/easy-amanida
It is important to check if our significant compounds have discrepancies on the reports.
Qualitative analysis using Amanida R package
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.