Title: | Meta-Analysis for Non-Integral Data |
Version: | 0.3.0 |
Description: | Combination of results for meta-analysis using significance and effect size only. P-values and fold-change are combined to obtain a global significance on each metabolite. Produces a volcano plot summarising the relevant results from meta-analysis. Vote-counting reports for metabolites. And explore plot to detect discrepancies between studies at a first glance. Methodology is described in the Llambrich et al. (2021) <doi:10.1093/bioinformatics/btab591>. |
License: | GPL-3 |
URL: | https://github.com/mariallr/amanida |
Depends: | R (≥ 4.1) |
Imports: | dplyr (≥ 1.0.0), ggplot2 (≥ 3.3.0), ggrepel (≥ 0.9.0), kableExtra (≥ 1.3.0), knitr (≥ 1.45), magrittr (≥ 1.5), methods (≥ 3.6.0), readr (≥ 1.0.0), readxl (≥ 1.0.0), rmarkdown (≥ 2.25), stats (≥ 3.6.0), tibble (≥ 3.0.0), tidyr (≥ 1.1.0), tidyverse (≥ 1.3.0), webchem (≥ 1.1.0) |
Suggests: | markdown, metaboliteIDmapping, testthat, vdiffr |
VignetteBuilder: | knitr |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.2.2 |
NeedsCompilation: | no |
Packaged: | 2024-01-26 08:43:38 UTC; maria |
Author: | Maria Llambrich |
Maintainer: | Maria Llambrich <maria.llambrich@urv.cat> |
Repository: | CRAN |
Date/Publication: | 2024-01-26 11:50:02 UTC |
amanida
Description
amanida: A package for Meta-Analysis with non-integral data
Author(s)
Maria Llambrich, Eudald Correig and Raquel Cumeras
Results combination for meta-analysis using only significance and effect size.
P-values and fold-change are combined to obtain a global significance on each metabolite.
Produces a volcano plot summarizing the relevant results from meta-analysis.
Qualitative meta-analysis for metabolites
Graphical representation of qualitative analysis by bar plot
Trend explore plot to detect discrepancies between studies at a first glance
See Also
Useful links:
An S4 class to return results from compute_amanida
or amanida_vote
function
Description
An S4 class to return results from compute_amanida
or amanida_vote
function
Slots
stat
results for statistics combining p-values and fold-changes
vote
vote-counting for metabolites
Get nice colour-blind colours
Description
Get nice colour-blind colours
Usage
amanida_palette()
Value
vector of colours
Import data
Description
amanida_read
imports the data and formats for compute_amanida
or amanida_vote
functions
Usage
amanida_read(file, mode, coln, separator = NULL)
Arguments
file |
path to file |
mode |
indicate if data will be quantitative or qualitative. Options are:
|
coln |
columns names to use. It has to be in order identification, p-values, fold-changes, sample size and reference. |
separator |
the separator used on file |
Details
Note that amanida_read
skips rows with missing values or NA. Negatives values for fold-change are transformed to positive (1/value).
Formats compatible are csv, xlsx, xls or txt.
Value
tibble table with data imported
Examples
coln <- c("Compound Name", "P-value", "Fold-change", "N total", "References")
input_file <- getsampleDB()
datafile <- amanida_read(input_file, mode = "quan", coln, separator=";")
Report
Description
amanida_report
creates a report from the data using amanida functions
Usage
amanida_report(
input_file,
separator = NULL,
analysis_type = NULL,
column_id,
pvalue_cutoff = NULL,
fc_cutoff = NULL,
votecount_lim,
path = NULL,
comp_inf = NULL
)
Arguments
input_file |
path to the original dataset in xlsx, xls, csv or txt format |
separator |
indicate the separator used in the input_file parameter |
analysis_type |
indicate if data will be quantitative, qualitative or both. Options are:
|
column_id |
vector containing columns names to use. It has to be in order identification, p-values, fold-changes, sample size and reference. |
pvalue_cutoff |
numeric value to consider statistical significance |
fc_cutoff |
numeric value to consider significance for effect size |
votecount_lim |
minimum numeric value for vote-counting visualization |
path |
path to the directory where html file is created, otherwise the file will be saved in a temporal folder |
comp_inf |
name checking using information from public databases |
Details
This function uses directly the dataset to create a report with the meta-analysis results. In case of quantitative analysis amanida_report
uses the functions amanida_read
and compute_amanida
for analyse the input data. Then the results are showed using volcano_plot
, explore_plot
and vote_plot
.
Value
an html document saved in the working directory
Examples
## Not run:
column_id = c("Compound Name", "P-value", "Fold-change", "N total", "References")
input_file <- getsampleDB()
amanida_report(input_file, separator = ";", column_id, analysis_type = "quan",
pvalue_cutoff = 0.05, fc_cutoff = 4, votecount_lim = 2,
comp_inf = F)
## End(Not run)
Qualitative meta-analysis
Description
amanida_vote
performs vote-counting on qualitative data.
Usage
amanida_vote(data)
Arguments
data |
data imported using |
Details
Vote-counting is computed without trend division. Punctuation of entries is based on trend, up-regulation gives 1, down-regulation give -1 and equal behavior gives 0. Total sum is divided then by the total number of entries on each compound. Compound combination is made with PubChem CID when is available.
Note that amanida_vote
skips rows with missing values or NA.
Formats compatible are csv, xlsx, xls or txt.
Value
METAtable S4 object with vote-counting for each compound on @slot vote
Examples
## Not run:
coln = c("Compound Name", "Behaviour", "References")
input_file <- system.file("extdata", "dataset2.csv", package = "amanida")
data_votes <- amanida_read(input_file, mode = "qual", coln, separator = ";")
vote_result <- amanida_vote(data_votes)
## End(Not run)
Amanida harmonization
Description
check_names
check the names to harmonize them to a common nomenclature. Valid names are:
chemical name, InChI, InChIKey and SMILES.
Usage
check_names(data)
Arguments
data |
data imported using |
Details
Note that check_names
depends on webchem
package and it slows down the process.
Formats compatible are amanida_read
output
Value
tibble table with data imported with PubChem ID retrieved
Examples
## Not run:
coln <- c("Compound Name", "P-value", "Fold-change", "N total", "References")
input_file <- getsampleDB()
datafile <- amanida_read(input_file, mode = "quan", coln, separator=";")
data_checked <- check_names(datafile)
## End(Not run)
Combine statistical results and compute vote-counting
Description
compute_amanida
Combines for the same entry or metabolite the statistical values of p-value and fold-change. Also is computed a vote-counting for each compound. Compound combination is made with PubChem CID when is available.
Usage
compute_amanida(datafile, comp.inf = F)
Arguments
datafile |
data imported using |
comp.inf |
include compounds IDs from PubChem, InChIKey, SMILES, KEGG, ChEBI, HMDB, Drugbank, Molecular Mass and Molecular Formula |
Details
Entries corresponding to metabolites are combined as follows:
P-values are combined using Fisher method weighted by N and gamma distribution
Fold-change are combined by weighted mean. Transformation works with fold-change transformed to log scale with base 2.
Vote-counting is computed based on votes. Punctuation of entries is based on trend, up-regulation gives 1, down-regulation give -1 and equal behavior gives 0. Total sum is divided then by the total number of entries on each compound.
Value
METAtable S4 object with p-value combined, fold-change combined and vote-counting for each compound
Examples
## Not run:
data("sample_data")
compute_amanida(sample_data)
## End(Not run)
Plot for compounds divergence in reports
Description
explore_plot
creates a bar-plot showing the votes divided in up-regulated and down-regulated and the global result for each compound.
Usage
explore_plot(data, type = "all", counts = NULL)
Arguments
data |
an tibble obtained by |
type |
select the subset of data to plot. Options are:
|
counts |
value of vote-counting cut-off. Will be only displayed data over the cut-off. |
Details
Sum of votes divided by trend are plotted, then is obtained the total result by compound summing both trends.
Value
a ggplot bar-plot showing the sum of votes for each compound divided by the trend
Examples
data("sample_data")
explore_plot(sample_data, type = "mix", counts = 1)
Function to sample data path
Description
Function to sample data path
Usage
getsampleDB()
Example input data for the amanida function
Description
A dataset containing results from meta-analysis of metabolomic studies
Usage
sample_data
Format
A data frame with 143 rows and 6 variables:
- id
Name of the compound under study
- pvalue
P-value
- foldchange
Fold-change
- N
Number of samples of the compound
- ref
References
- trend
Trend: 1 (up), -1 (down) or 0 (none)
Volcano plot of combined results
Description
volcano_plot
returns a volcano plot of the combined results on each metabolite obtained by compute_amanida
function
Usage
volcano_plot(mets, cutoff = NULL)
Arguments
mets |
an S4 METAtables object |
cutoff |
values for p-value and fold-change significance |
Details
Results are presented as -log10 for p-value and log2 for fold-change. Values over the cut off are labeled. If not cutoff is provided will be used alpha 0.05 for p-value and 1.5 for logarithmic fold-change.
Value
plot of results
Examples
## Not run:
data("sample_data")
amanida_result <- compute_amanida(sample_data)
volcano_plot(amanida_result)
## End(Not run)
Bar-plot for compounds vote-counting
Description
vote_plot
creates a bar-plot showing the vote-count for each compound.
Usage
vote_plot(mets, counts = NULL)
Arguments
mets |
an S4 METAtables object obtained by |
counts |
value of vote-counting cut-off. Will be only displayed data over the cut-off. |
Details
Vote-couting is the sum of number of reports up-regulated and the substraction of reports down-regulated.
Value
a ggplot bar-plot showing the vote-count per compound
Examples
## Not run:
data("sample_data")
result <- compute_amanida(sample_data)
vote_plot(result)
## End(Not run)