LipidSigR provides three network functions to quickly generate input data for constructing networks. After running the corresponding function, you will obtain the input data for a specific network. The available networks include the Pathway Activity Network, Lipid Reaction Network, and GATOM Network. Detailed instructions for each are described in the following sections.

  • NOTE: These functions only allow for two-group data.

The input data must be a SummarizedExperiment object deSp_se generated by LipidSigR::deSp_twoGroup. Please read lipid species differential expression analysis section in vignette("3_de").

Pathway activity network

The network provides activity pathways among lipid classes.

Follow the instructions below to get the input data for constructing the network.

# generate table for constructing Pathway activity network
network_table <- nw_pathway_activity(deSp_se, organism='mouse')

# result summary
summary(network_table)
#>                     Length Class      Mode
#> table_edge          11     data.frame list
#> table_node           9     tbl_df     list
#> table_pathway_score  4     grouped_df list
#> table_zScore         8     data.frame list

After obtaining all the returned tables, you can use them to construct a network. Here, we use the visNetwork package to display an example.

# network visualization
library(visNetwork)
network <- visNetwork(
    nodes=network_table$table_node, edges=network_table$table_edge) %>%
    visLayout(randomSeed=500) %>%
    visPhysics(
        solver='barnesHut', stabilization=TRUE, 
        barnesHut=list(gravitationalConstant=-3000)) %>%
    visInteraction(navigationButtons=TRUE) %>%
    visEvents(
        dragEnd="function () {this.setOptions( { physics: false } );}") %>%
    visEdges(color=list(color="#DDDDDD",highlight="#C62F4B")) %>%
    visOptions(
        highlightNearest=list(enabled=TRUE, degree=1, hover=FALSE),
        selectedBy="group", nodesIdSelection=TRUE)

# view network
network

Lipid reaction network

This network illustrates the important reactions of differentially expressed lipid classes and species.

Follow the instructions below to get the input data for constructing the network.

# generate table for constructing Lipid reaction network
network_table <- nw_lipid_reaction(
    deSp_se, organism='mouse', show_sp='sigClass', show_all_reactions=FALSE,
    sp_significant='pval', sp_p_cutoff=0.05, sp_FC_cutoff=1,
    class_significant='pval', class_p_cutoff=0.05, class_FC_cutoff=1)

# result summary
summary(network_table)
#>                Length Class      Mode
#> table_edge     11     data.table list
#> table_node      9     data.table list
#> table_reaction  4     data.frame list
#> table_stat      4     data.frame list

After obtaining all the returned tables, you can use them to construct a network. Here, we use the visNetwork package to display an example.

library(visNetwork)
# network visualization
network <- visNetwork(
    nodes=network_table$table_node, edges=network_table$table_edge) %>%
    visLayout(randomSeed=500) %>%
    visPhysics(
        solver='barnesHut', stabilization=TRUE, 
        barnesHut=list(gravitationalConstant=-2500)) %>%
    visInteraction(navigationButtons=TRUE) %>%
    visEvents(
        dragEnd="function () {this.setOptions( { physics: false } );}") %>%
    visOptions(
        highlightNearest=list(enabled=TRUE, degree=1, hover=FALSE),
        selectedBy="group", nodesIdSelection=TRUE)

# view network
network

GATOM network

The network shows the important reactions of differentially expressed lipid species.

Follow the instructions below to get the input data for constructing the network.

# generate table for constructing GATOM network
network_table <- nw_gatom(
    deSp_se, organism='mouse', n_lipid=50, sp_significant='pval',
    sp_p_cutoff=0.05, sp_FC_cutoff=1)
#> Registered S3 method overwritten by 'GGally':
#>   method from   
#>   +.gg   ggplot2
#> Found DE table for metabolites with Species IDs
#> Metabolite p-value threshold: 1.000000
#> Metabolite BU alpha: 0.043884
#> FDR for metabolites: 0.043894

# result summary
summary(network_table)
#>                Length Class      Mode
#> table_edge     17     data.table list
#> table_node     12     data.table list
#> table_reaction  4     data.table list
#> table_stat      3     data.table list

After obtaining all the returned tables, you can use them to construct a network. Here, we use the visNetwork package to display an example.

library(visNetwork)
# network visualization
network <- visNetwork(
    nodes=network_table$table_node, edges=network_table$table_edge) %>%
    visLayout(randomSeed=500) %>%
    visPhysics(
        solver='barnesHut', stabilization=TRUE, 
        barnesHut=list(gravitationalConstant=-3000)) %>%
    visInteraction(navigationButtons=TRUE) %>%
    visEvents(
        dragEnd="function () {this.setOptions( { physics: false } );}") %>%
    visEdges(color=list(color="#DDDDDD",highlight="#C62F4B")) %>%
    visOptions(
        highlightNearest=list(enabled=TRUE, degree=1, hover=FALSE),
        selectedBy="group", nodesIdSelection=TRUE)

# view network
network