API Documentation

This page details the api documentation for graphpro:

Graph Generation

A generator can be obtain from a specific library and return a graph generator.

graphpro.md_analisys(u: Universe, name: str = '')[source]
This helper connects MDAnalysis with Graphpro, returning a

generator that builds a graph representation from a static 3D graph structure or a trajectory.

Parameters

u : MDAnalysis univererse name: protein name for reference

Default: empty string

Then a graph generator can be used:

class graphpro.graphgen.ContactMap(cutoff, chain=None)[source]

Illustrates the spatial proximity between amino acids in a protein structure.

class graphpro.graphgen.GraphProGenerator(ag, trajectory=None, name='')[source]

Graph Pro Generator

Generate both a graph or a graph colection from a structure of a trajectory.

class graphpro.graphgen.KNN(k, chain=None)[source]

Generate the structure form a defined number of neighbours

class graphpro.graphgen.RepresentationMethod[source]

This interface defines a generation strategy and can be extended to implement new strategies for transforming a collection of atoms into a graph representation.

Graph

The graph class is the core class of the library.

class graphpro.graph.Graph(name: str, adjacency: array, positions: array, res_map: dict[int, dict], metadata: ProteinMetadata = None)[source]

Graph provides a representation of a graph and required helpers.

communities() list[tuple[float, list[set]]][source]

Perform Girvan Newman communinity detection returning the list of communities. The algorithm is perform all the way until no more edges are left to be removed.

get_node_by_resid(resid: int) int[source]

Returns the node number using the residue id, None if the residue id is not known

node_attr_add(node_id: int, attribute_name: str, attribute: any)[source]

Adds a specific attribute to a noode in the graph

nodes() list[int][source]

Return node list

plot(figsize: tuple[int, int] = (8, 10), communities: list[set[int]] = [], show=True) None[source]

Plot the graph represention in 3D using residue positions.

to_data(node_encoders=[], target: Target = None) Data[source]

Return a PyG object from this existing graph

to_networkx() Graph[source]

Returns a networkx G undirected graph with populated attributes