sourceSankeyDiagram: Create a D3 JavaScript Sankey diagram

Description Usage Arguments Details References See Also Examples

View source: R/mainFunctions.R

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

1
2
3
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 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–2309.

See Also

sankeyNetwork, sourceSet, easyLookSource

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## 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 )

SourceSet documentation built on Oct. 30, 2019, 9:38 a.m.