## 1. Introduction

Biological processes are driven by a complex web of interactions amongst numerous molecular entities of a biological system. The classical method of pathway analysis is unable to identify important associations or interactions between molecules belonging to different pathways. Network analysis is therefore commonly used to address this limitation. Here, the aim of the Network Explorer module is to provide an easy-to-use tool to that allows users to map their metabolites and/or genes onto different networks for novel insights or development of new hypotheses.

Mapping of both metabolites and genes are supported in this module (including KOs), whereby either entity can be projected onto five existing biological networks including the KEGG global metabolic network, the gene-metabolite interaction network, the metabolite-disease interaction network, the metabolite-metabolite interaction network, and the metabolite-gene-disease interaction network. The last four networks are created based on information gathered from HMDB and STITCH and are applicable to human studies only.

Users can upload either a list of metabolites, a list of genes, or a list of both metabolites and genes. MetaboAnalystR currently accepts compound names, HMDB IDs, KEGG compound IDs as metabolite identifiers. As well, we only accept Entrez IDs, ENSEMBL IDs, Official Gene Symbols, or KEGG Orthologs (KO) as gene identifiers. The uploaded list of metabolites and/or genes is then mapped using our internal databases of metabolites and gene annotations. Following this step, users can select which of the five networks to begin visually exploring their data.

## 2. Network Explorer

As the main goal of the network explorer module is to allow for user's to visually explore their data, the ideal setting is to use the MetaboAnalyst web-server, which permits interactive exploration such as drag-and-drop of nodes, highlighting specific nodes, deleting specific nodes, and overlapping pathway-analysis onto the network. Further, a user's edited network image can be downloaded as a SVG or PNG images for publication purposes. This module will also create a snapshot of a network in your working directory, though this image may be hard to interpret if user's data is too large.

### 2.1 Uploading User Data

This module require's user's to upload a list of metabolites, a list of genes, or both. For users to prepare these lists, they can copy and paste a list of metabolites and/or genes into a plain text file, which can then be uploaded to R. The steps include:

1) Set working directory to location of your files for analysis 2) Set your list of features as “geneListFile” &/or “cmpdListFile” in R 3) Read in the text file for analysis using readChar, saving it as “geneList” and/or “cmpdList” respectively.

To use the tutorial, please download the example data below (directly by using the links, or with the provided R commands) and place it in your current working directory. The example data comes from an integrative analysis of the transcriptome and metabolome to identify (metabolites/genes) biomarkers of intrahepatic cholangiocarcinoma (ICC) in 16 individuals.

Download the gene list here, consisting of a list of Official Gene Symbols. Download the metabolite list here, consisting of a list of KEGG compound IDS.

    download.file("https://www.metaboanalyst.ca/MetaboAnalyst/resources/data/integ_genes.txt", "integ_genes.txt", "curl")

    download.file("https://www.metaboanalyst.ca/MetaboAnalyst/resources/data/integ_cmpds.txt", "integ_cmpds.txt", "curl")

### 2.2 Perform Network Exploration

In the example below, we will explore the gene/metabolite data in a metabolite-disease interaction network.

    ##
    ## METABOLITE-DISEASE INTERACTION NETWORK
    ##

    # Create objects for storing processed data from the network explorer module
    mSet<-InitDataObjects("conc", "network", FALSE)

    # Set organism to human, at the moment only human data can be accomodated
    mSet<-SetOrganism(mSet, "hsa")

    # Set geneListFile as a file containing your gene list
    geneListFile<-"integ_genes.txt"

    # Read in the geneListFile
    # This will import a plain text file as single character string
    geneList<-readChar(geneListFile, file.info(geneListFile)$size)

    # Perform gene ID mapping
    mSet<-PerformIntegGeneMapping(mSet, geneList, "hsa", "symbol");

    # Set cmpdListFile as a file containing your metablolite list
    cmpdListFile<-"integ_cmpds.txt"

    # Read in the cmpdListFile
    # This will import a plain text file as single character string
    cmpdList<-readChar(cmpdListFile, file.info(cmpdListFile)$size)

    # Perform compound ID mapping
    mSet<-PerformIntegCmpdMapping(mSet, cmpdList, "hsa", "kegg");

    # Create the mapping results table for compounds
    mSet<-CreateMappingResultTable(mSet)

    # Create the mapping results table for genes
    mSet<-GetNetworkGeneMappingResultTable(mSet)

    # Prepare the data for network analysis, saves a .json file that can be uploaded
    # to external sites/packages to view the network
    mSet<-PrepareNetworkData(mSet);

    # Map user's data to internal interaction network
    mSet<-SearchNetDB(mSet, "pheno", "global", FALSE, 0.5)

    # Create graph and subnetworks
    mSet<-CreateGraph(mSet)

## 3. Sweave Report

Following analysis, a comprehensive report can be generated which contains a detailed description of each step performed in the R package, embedded with graphical and tabular outputs. To prepare the sweave report, please use the PreparePDFReport function. You must ensure that you have the nexessary Latex libraries to generate the report (i.e. pdflatex, LaTexiT). The object created must be named mSet, and specify the user name in quotation marks.