Skip to main content

🍇 GRAPE is a Rust/Python Graph Representation Learning library for Predictions and Evaluations.

Project description

Pypi project Pypi total project downloads Tutorials Documentation Supported Python versions DOI License Telegram Group Discord Server Twitter

GRAPE (Graph Representation leArning, Predictions and Evaluation) is a fast graph processing and embedding library, designed to scale with big graphs and to run on both off-the-shelf laptop and desktop computers and High Performance Computing clusters of workstations.

The library is written in Rust and Python programming languages, and has been developed by AnacletoLAB (Dept. of Computer Science of the University of Milan), in collaboration with the Robinson Lab - Jackson Laboratory for Genomic Medicine and with the BBOP - Lawrence Berkeley National Laboratory.

The library is composed of two main modules, Ensmallen, which is the Rust/Python high-performance graph processing submodule, and Embiggen, which is the Python Graph Representation learning, Prediction and Evaluation submodule.

Installation of GRAPE

As usual, just install it from PyPi by running:

pip install grape

Generally, the installation does not take longer than a minute.

It is possible to manually compile Ensmallen for any OS, libc version, and CPU architecture (such as Arm, AArch64, RiscV, Mips) which are supported by Rust and LLVM. Just open an issue if you need some help.

Main functionalities of the library

Features

Tutorials

You can find tutorials covering various aspects of the GRAPE library here. All tutorials are as self-contained as possible and can be immediately executed on COLAB.

If you believe that any example may be of help, do feel free to open a GitHub issue describing what we are missing in this tutorial.

Documentation

On line documentation (currently being updated)

The on line documentation of the library is available here. Since Ensmallen is written in Rust, and PyO3 (the crate we use for the Python bindings), doesn’t support typing, the documentation is obtained generating an empty skeleton package. This allows to have a proper documentation but you won’t be able to see the source-code in it.

Using the automatic method suggestions utility

To aid working with the library, GRAPE provides an integrated recommender system meant to help you either to find a method or, if a method has been renamed for any reason, find its new name.

As an example, after having loaded the STRING Homo Sapiens graph, the function for computing the connected components can be retrieved by simply typing components as follows:

from grape.datasets.string import HomoSapiens

graph = HomoSapiens()
graph.components

The code above will raise the following error, and will suggest methods with a similar or related name:

AttributeError                            Traceback (most recent call last)
<ipython-input-3-52fac30ac7f6> in <module>()
----> 2 graph.components

AttributeError: The method 'components' does not exists, did you mean one of the following?
* 'remove_components'
* 'connected_components'
* 'strongly_connected_components'
* 'get_connected_components_number'
* 'get_total_edge_weights'
* 'get_mininum_edge_weight'
* 'get_maximum_edge_weight'
* 'get_unchecked_maximum_node_degree'
* 'get_unchecked_minimum_node_degree'
* 'get_weighted_maximum_node_degree'

In our example the method we need for computing the graph components would be connected_components.

Now the easiest way to get the method documentation is to use Python’s help as follows:

help(graph.connected_components)

And the above will return you:

connected_components(verbose) method of builtins.Graph instance
Compute the connected components building in parallel a spanning tree using [bader's algorithm](https://www.sciencedirect.com/science/article/abs/pii/S0743731505000882).

**This works only for undirected graphs.**

The returned quadruple contains:
- Vector of the connected component for each node.
- Number of connected components.
- Minimum connected component size.
- Maximum connected component size.

Parameters
----------
verbose: Optional[bool]
    Whether to show a loading bar or not.


Raises
-------
ValueError
    If the given graph is directed.
ValueError
    If the system configuration does not allow for the creation of the thread pool.

Cite GRAPE

Please cite the following paper if it was useful for your research:

@misc{cappelletti2021grape,
  title={GRAPE: fast and scalable Graph Processing and Embedding},
  author={Luca Cappelletti and Tommaso Fontana and Elena Casiraghi and Vida Ravanmehr and Tiffany J. Callahan and Marcin P. Joachimiak and Christopher J. Mungall and Peter N. Robinson and Justin Reese and Giorgio Valentini},
  year={2021},
  eprint={2110.06196},
  archivePrefix={arXiv},
  primaryClass={cs.LG}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grape-0.2.1.tar.gz (7.7 kB view details)

Uploaded Source

File details

Details for the file grape-0.2.1.tar.gz.

File metadata

  • Download URL: grape-0.2.1.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.1 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.9

File hashes

Hashes for grape-0.2.1.tar.gz
Algorithm Hash digest
SHA256 d8f79a1e8da7790ef7cc05b718b7f4179a2254fe0080b3b9b9257ce8e875efb8
MD5 3573a7669328646d1782eb83f5a0559c
BLAKE2b-256 9bf058801c754df2912af5299d52b850ea82ff505e14bcd9db2fc3b920305f30

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page