% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/compare_dynamics.R
\name{compare_dynamics}
\alias{compare_dynamics}
\title{Comparison of metabolite dynamics clusters under different experimental conditions}
\usage{
compare_dynamics(
  data,
  dynamics = metadata(data)[["cluster"]][[1]]$dynamics,
  cores = 4
)
}
\arguments{
\item{data}{a dataframe or containing a column specifying the metabolite
names to be compared and cluster IDs (column named "cluster") of
clusters of similar dynamics, as well as a column "condition" specifying
the experimental conditions.
to be compared or a \link[SummarizedExperiment]{SummarizedExperiment} storing the same information in
metadata(data) under "cluster"}

\item{dynamics}{vector specifying the column names of dataframe clusters
that hold the dynamics information}

\item{cores}{how many cores should be used for model fitting; this
parallelizes the model fitting and therefore speeds it up; default=4}
}
\value{
a list holding a 1) the model fit
2) dataframe of estimates of the mean distance
between #' clusters of different experimental conditions ("mean") and the
standard deviation ("sigma"). If data input
was a SummarizedExperiment results are stored in metadata(data) under
"comparison_dynamics"
}
\description{
Employs a Bayesian model that assumes a normal distribution of Euclidean
distances between dynamics vectors (metabolite abundances at different
time points) of two clusters that come from different
experimental conditions to estimate the mean distance between clusters.
}
\examples{
data("longitudinalMetabolomics")
longitudinalMetabolomics <- compare_dynamics(
  data = longitudinalMetabolomics,
  dynamics = c("1", "2", "3", "4"),
  cores = 1
)
S4Vectors::metadata(longitudinalMetabolomics)[["comparison_dynamics"]]
}
\seealso{
Visualization of estimates \code{\link[=heatmap_dynamics]{heatmap_dynamics()}}/
compare metabolite composition of clusters \code{\link[=compare_metabolites]{compare_metabolites()}}
}
