Package 'amanida'

Title: Meta-Analysis for Non-Integral Data
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>.
Authors: Maria Llambrich [aut, cre] , Eudald Correig [aut], Raquel Cumeras [aut]
Maintainer: Maria Llambrich <[email protected]>
License: GPL-3
Version: 0.3.0
Built: 2024-11-21 04:22:16 UTC
Source: https://github.com/mariallr/amanida

Help Index


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:


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:

  • "quan" for quantitative meta-analysis using p-value and fold-change

  • "qual" for qualitative meta-analysis using trend label

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:

  • "quan-qual" for quantitative and qualitative meta-analysis

  • "quan" for quantitative meta-analysis using p-value and fold-change

  • "qual" for qualitative meta-analysis using trend label

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 amanida_read function w/o names checked by check_names

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 amanida_read function

Details

Note that check_names depends on webchempackage 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 amanida_read function w/o names checked by check_names

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 amanida_read w/o names checked by check_names

type

select the subset of data to plot. Options are:

  • "all": all data will be displayed

  • "sub": only data over counts value will be displayed. Need counts value.

  • "mix": will display data over count value and elements with reports in both trends.Need counts value.

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()

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


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 compute_amanida or amanida_vote.

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)