SourceSet (version 0.1.0)

sourceSankeyDiagram: Create a D3 JavaScript Sankey diagram

Description

The function sourceSankeyDiagram allows to summarize the results obtained from the sourceSet function through a Sankey diagram, highlighting the relationships among nodes, graphs, and source sets.

Usage

sourceSankeyDiagram(sourceObj, name.graphs = names(sourceObj),
  map.name.variable = NULL, cutoff = 50, cut.extra.module = TRUE,
  height = NULL, width = NULL)

Arguments

sourceObj

a SourceSetObj objects, i.e. the output of the sourceSet function

name.graphs

the names of the graphs to be visualized. Default value is names(sourceObj)

map.name.variable

a list of customized labels to be associated with the names of the genes. Each list element must contain only one value (i.e. the new label), and the name of each element must be associated with the names of the genes given as input to the sourceSet function (column names of data input argument). If a label is not mapped, the original name is used

cutoff

the maximum number of variables to include in the sankey graph. The final number of visualized variables could be higher than the cutoff number

cut.extra.module

if set to TRUE, modules consisting only of variables excluded by the cutoff are not displayed

height

numeric height (in pixels) for the network graph's frame area

width

numeric width (in pixels) for the network graph's frame area

Details

The layout is organized on three levels:

  • the first level (left) shows nodes that appear in at least one source sets of the analyzed graphs;

  • the second level (center) is made up of modules. A module is defined as a set of nodes belonging to a connected subgraph of one pathway, that is also contained in associated source set. A pathway can have multiple modules, and, at the same time, one module can be contained in multiple pathways;

  • the third level (right) shows of pathways.

The three levels are to be read from left to right. A link between left element a and right element b must be interpret as "a is contained in b".

The implementation of the sourceSankeyDiagram function takes advantage of the D3 library (JavaScript), making the plot interactive. In fact, it is possible to vertically shift the displayed elements, and to view some useful information by positioning the cursor over items and links.

References

Allaire, J.J., Gandrud, G., Russell, K., and Yetman, C.J. (2017). networkD3: D3 JavaScript Network Graphs from R, r package version 0.4 edition.

Bostock, M., Ogievetsky, V., and Heer, J. (2011). D3 data-driven documents. IEEE Transactions on Visualization and Computer Graphics, 17(12):2301<U+2013>2309.

See Also

sankeyNetwork, sourceSet, easyLookSource

Examples

Run this code
# NOT RUN {
## Load the SourceSetObj obtained from the source set analysis of ALL dataset

# see vignette for more details
print(load(file=system.file("extdata","ALLsourceresult.RData",package = "SourceSet")))
class(results.all)

sourceSankeyDiagram(sourceObj = results.all ,cut.extra.module = FALSE )

# shows the variable that appears most often in the source sets
sourceSankeyDiagram(sourceObj = results.all, cutoff = 1 ,cut.extra.module = FALSE )
# cut modules in which the variable is not contained
sourceSankeyDiagram(sourceObj = results.all, cutoff = 1 ,cut.extra.module = TRUE )
# }

Run the code above in your browser using DataCamp Workspace