IoDriver

This driver uploads, deletes and accesses network files.

IoDriver.convert_networkx(network_id, network)

Uploads a NetworkX object to Neo4j database.

  • network_id: Name for network node
  • network: NetworkX object

IoDriver.delete_network(network_id)

Deletes a Network node and Edge nodes that are not connected to other networks.

  • network_id: Name for network node

IoDriver.return_networks(networks)

Returns NetworkX networks from the Neo4j database.

  • networks: List of network nodes to return

IoDriver.return_taxa()

Returns a list of all taxa from the Neo4j database.


IoDriver.return_networks(networks)

Returns NetworkX networks from the Neo4j database.

  • networks: List of network names to return

IoDriver.export_network(path, networks=None)

Writes networks to graphML file. If no path is given, the network is returned as a NetworkX object.

  • path: Filepath for writing network(s) to
  • networks: List of network names to write to disk

IoDriver.export_cyto(networks=None)

Writes networks to Cytoscape.

  • networks: List of network names to export

IoDriver.include_nodes(nodes, name, label, verbose=True)

Given a dictionary, this function tries to upload the file to the Neo4j database. The first column of the edgelist should reflect nodes already present in the Neo4j graph database, while the second column reflects node names that will be added. The column names are used to assign node types to the new metadata. The dictionary should contain another dictionary of target nodes and edge weights, or only a single value (target node). The node properties should be identical for all node dictionaries.

  • nodes: Dictionary of existing nodes as values with node names as keys
  • name: Name of variable, inserted in Neo4j graph database as type
  • label: Label of source node (e.g. Taxon, Specimen, Property, Experiment etc)
  • verbose: If true, adds logging info