PlotSourceContribution: PlotSourceContribution

Description Usage Arguments Examples

View source: R/utils_plot.R

Description

Save a stacked barplot of source contributions to a group of pre-defined sink samples, sharing the same sources.

Usage

1
2
PlotSourceContribution(SinkNames, SourceNames, Same_sources_flag,
  mixing_proportions, dir_path, Plot_title = "Example", N)

Arguments

SinkNames

A vector with the sink names to plot.

SourceNames

A vector with all the sources' names.

Same_sources_flag

A boolian value indicating the source-sink plotting assignment. Same_sources_flag = 1 if the same sources are assigned to the pre-defined sink samples , otherwise = 0.

mixing_proportions

A list of vectors, where entry i corresponds to the vector of source contributions (summing to 1) to sink i.

dir_path

A path to an output .png file.

Plot_title

Plot's title and output .png file's name.

N

Number of barplot in each output .png file.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
#Load metadata table

#Load count matrix

#Calculate the sources' contributions to
#each sink sample in the data
FEAST_output <- FEAST(count_matrix = otus, metadata = metadata,
                     different_sources_flag = 1)

#Plot and save a stacked barplot of source contributions
#to the first four sink samples
PlotSourceContribution(SinkNames, SourceNames, Same_sources_flag,
                      mixing_proportions, dir_path, Plot_title = "Example",N)

wsteenhu/FEAST documentation built on Jan. 14, 2022, 6:06 a.m.