View source: R/exportPathway.R
exportPathway | R Documentation |
This function is a wrapper for the pathview package (Luo et al., 2017. Nucleic acids research, 45:W501-W508). It will generate annotated KEGG pathway maps showing which reactions are present in the different samples. It will also generate legends with the color scales for each sample in separate png files.
exportPathway(
SQM,
pathway_id,
count = "copy_number",
samples = NULL,
split_samples = FALSE,
sample_colors = NULL,
log_scale = FALSE,
fold_change_groups = NULL,
fold_change_colors = NULL,
max_scale_value = NULL,
color_bins = 10,
output_dir = ".",
output_suffix = "pathview"
)
SQM |
A SQM, SQMbunch or SQMlite object. |
pathway_id |
character. The five-number KEGG pathway identifier. A list of all pathway identifiers can be found in https://www.genome.jp/kegg/pathway.html. |
count |
character. Either |
samples |
character. An optional vector with the names of the samples to export. If absent, all samples will be exported (default |
split_samples |
logical. Generate a different output file for each sample (default |
sample_colors |
character. An optional vector with the plotting colors for each sample (default |
log_scale |
logical. Use a base 10 logarithmic transformation for the color scale. Will have no effect if |
fold_change_groups |
list. An optional list containing two vectors of samples. If provided, the function will generate a single plot displaying the log2 fold-change between the average abundances of both groups of samples ( log(second group / first group) ) (default |
fold_change_colors |
character. An optional vector with the plotting colors of both groups in the fold-change plot. Will be ignored if |
max_scale_value |
numeric. Maximum value to include in the color scale. By default it is the maximum value in the selected samples (if plotting abundances in samples) or the maximum absolute log2 fold-change (if plotting fold changes) (default |
color_bins |
numeric. Number of bins used to generate the gradient in the color scale (default |
output_dir |
character. Directory in which to write the output files (default |
output_suffix |
character. Suffix to be added to the output files (default |
No return value, but Pathview figures are produced in the current working directory.
plotFunctions
for plotting the most functions taxa of a SQM object.
data(Hadza)
exportPathway(Hadza, "00910", count = 'copy_number',
output_dir = tempdir(),
output_suffix = "nitrogen_metabolism",
sample_colors = c("red", "blue"))
exportPathway(Hadza, "00250", count = 'tpm',
output_dir = tempdir(),
output_suffix = "ala_asp_glu_metabolism_FoldChange",
fold_change_groups = list(c("H1"), c("H12")), max_scale_value=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.