Learn R Programming

inDAGO (version 1.0.0)

mdsPlottly: mdsPlottly

Description

Generate an interactive MDS plot using Plotly based on expression data.

Usage

mdsPlottly(x, Sample, Group, title, palette, top, gene.selection)

Value

A Plotly object ( "plotly::ggplotly ") representing the interactive MDS scatterplot.

Arguments

x

A DGEList object from edgeR.

Sample

Character vector. Sample names corresponding to columns of "x ".

Group

Factor or character vector. Group or condition for each sample.

title

Character. Title for the plot.

palette

Character. Name of a discrete palette from the "paletteer " package.

top

Integer. Number of top most variable genes (by logFC) to include in MDS.

gene.selection

Character. Gene selection method: one of ""pairwise" ", ""common" ", or ""logFC" ".

Details

This function computes multidimensional scaling (MDS) coordinates with limma's "plotMDS() " and then renders an interactive scatterplot via "plotly::ggplotly() ".

  1. Compute MDS on the input data with "limma::plotMDS() ".

  2. Extract eigenvalues and first two dimensions for variance annotation.

  3. Build a ggplot2 scatterplot with axis labels showing percent variance explained.

  4. Convert the ggplot to an interactive Plotly graph.