This vignette illustrates `Amanida`

R package, which contains a collection of functions for computing a weighted meta-analysis in R using significance, relative change and study size. It explains how to conduct the meta-analysis, visualize the results and draw conclusions.

The widespread of metabolomics as a potential tool for clinical diagno-sis has increased the systematic reviews and meta-analysis on this topic. Meta-analysis is the statistical combination in a single estimate for results from primary studies answering the same question, which is a common practice in medical research. When raw data is not available to perform a meta-analysis, there are different approaches that can be applied but them require the standard deviation, that is used for effect size estimate calculation and weighted methods. Nowadays, there isn’t a tool to perform a weighted meta-analysis which could be applied to a dataset of overall results without the standard deviation. Meta-analysis tools base the study of effect size using the difference of means, but in case of metabolomics we found that the comparison between groups is disclosed using relative change. The purpose of amanida is to perform a weighted meta-analysis combining overall results based on statistical significance, relative change and study size. In Amanida, statistical significance and relative change are combined using weighted methods which do no require standard deviation, weighted Fisher for p-values and weighted average for fold-change, where the weight comes from study size.

Furthermore, Amanida also computes qualitative meta-analysis performing a vote-counting for compounds, including the option of only using identifier and trend labels.

`Amanida`

can be installed from `CRAN`

repository, by:

```
install.packages("amanida")
```

Then loaded by:

```
library(amanida)
```

Here we show how to conduct a meta-analysis using Amanida approach. We are using a dataset obtained in systematic review and meta-analysis: *Comprehensive Volatilome and Metabolome Signatures of Colorectal Cancer in Urine: A Systematic Review and Meta-Analysis* Mallafré et al. Cancers 2021, 13(11), 2534; https://doi.org/10.3390/cancers13112534.

Before using `Amanida`

is important the curation of the identifiers. The objective of a meta-analysis is to combine the different results of a same feature, therefore, it is important that all identifiers are in the same format.

Dataset to analyse must include the following columns: identifier, p-value, fold-change, study size (N) and reference.

Once we have the dataset in a supported format (xls/xlsx, csv or txt), we import as follows:

```
coln = c("Compound Name", "P-value", "Fold-change", "N total", "References")
input_file <- getsampleDB()
datafile <- amanida_read(input_file, mode = "quan", coln, separator=";")
#> Loaded dataset with 143 rows which contains 120 different identifiers. There are 18 rows skipped from original dataset because contained NA values.
```

It creates a tibble which contain the data needed to perform the amanida meta-analysis.
**Note**: missing data is ignored and negative values of fold-change are transformed to positive (1/value).

In this step will be performed the combination of overall results weightening by study size. Methods for combine results are:

P-value: weighted p-values combination, which is a variant of Fisher’s method. A gamma distribution is used to assign non-integral weights proportional to study size to each p-value.

Fold-change: logarithmic transformation (base 2) and then averaged with weighting by study size.

**Note**: Only with the object created by `amanida_read`

function in `mode = "quan"`

are able to compute the amanida meta-analysis.

It is also included a qualitative analysis, the vote-counting, that is computed by the sum of votes assigned as follows: votes are +1 for up-regulation, -1 for down-regulation and 0 if no trend.

```
amanida_result <- compute_amanida(datafile)
```

Combination results are disclosed in two tables

- meta-analysis results acces by
`amanida_result@stat`

- vote-counting results acces by
`amanida_results@vote`

Amanida meta-analysis gives the combination for p-value and fold-change for each feature.

Trend variable correspond to the direrction of the combination, 1 means that the feature is increased in case group and -1 the opposite. N_total is the sum of the study sizes for that feature, which are disclosed in reference variable.

```
head(amanida_result@stat)
#> # A tibble: 6 x 6
#> id trend pval fc N_total reference
#> <chr> <dbl> <dbl> <dbl> <int> <chr>
#> 1 1,1,6-Trimethyl-1,2-dihydron… -1 0.000391 0.224 60 [29] Porto-Figueir…
#> 2 1,3-Dithiane 1 0.0189 3.43 60 [29] Porto-Figueir…
#> 3 1,5,5-Trimethyl-6-methylene-… -1 0.0342 0.596 60 [29] Porto-Figueir…
#> 4 1,6,7-Trimethylnaphthalene -1 0.000194 0.320 60 [29] Porto-Figueir…
#> 5 2,2,6-Trimethylcyclohexanone -1 0.0298 0.348 60 [29] Porto-Figueir…
#> 6 2,3-Butanediol -1 0.000091 0.271 135 [43] Liesenfeld 20…
```

To observe the results of meta-analysis graphically is done with a volcano plot, where the log10(p-values) are plotted against the log2(fold-change). The cut-offs can be selected by the user, in case of fold-change we recommend values higher than 2, where it is considered to have biological meaningfulness.

**Note**: cut-off have to be indicated without log scale.

```
volcano_plot(amanida_result, cutoff = c(0.05,3.5))
#> The cut-off used are 0.05 for p-value (1.3 in log10 scale) and 3.5 for fold-change (1.81 in log2 scale).
```

We will consider that a feature have statistical significance if it is over the cut-offs threshold (dashed lines).

Optionally we van observe the qualitative results. A bar plot shows the result of vote-counting.

**Note:** output is restricted to 30 compounds to facilitate the readability. To visualize less compounds increase `counts`

parameter.

```
vote_plot(amanida_result, counts = 1)
#> Cut-off for votes is 1.
#> Too much values, only showing 30 highest values. Please check counts parameter.
```

With vote plot discrepancies in compounds behaviour are not detected at first glance, and we suggest to combine the results with the explore plot. Discrepancies in results are shown when `type = "mix"`

is used:

- counts parameter: this value indicate the minimum votes to show the results.

**Note:** output is restricted to 25 compounds to facilitate the readability. To visualize less compounds increase `counts`

parameter.

```
explore_plot(sample_data, type = "mix", counts = 1)
#> Cut-off for votes is 1.
```

In sample data we observe some compounds over the cut-off threshold, then we check the consistency of result. In this case, compounds with more than one report and statistical significance are Hippuric acid and Phenol. Both of them have consistency as all reports results are in the same trend. We can conclude that for Hippuric acid and Phenol have evidences to reject the null hypothesis.

**Note**: compounds with both up-regulated and down-regulated tendencies points to low consistency.

All computations and functions discussed above can be obtained straightforward in an html document. From scratch `amanida_report`

computes the meta-analysis and display the results graphically.

It needs the following parameters:

- file: path to the dataset where is the data to import it. It is the original file xlsx, xls, csv or txt.
- separator: symbol used in the dataset to separate the different items, i.e. if you have a csv file you will use separator = “,”.
- analysis_type: parameter to choose which type of meta-analysis perform.
- “quan-qual”: for quantitative and qualitative meta-analysis
- “quan”: for quantitative meta-analysis
- “qual”: for qualitative meta-analysis

- column_id: vector containing the name of columns to select from the original dataset. It has to be in order identification, p-values, fold-changes, sample size and reference.
- pvalue_cutoff: numerical value to indicate the threshold on p-values. Recommended 0.05.
- fc_cutoff: numerical value to indicate the threshold on fold-change. Recommended to use values > 2.
- votecount_lim: numerical value to indicate the threshold for qualitative graphics.

```
column_id = c("Compound Name", "P-value", "Fold-change", "N total", "References")
input_file <- getsampleDB()
amanida_report(input_file,
separator = ";",
analysis_type = "quan-qual",
column_id = column_id,
pvalue_cutoff = 0.05,
fc_cutoff = 4,
votecount_lim = 2)
```

The report will be saved in the working directory.

```
sessionInfo()
#> R version 4.1.0 (2021-05-18)
#> Platform: x86_64-apple-darwin17.0 (64-bit)
#> Running under: macOS Big Sur 10.16
#>
#> Matrix products: default
#> BLAS: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRblas.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib
#>
#> locale:
#> [1] C/es_ES.UTF-8/es_ES.UTF-8/C/es_ES.UTF-8/es_ES.UTF-8
#>
#> attached base packages:
#> [1] stats graphics grDevices utils datasets methods base
#>
#> other attached packages:
#> [1] amanida_0.1.0
#>
#> loaded via a namespace (and not attached):
#> [1] ggrepel_0.9.1 Rcpp_1.0.6 svglite_2.0.0 lubridate_1.7.10
#> [5] tidyr_1.1.3 assertthat_0.2.1 digest_0.6.27 utf8_1.2.1
#> [9] R6_2.5.0 cellranger_1.1.0 backports_1.2.1 reprex_2.0.0
#> [13] evaluate_0.14 httr_1.4.2 ggplot2_3.3.5 highr_0.9
#> [17] pillar_1.6.1 rlang_0.4.11 readxl_1.3.1 rstudioapi_0.13
#> [21] rmarkdown_2.9 labeling_0.4.2 webshot_0.5.2 readr_1.4.0
#> [25] stringr_1.4.0 munsell_0.5.0 broom_0.7.8 compiler_4.1.0
#> [29] modelr_0.1.8 xfun_0.24 pkgconfig_2.0.3 systemfonts_1.0.2
#> [33] htmltools_0.5.1.1 tidyselect_1.1.1 tibble_3.1.2 fansi_0.5.0
#> [37] viridisLite_0.4.0 crayon_1.4.1 dplyr_1.0.7 dbplyr_2.1.1
#> [41] withr_2.4.2 grid_4.1.0 jsonlite_1.7.2 gtable_0.3.0
#> [45] lifecycle_1.0.0 DBI_1.1.1 magrittr_2.0.1 scales_1.1.1
#> [49] cli_3.0.0 stringi_1.6.2 farver_2.1.0 fs_1.5.0
#> [53] tidyverse_1.3.1 xml2_1.3.2 ellipsis_0.3.2 generics_0.1.0
#> [57] vctrs_0.3.8 kableExtra_1.3.4 tools_4.1.0 forcats_0.5.1
#> [61] glue_1.4.2 purrr_0.3.4 hms_1.1.0 colorspace_2.0-2
#> [65] rvest_1.0.0 knitr_1.33 haven_2.4.1
```