This function generates a metabolic map visualization based on provided metabolite concentrations. The map displays metabolite concentrations using circles with varying size and color, and calculates energy charges and reduction charges.
Usage
met_to_map(
data,
csvsep = ";",
dec = ".",
sheet = 1,
RSD = 1,
groups = NULL,
titles = c(),
met_pfx = "met_",
radius_root = 3,
legend_min = NULL,
legend_max = NULL,
map_template
)
Arguments
- data
A Table file or dataframe object containing two metadata columns on the left, followed by one column for each detected compound. Samples are stored in rows. The two metadata columns are in the following order:
Sample group name (e.g., experimental condition or organism)
Replicate number. If technical replicates were used in addition to biological replicates, assign identical replicate numbers to the technical replicates.
- csvsep
A character, the column separator for input CSV files (default is ";").
- dec
A character, the decimal separator for input CSV, TXT, and TSV files (default is ".").
- sheet
An integer, the sheet number to read for Excel files (default is 1).
- RSD
A numeric value, the relative standard deviation (RSD) threshold (default is 1).
- groups
A list of character vectors or NULL, the groups of samples to compare (default is NULL). The indicated groups must exist in the first column of
data
.- titles
A character vector, the titles for the output figures. If empty (the default), the titles will represent the respective group names.
- met_pfx
A character, the prefix for metabolite circle objects in the SVG map (default is "met_").
- radius_root
(numeric) The base used in root transformation of concentration values to control the size of circles in the map. Default is 3.
- legend_min
A numeric value or NULL, the minimum value for the color and size scale in the legend. If NULL (the default), the legend minimum will be chosen based on the minimum concentration in the dataset.
- legend_max
A numeric value or NULL, the maximum value for the color and size scale in the legend. If NULL (the default), the legend minimum will be chosen based on the maximum concentration in the dataset.
- map_template
(character) The file path of the SVG template (created in InkScape) for the metabolic map.
Examples
if (FALSE) { # \dontrun{
data <- data.frame(Compound = c("A", "B", "C"),
Concentration = c(10, 5, 20),
RSD = c(5, 3, 10))
map_template <- "path/to/template.svg"
suff <- "_example"
create_metabolic_map(data, map_template, suff)
} # }