Package: emcAdr 1.2

Jules Bangard

emcAdr: Evolutionary Version of the Metropolis-Hastings Algorithm

Provides computational methods for detecting adverse high-order drug interactions from individual case safety reports using statistical techniques, allowing the exploration of higher-order interactions among drug cocktails.

Authors:Jules Bangard [aut, cre]

emcAdr_1.2.tar.gz
emcAdr_1.2.tar.gz(r-4.5-noble)emcAdr_1.2.tar.gz(r-4.4-noble)
emcAdr_1.2.tgz(r-4.4-emscripten)emcAdr_1.2.tgz(r-4.3-emscripten)
emcAdr.pdf |emcAdr.html
emcAdr/json (API)

# Install 'emcAdr' in R:
install.packages('emcAdr', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org'))
Uses libs:
  • c++– GNU Standard C++ Library v3
  • openmp– GCC OpenMP (GOMP) support library
Datasets:

On CRAN:

Conda:

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

cppopenmp

2.70 score 28 exports 47 dependencies

Last updated 17 days agofrom:66dab59011. Checks:1 ERROR, 1 OK. Indexed: yes.

TargetResultLatest binary
Doc / VignettesFAILFeb 27 2025
R-4.5-linux-x86_64OKFeb 27 2025

Exports:ATCtoNumericcalculate_divergenceclustering_genetic_algorithmcompute_hypergeom_on_listcompute_RR_on_listcomputeMetrics_size2csv_to_populationDistributionApproximationGeneticAlgorithmget_dissimilarity_from_cocktail_listget_dissimilarity_from_genetic_resultsget_dissimilarity_from_txt_filehclust_genetic_solutionhistogramToDitributionhyperparam_test_genetic_algorithmint_cocktail_to_string_cocktailOutsandingScoreToDistributionp_value_cocktailsp_value_csv_filep_value_genetic_resultsp_value_on_sampledplot_evolutionplot_frequencyprint_csvqq_plot_outputstring_list_to_int_cocktailstrueDistributionDrugstrueDistributionSizeTwoCocktail

Dependencies:askpassclicolorspacedbscandplyrfansifarvergenericsggplot2gluegtablehereisobandjsonlitelabelinglatticelifecyclemagrittrMASSMatrixmgcvmunsellnlmeopensslpillarpkgconfigpngR6rappdirsRColorBrewerRcppRcppArmadilloRcppEigenRcppTOMLreticulaterlangrprojrootRSpectrascalessystibbletidyselectumaputf8vctrsviridisLitewithr

emcAdr : Evolutionary Markov Chain for Adverse Drug Reaction

Rendered frombase.Rmdusingknitr::rmarkdownon Feb 27 2025.

Last update: 2025-02-27
Started: 2025-02-27

Readme and manuals

Help Manual

Help pageTopics
Evolutionary Version of the Metropolis-Hastings AlgorithmemcAdr-package emcAdr
ATC Tree Upper Bound 2024ATC_Tree_UpperBound_2024
Convert ATC Code for each patients to the corresponding DFS number of the ATC treeATCtoNumeric
Calculate the divergence between 2 distributions (the true Distribution and the learned one)calculate_divergence
Clustering of the solutions of the genetic algorithm using the hclust algorithmclustering_genetic_algorithm
Function used to compute the Hypergeometric score on a list of cocktailscompute_hypergeom_on_list
Function used to compute the Relative Risk on a list of cocktailscompute_RR_on_list
Function used in the reference article to compare diverse Disproportionality Analysis metricscomputeMetrics_size2
Function used to convert your genetic algorithm results that are stored into a .csv file to a Data structure that can be used by the clustering algorithmcsv_to_population
The MCMC method that runs the random walk on a single cocktail in order to estimate the distribution of score among cocktails of size Smax.DistributionApproximation
FAERS Myopathy DatasetFAERS_myopathy
Genetic algorithm, trying to reach riskiest cocktails (the ones which maximize the fitness function, Hypergeometric score in our case)GeneticAlgorithm
Recover the square matrix of distance between cocktails where the index (i,j) of the matrix is the distance between cocktails i and j in an arbitrary cocktail listget_dissimilarity_from_cocktail_list
Recover the square matrix of distance between cocktails where the index (i,j) of the matrix is the distance between cocktails i and j in the genetic_results list.get_dissimilarity_from_genetic_results
Recover the square matrix of distance between cocktails where the index (i,j) of the matrix is the distance between cocktails i and j in the csv file containing results of genetic algorithmget_dissimilarity_from_txt_file
Clustering of the solutions of the genetic algorithm using the hclust algorithmhclust_genetic_solution
Convert the histogram returned by the DistributionApproximation function, to a real number distribution (that can be used in a test for example)histogramToDitribution
This function can be used in order to try different set of parameters for the genetic algorithm in a convenient way. This will run each combination of mutation_rate, nb_elite and alphas possible nb_test_desired times. For each sets of parameters, results will be saved in a file named according to the set of parameter. One can regroup the results of each run in a csv file by using the print_csv function specifying the names of each file that needs to be treated and the number of performed runs on each parameter sethyperparam_test_genetic_algorithm
Function used to convert integer cocktails (like the one outputed by the distributionApproximation function) to string cocktail in order to make them more readableint_cocktail_to_string_cocktail
Output the outstanding score (Outstanding_score) outputed by the MCMC algorithm in a special formatOutsandingScoreToDistribution
Used to add the p_value to each cocktail of cocktail listp_value_cocktails
Used to add the p_value to each cocktail of a csv_file that is an output of the genetic algorithmp_value_csv_file
Used to add the p_value to each cocktail of an output of the genetic algorithmp_value_genetic_results
Calculate p-value of sampled valuep_value_on_sampled
Plot the evolution of the mean and the best value of the population used by the GeneticAlgorithmplot_evolution
Plot the histogram of the approximation of the RR distributionplot_frequency
Print every cocktails found during the genetic algorithm when used with the hyperparam_test_genetic_algorithm function. This enables to condense the solutions found in each files by collapsing similar cocktail in a single row by cocktail.print_csv
Make a Quantile-Quantile diagram from the output of the MCMC algorithm (DistributionAproximation) and the algorithm that exhaustively calculates the distributionqq_plot_output
Function used to convert a string vector of drugs in form "drug1:drug2" to a vector of index of the ATC tree ex: c(ATC_index(drug1), ATC_index(drugs2))string_list_to_int_cocktails
The true distribution of the score among every single nodes of the ATCtrueDistributionDrugs
The true distribution of the score among every size-two cocktailstrueDistributionSizeTwoCocktail