feature-plotting: Plotting of grouped features

feature-plottingR Documentation

Plotting of grouped features

Description

Various plotting functions for feature group data.

Usage

## S4 method for signature 'featureGroups,missing'
plot(
  x,
  colourBy = c("none", "rGroups", "fGroups"),
  onlyUnique = FALSE,
  retMin = FALSE,
  showLegend = TRUE,
  col = NULL,
  pch = NULL,
  ...
)

## S4 method for signature 'featureGroups'
plotInt(
  obj,
  average = FALSE,
  normalized = FALSE,
  xnames = TRUE,
  showLegend = FALSE,
  pch = 20,
  type = "b",
  lty = 3,
  col = NULL,
  plotArgs = NULL,
  linesArgs = NULL
)

## S4 method for signature 'featureGroupsSet'
plotInt(
  obj,
  average = FALSE,
  normalized = FALSE,
  xnames = !sets,
  showLegend = sets,
  pch = 20,
  type = "b",
  lty = 3,
  col = NULL,
  plotArgs = NULL,
  linesArgs = NULL,
  sets = FALSE
)

## S4 method for signature 'featureGroups'
plotChord(
  obj,
  addSelfLinks = FALSE,
  addRetMzPlots = TRUE,
  average = FALSE,
  outerGroups = NULL,
  addIntraOuterGroupLinks = FALSE,
  ...
)

## S4 method for signature 'featureGroups'
plotChroms(
  obj,
  analysis = analyses(obj),
  groupName = names(obj),
  retMin = FALSE,
  showPeakArea = FALSE,
  showFGroupRect = TRUE,
  title = NULL,
  colourBy = c("none", "rGroups", "fGroups"),
  showLegend = TRUE,
  annotate = c("none", "ret", "mz"),
  intMax = "eic",
  EICParams = getDefEICParams(),
  showProgress = FALSE,
  xlim = NULL,
  ylim = NULL,
  EICs = NULL,
  ...
)

## S4 method for signature 'featureGroups'
plotVenn(obj, which = NULL, ...)

## S4 method for signature 'featureGroupsSet'
plotVenn(obj, which = NULL, ..., sets = FALSE)

## S4 method for signature 'featureGroups'
plotUpSet(obj, which = NULL, nsets = length(which), nintersects = NA, ...)

## S4 method for signature 'featureGroups'
plotVolcano(
  obj,
  FCParams,
  showLegend = TRUE,
  averageFunc = mean,
  normalized = FALSE,
  col = NULL,
  pch = 19,
  ...
)

## S4 method for signature 'featureGroups'
plotGraph(obj, onlyPresent = TRUE, width = NULL, height = NULL)

## S4 method for signature 'featureGroupsSet'
plotGraph(obj, onlyPresent = TRUE, set, ...)

Arguments

colourBy

Sets the automatic colour selection: "none" for a single colour or "rGroups"/"fGroups" for a distinct colour per replicate/feature group.

onlyUnique

If TRUE and colourBy="rGroups" then only feature groups that are unique to a replicate group are plotted.

retMin

Plot retention time in minutes (instead of seconds).

showLegend

Plot a legend if TRUE.

col

Colour(s) used. If col=NULL then colours are automatically generated.

pch, type, lty

Common plotting parameters passed to e.g. plot. For plot: if pch=NULL then values are automatically assigned.

...

passed to plot (plot and plotChroms), VennDiagram plotting functions (plotVenn), chordDiagram (plotChord) or upset (plotUpSet).

obj, x

featureGroups object to be used for plotting.

average

If TRUE then data within replicate groups are averaged.

For as.data.table: if features=TRUE other feature properties are also averaged.

xnames

Plot analysis (or replicate group if average=TRUE) names on the x axis.

plotArgs, linesArgs

A list with further arguments passed to plot and lines, respectively.

sets \setsWF

For plotInt: if TRUE then feature intensities are plot per set (order follows the analysis information).

For plotVenn: If TRUE then the which argument changes its meaning and is used to specify the names of the sets to be compared.

addSelfLinks

If TRUE then 'self-links' are added which represent non-shared data.

addRetMzPlots

Set to TRUE to enable m/z vs retention time scatter plots.

outerGroups

Character vector of names to be used as outer groups. The values in the specified vector should be named by analysis names (average set to FALSE) or replicate group names (average set to TRUE), for instance: c(analysis1 = "group1", analysis2 = "group1", analysis3 = "group2"). Set to NULL to disable outer groups.

addIntraOuterGroupLinks

If TRUE then links will be added within outer groups.

analysis, groupName

character vector with the analyses/group names to be considered for plotting. Compared to subsetting the featureGroups object (obj) upfront this is slightly faster and (if onlyPresent=FALSE) allows plotting chromatograms for feature groups where none of the specified analyses contain the feature (which is impossible otherwise since subsetting leads to removal of 'empty' feature groups).

showPeakArea

Set to TRUE to display integrated chromatographic peak ranges by filling (shading) their areas.

showFGroupRect

Set to TRUE to mark the full retention/intensity range of all features within a feature group by drawing a rectangle around it.

title

Character string used for title of the plot. If NULL a title will be automatically generated.

annotate

If set to "ret" and/or "mz" then retention and/or m/z values will be drawn for each plotted feature group.

intMax

Method used to determine the maximum intensity plot limit. Should be "eic" (from EIC data) or "feature" (from feature data). Ignored if the ylim parameter is specified.

EICParams

A named list with parameters used for extracted ion chromatogram (EIC) creation. See the EIC parameters documentation for more details.

showProgress

if set to TRUE then a text progressbar will be displayed when all EICs are being plot. Set to "none" to disable any annotation.

xlim, ylim

Sets the plot size limits used by plot. Set to NULL for automatic plot sizing.

EICs

Internal parameter for now and should be kept at NULL (default).

which

A character vector with replicate groups used for comparison. Set to NULL to ignore.

For plotVenn: alternatively a named list containing elements of character vectors with replicate groups to compare. For instance, which=list(infl = c("influent-A", "influent-B"), effl = c("effluent-A", "effluent-B")), will compare the features in replicate groups ‘⁠"influent-A/B"⁠’ against those in ‘⁠"effluent-A/B"⁠’. The names of the list are used for labelling in the plot, and will be made automatically if not specified.

nsets, nintersects

See upset.

FCParams

A parameter list to calculate Fold change data. See getFCParams for more details.

averageFunc, normalized

Used for intensity data treatment, see the documentation for the as.data.table method.

onlyPresent

Only plot feature groups of internal standards that are still present in the featureGroups input object (which may be otherwise be removed by e.g. subsetting or filter).

width, height

Passed to visNetwork.

set \setsWF

The set for which data must be plotted.

Details

plot Generates an m/z vs retention time plot for all featue groups. Optionally highlights unique/overlapping presence amongst replicate groups.

plotInt Generates a line plot for the (averaged) intensity of feature groups within all analyses

plotChord Generates a chord diagram which can be used to visualize shared presence of feature groups between analyses or replicate groups. In addition, analyses/replicates sharing similar properties (e.g. location, age, type) may be grouped to enhance visualization between these 'outer groups'.

plotChroms Plots extracted ion chromatograms (EICs) of feature groups.

plotVenn plots a Venn diagram (using VennDiagram) outlining unique and shared feature groups between up to five replicate groups.

plotUpSet plots an UpSet diagram (using the upset function) outlining unique and shared feature groups between given replicate groups.

plotVolcano Plots Fold change data in a 'Volcano plot'.

plotGraph generates an interactive network plot which is used to explore internal standard (IS) assignments to each feature group. This requires the availability of IS assignments, see the documentation for normInts for details. The graph is rendered with visNetwork.

Value

plotVenn (invisibly) returns a list with the following fields:

  • gList the gList object that was returned by the utilized VennDiagram plotting function.

  • areas The total area for each plotted group.

  • intersectionCounts The number of intersections between groups.

The order for the areas and intersectionCounts fields is the same as the parameter order from the used plotting function (see e.g. draw.pairwise.venn and draw.triple.venn).

plotGraph returns the result of visNetwork.

Sets workflows

\setsWFChangedMethods \item

plotVenn and plotInt allow to handle data per set. See the sets argument description.

\item

plotGraph only plots data per set, and requires the set argument to be set.

References

\addCitations

circlize1

\insertRef

Conway2017patRoon

\insertRefLex2014patRoon

See Also

featureGroups-class, groupFeatures


rickhelmus/patRoon documentation built on April 25, 2024, 8:15 a.m.