Package es.imim.DISGENET.network

# Class NetworkBuilder

java.lang.Object
es.imim.DISGENET.network.NetworkBuilder

public class NetworkBuilder extends Object

## Constructor Summary

Constructors
Constructor
Description
`NetworkBuilder()`
`NetworkBuilder(GuiParameters params)`

## Method Summary

Modifier and Type
Method
Description
`void`
`addNetCreationListener(NetCreationListener l)`
`void`
`buildDiseaseNet(GuiParameters curParams)`
Generic function to create disease network
`void`
`buildGeneDiseaseNet(GuiParameters curParams)`
Get the gene/disease net information from the database and call generic function to build net
`void`
`buildGeneNet(GuiParameters curParams)`
Generic function to create gene network
`void`
`buildNet(List<String> list1, List<String> list2, List<String> nrCommonEntities, String src, GuiParameters params)`
Builds a new disease-disease or gene-gene network.
`void`
`buildNetWithEdgeAttributes(ArrayList<String> intList, ArrayList<String> disList, ArrayList<String> genList, ArrayList<String> normalizedScoreList, ArrayList<String> scoreList, ArrayList<String> eiList, ArrayList<String> yearList, ArrayList<String> yearFinalList, GuiParameters params)`
`void`
`buildVariantDiseaseNet(GuiParameters curParams)`
Get the variant/disease net information from the database and call generic function to build net
`void`
`createCyEdgeAttributeColumns(org.cytoscape.model.CyNetwork cyNetwork)`
`org.cytoscape.model.CyNetwork`
`createCyNetwork(String name)`
`void`
`createNodeAttributeColumns(org.cytoscape.model.CyNetwork cyNetwork)`
`Map<String,Long>`
`expandGeneDiseaseNet(GuiParameters curParams, Map<String,Long> nodeMap)`
Expands the selected gene disease network using the selected nodes as reference.
`Map<String,Long>`
`expandVariantDiseaseNet(GuiParameters curParams, Map<String,Long> nodeMap)`
Expands the selected variant disease network using the selected nodes as reference.
`Database`
`getDB()`
`ArrayList<String>`
`getNodeNamesFromNet()`
Function to retrieve all node names from currently selected network to be able to search for them.
`void`
`initAdditionalStyleAttributes(GuiParameters<?,?> params)`
Fills the attribute columns for the different type of networks.
`void`
`removeGenesFromVariantNet()`
Removes the gene nodes from the variant disease network and updates the view.
`void`
`removeMoodListener(NetCreationListener l)`
`void`
`showVariantNetWithGenes()`
Calls the method to expand a variant disease network and updates the view.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### NetworkBuilder

public NetworkBuilder()

### NetworkBuilder

public NetworkBuilder(GuiParameters params)

## Method Details

### getDB

public Database getDB()

### createCyNetwork

public org.cytoscape.model.CyNetwork createCyNetwork(String name)

### createNodeAttributeColumns

public void createNodeAttributeColumns(org.cytoscape.model.CyNetwork cyNetwork)

### createCyEdgeAttributeColumns

public void createCyEdgeAttributeColumns(org.cytoscape.model.CyNetwork cyNetwork)

### expandGeneDiseaseNet

public Map<String,Long> expandGeneDiseaseNet(GuiParameters curParams, Map<String,Long> nodeMap) throws SQLException, DisGeNetException
Expands the selected gene disease network using the selected nodes as reference.

Parameters:
  `curParams` - the parameters of the current network.
  `nodeMap` - the nodes that exist in the current network.
Returns:
  map containing the existing nodes plus the added ones, with the name as key and the suid as value.
Throws:
  `DisGeNetException` - low level exception with the message for the user.
  `SQLException` - in case of database access error.

### expandVariantDiseaseNet

public Map<String,Long> expandVariantDiseaseNet(GuiParameters curParams, Map<String,Long> nodeMap) throws SQLException, DisGeNetException
Expands the selected variant disease network using the selected nodes as reference.

Parameters:
  `curParams` - the parameters of the current network.
  `nodeMap` - the nodes that exist in the current network.
Returns:
  map containing the existing nodes plus the added ones, with the name as key and the suid as value.
Throws:
  `DisGeNetException` - low level exception with the error message for the user.
  `SQLException` - in case of database access error.

### buildGeneDiseaseNet

public void buildGeneDiseaseNet(GuiParameters curParams) throws DisGeNetException
Get the gene/disease net information from the database and call generic function to build net

Parameters:
  `curParams` - the current parameters of the network.
Throws:
  `DisGeNetException` - low level exception with the message error for the user.

### buildVariantDiseaseNet

public void buildVariantDiseaseNet(GuiParameters curParams) throws DisGeNetException, SQLException
Get the variant/disease net information from the database and call generic function to build net

Parameters:
  `curParams` - the current parameters of the network.
Throws:
  `DisGeNetException` - low level exception with the message error for the user.
  `SQLException` - in case of database access error.

### showVariantNetWithGenes

public void showVariantNetWithGenes() throws DisGeNetException, SQLException
Calls the method to expand a variant disease network and updates the view.

Throws:
  `DisGeNetException` - low level exception with the message error for the user.
  `SQLException` - low level exception with the message error for the user.

### removeGenesFromVariantNet

public void removeGenesFromVariantNet()
Removes the gene nodes from the variant disease network and updates the view.

### buildDiseaseNet

public void buildDiseaseNet(GuiParameters curParams) throws DisGeNetException
Generic function to create disease network

Parameters:
  `curParams` - the current parameters of the network.
Throws:
  `DisGeNetException` - low level exception with the message error for the user.

### buildGeneNet

public void buildGeneNet(GuiParameters curParams) throws DisGeNetException
Generic function to create gene network

Parameters:
  `curParams` - the current parameters of the network.
Throws:
  `DisGeNetException` - low level exception with the message error for the user.

### getNodeNamesFromNet

public ArrayList<String> getNodeNamesFromNet()
Function to retrieve all node names from currently selected network to be able to search for them.

Returns:
  an arrayList containing the node names.

### buildNet

public void buildNet(List<String> list1, List<String> list2, List<String> nrCommonEntities, String src, GuiParameters params) throws DisGeNetException
Builds a new disease-disease or gene-gene network.

Parameters:
  `list1` - list of genes or diseases
  `list2` - duplication of the first list
  `src` - selected source for the search
  `nrCommonEntities` - number of entities in common
  `params` - current params for the network
Throws:
  `DisGeNetException` - low level exception with the error message.

### buildNetWithEdgeAttributes

public void buildNetWithEdgeAttributes(ArrayList<String> intList, ArrayList<String> disList, ArrayList<String> genList, ArrayList<String> normalizedScoreList, ArrayList<String> scoreList, ArrayList<String> eiList, ArrayList<String> yearList, ArrayList<String> yearFinalList, GuiParameters params) throws DisGeNetException

Throws:
  `DisGeNetException`

### initAdditionalStyleAttributes

public void initAdditionalStyleAttributes(GuiParameters<?,?> params)
Fills the attribute columns for the different type of networks.

Parameters:
  `params` - the parameters given to the network.

### addNetCreationListener

public void addNetCreationListener(NetCreationListener l)

### removeMoodListener

public void removeMoodListener(NetCreationListener l)