R: Visualize Proportionality

visualize {propr} | R Documentation

## Visualize Proportionality

### Description

Visualize proportionality and differential proportionality.

### Usage

    ## S4 method for signature 'propr,missing'
    plot(x, y, prompt = TRUE, plotly = FALSE)

    smear(rho, prompt = TRUE, plotly = FALSE)

    dendrogram(rho, prompt = TRUE, plotly = FALSE)

    bucket(rho, group, k, prompt = TRUE, plotly = FALSE)

    prism(rho, k, prompt = TRUE, plotly = FALSE)

    bokeh(rho, k, prompt = TRUE, plotly = FALSE)

    pca(rho, group, prompt = TRUE, plotly = FALSE)

    snapshot(rho, prompt = TRUE, plotly = FALSE)

    cytescape(object, col1, col2, prompt = TRUE, d3 = FALSE)

    propd2propr(object, ivar)

    ## S4 method for signature 'propd,missing'
    plot(x, y, cutoff = 1000, col1, col2, propr,
      prompt = TRUE, d3 = FALSE, plotSkip = FALSE)

    geyser(object, cutoff = 1000, k = 5, prompt = TRUE, plotly = FALSE)

    bowtie(object, cutoff = 1000, k = 5, prompt = TRUE, plotly = FALSE)

    gemini(object, cutoff = 1000, k = 5, prompt = TRUE, plotly = FALSE)

    decomposed(object, cutoff = 1000)

    parallel(object, cutoff = 1000, include = NA, or = TRUE,
      plotly = FALSE)

### Arguments

`x` | A `propr` or `propd` object.
`y` | Missing. Ignore. Leftover from the generic method definition.
`prompt` | A logical scalar. Set to `FALSE` to disable the courtesy prompt when working with big data.
`plotly` | A logical scalar. Set to `TRUE` to produce a dynamic plot using the `plotly` package.
`rho` | A `propr` or `propd` object.
`group` | A character vector. Group or sub-group memberships, ordered according to the row names in `counts`.
`k` | An integer. For `propr` methods, the number of co-clusters (where all pairs receive a specified color if and only if both members belong to same the cluster). For `propd` methods, the maximum number of PALs to index when calculating `pals` in the network.
`object` | A `propr` or `propd` object.
`col1` | A character vector. Specifies which nodes to color `red` or `blue`, respectively.
`col2` | A character vector. Specifies which nodes to color `red` or `blue`, respectively.
`d3` | A boolean. Use `rgl` to plot 3D network.
`ivar` | A numeric scalar. Specifies reference feature(s) for additive log-ratio transformation. The argument will also accept feature name(s) instead of the index position(s). Set to "iqlr" to use inter-quartile log-ratio transformation. Ignore to use centered log-ratio transformation.
`cutoff` | For `updateCutoffs`, a numeric vector. this argument provides the FDR cutoffs to test. For graph functions, a numeric scalar. This argument indicates the maximum theta to include in the figure. For graph functions, a large integer will instead retrieve the top N pairs as ranked by theta.
`propr` | A `propr` or `propd` object.
`plotSkip` | A boolean. Toggles whether to build the network graph without plotting it. Used by `pals`.
`include` | This argument indicates which features by name should belong to a pair for that pair to get included in the results. Subset performed by `Partner %in% subset | Pair %in% subset`.
`or` | A boolean. If `FALSE`, `include` subsets by `Partner %in% subset & Pair %in% subset`.

### `propr` Functions

`plot:` A wrapper for `smear(x, ...)`.

`smear:` Plots log-ratio transformed abundances pairwise. Index-aware, meaning that it only plots pairs indexed in `@pairs`, unless no pairs are indexed. Returns a `ggplot` object.

`dendrogram:` Plots a clustering of the proportionality matrix. Index-aware, meaning that it only plots pairs indexed in `@pairs`, unless no pairs are indexed. Heatmap intensity is not scaled. Returns a `dendrogram` object.

`bucket:` Plots an estimation of the degree to which a feature pair differentiates the experimental groups versus the measure of the proportionality between that feature pair. The discrimination score is defined as the negative log of the p-values for each feature in the pair, computed independently using `kruskal.test`. "It's pronounced, 'bouquet'." - Hyacinth Bucket Returns cluster membership if `k` is provided. Otherwise, returns a `ggplot` object.

`prism:` Plots the variance of the ratio of the log-ratio transformed feature pair (VLR) versus the sum of the individual variances of each log-ratio transformed feature (VLS). The ratio of the VLR to the VLS equals `1 - rho`. As such, we use here seven rainbow colored lines to indicate where `rho` equals `[.01, .05, .50, 0, 1.50, 1.95, 1.99]`, going from red to violet. Returns cluster membership if `k` is provided. Otherwise, returns a `ggplot` object.

`bokeh:` Plots the feature variances for each log-ratio transformed feature pair in the `propr` object. Highly proportional pairs will aggregate near the `y = x` diagonal. Clusters that appear toward the top-right of the figure contain features with highly variable abundance across all samples. Clusters that appear toward the bottom-left of the figure contain features with fixed abundance across all samples. Uses a log scale. Returns cluster membership if `k` is provided. Otherwise, returns a `ggplot` object.

`pca:` Plots the first two principal components as calculated using the log-ratio transformed feature vectors. This provides a statistically valid alternative to conventional principal components analysis (PCA). For more information, see <DOI:10.1139/cjm-2015-0821>. Returns a `ggplot` object.

`snapshot:` Plots the log-ratio transformed feature abundance as a heatmap, along with the respective dendrograms. Heatmap intensity is not scaled. Returns a `dendrogram` object.

`cytescape:` Builds a table of indexed pairs and their proportionality. In doing so, this function displays a preview of the interaction network, built using `igraph`. We recommend using the result as input to a network visualization tool like Cytoscape. Returns a `data.frame` of indexed pairs.

### `propd` Functions

`propd2propr:` Transforms a `propd` object into a `propr` object where the `@matrix` slot contains 1 - θ. Allows the user to interrogate theta using any visualization built for `propr` objects.

`plot:` Plots the interactions between pairs as a network. When plotting disjointed proportionality, red edges indicate that LRM1 > LRM2 while blue edges indicate that LRM1 < LRM2. When plotting emergent proportionality, red edges indicate that VLR1 < VLR2 while blue edges indicate that VLR1 > VLR2. Group labels numbered based on the order of the `group` argument to `propd`. Use `col1` and `col2` arguments to color nodes. For more control over the visualization of the network, consider exporting the table from `shale` to a network visualization tool like Cytoscape.

`geyser:` Plots indexed pairs based on the within-group log-ratio variance (VLR) for each group. Pairs near the origin show a highly proportional relationship in both groups. Each line away from the `y = x` line indicates a doubling of VLR compared to the other group. All pairs colored based on PAL (see: `pals`). See `gemini`.

`bowtie:` Plots indexed pairs based on the log-ratio means (LRM), relative to its PAL, for each group. Pairs near the origin show comparable LRM, relative to its PAL, in both groups. Each line away from the `y = x` line indicates a doubling of LRM compared to the other group. All pairs colored based on PAL (see: `pals`). See `gemini`.

`gemini:` Plots indexed pairs based on the log-fold difference in log-ratio variance (VLR) between the two groups versus the difference in log-ratio means (LRM). In this figure, the LRM for each group is signed (i.e., positive or negative) such that the PAL is the denominator of the log-ratio. This allows for a fluid comparison between pairs within the same PAL module. Pairs with a "Bridged" or "Missing" PAL get excluded from this graph. Remember that an increase in VLR suggests less proportionality. All pairs colored based on PAL (see: `pals`).

`decomposed:` Plots the decomposition of log-ratio variance into (weighted) group variances and between-group variance. Useful for visualizing how a theta type selects pairs.

`parallel:` Plots the sample-wise log-ratio abundance across all pairs selected by the provided cutoff. Use the `reference` argument to subset the plot to only include pairs that contain this reference.

[Package propr version 4.1.1 Index]