Description Usage Arguments Details Value Author(s) See Also Examples
Draws a network with gene sets as nodes and the thickness of the edges
correlating to the number of shared genes. The gene set significance is
visualized as color intensities. Gives an overview of the influence of
overlap on significant gene sets. Uses package visNetwork
for plotting.
1 2 3 4 5 6 | networkPlot2(gsaRes, class, direction, adjusted = TRUE,
significance = 0.001, geneSets = NULL, lay = "visNetwork",
physics = TRUE, overlap = 0.1, label = "names", labelSize = 22,
ncharLabel = 25, nodeSize = c(10, 40), edgeWidth = c(1, 15),
edgeColor = NULL, scoreColors = NULL, naColor = "yellow", main,
submain, seed = 1, maxAllowedNodes = Inf, shiny = FALSE)
|
gsaRes |
an object of class |
class |
a character string determining the p-values of which
directionality class that should be used as significance information for the
plot. Can be one of |
direction |
a character string giving the direction of regulation, can
be either |
adjusted |
a logical, if adjusted p-values should be used, or not. Note
that if |
significance |
the significance cut-off that determines which gene sets are included in the plot. Defaults to 0.001. |
geneSets |
a character vector of gene set names, to be included in the
plot. Defaults to |
lay |
One of |
physics |
logical, whether or not to use physics simulation. |
overlap |
a positive numerical. Determines the smallest number or fraction of sharing genes between two gene-sets that is needed in order to draw a line/edge between the gene-sets. If >= 1, the argument is interpreted as number of genes. If between 0 and 1, the argument is interprested as the fraction of genes of the smalles gene-set in a given pair. Defaults to 0.1. |
label |
a character string, either |
labelSize |
the text size of the node labels. |
ncharLabel |
the number of characters to include in the node labels. |
nodeSize |
a numerical vector of length 2 giving the maximum and minimum node sizes. The node size represents the size of the gene set, and all values will be scaled to the given interval. |
edgeWidth |
a numerical vector of length 2 giving the maximum and minimum edge widths. The edge width represents the number of shared genes between two gene sets, and all values will be scaled to the given interval. |
edgeColor |
a character vector giving the colors to use for increasing edge width. Can also be set to a single color. Defaults to a gray-scale. |
scoreColors |
a character vector giving the colors from which the
gradient used for node coloring will be created. In the case of
|
naColor |
the color for gene-sets when selected p-value is NA |
main |
an optional character vector setting the title of the plot. |
submain |
an optional character vector setting the subtitle of the plot. |
seed |
random seed for reproducible layouts |
maxAllowedNodes |
if the set parameters results in a network with more than
|
shiny |
Only for internal use. Set to FALSE by default. |
In the case of class="distinct"
and direction="both"
, the
distinct directional p-values (pDistinctDirUp
and
pDistinctDirDn
, see runGSA
) will be used in
combination.
Returns an object of class visNetwork
that can be further manipulated,
see examples.
Leif Varemo piano.rpkg@gmail.com and Intawat Nookaew piano.rpkg@gmail.com
piano, runGSA
, GSAheatmap
,
exploreGSAres
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | # Load example input data to GSA:
data("gsa_input")
# Load gene set collection:
gsc <- loadGSC(gsa_input$gsc)
# Run gene set analysis:
gsares <- runGSA(geneLevelStats=gsa_input$pvals , directions=gsa_input$directions,
gsc=gsc, nPerm=500)
# Network plot:
networkPlot2(gsares, class="non", significance=0.1)
# Display number to gene-set name mapping:
res <- networkPlot2(gsares, class="non", significance=0.1)
res$x$nodes[,c("id","geneSetNames")]
# Examples of reusing res later:
# Draw same again:
require(visNetwork)
visNetwork(res$x$nodes,res$x$edges)
# os simly just:
res
# Draw only essential, rest is default:
visNetwork(res$x$nodes[,c("id","label")],res$x$edges[,c("from","to")])
# Add custom options:
visNetwork(res$x$nodes[,c("id","label")],res$x$edges[,c("from","to")]) %>%
visIgraphLayout("layout_in_circle")
# Other example:
res %>% visNodes(shadow=FALSE)
# See package visNetwork for more examples
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.