Perform Bootstrap Sampling on Metabolite Annotations
metabo_bootstrap.Rd
This function performs bootstrap sampling on metabolite annotations, allowing for resampling of molecules with or without associated weights. It generates multiple bootstrap samples for further analysis.
Arguments
- annot_list
A list of character vectors where each vector contains metabolites or molecules for a particular annotation. Each element in the list corresponds to a specific sum formula.
- annot_weights
A list of numeric vectors where each vector contains weights associated with the metabolites in
annot_list
. Must have the same length asannot_list
. If NULL, all metabolites are equally weighted.- n_bootstraps
An integer specifying the number of bootstrap samples to generate.
Value
A list of length n_bootstraps
, where each element is a list of bootstrap samples for each sum formula. Each bootstrap sample is a character vector of sampled metabolites.
Details
This function is used to create multiple bootstrap samples of metabolite annotations by randomly sampling metabolites from each sum formula. If weights are provided, the sampling is performed according to these weights; otherwise, the sampling is uniform.