Graph and Graph Generator

Graphs

class deeprank_gnn.Graph.Graph[source]

Class that performs graph level action

  • get score for the graph (lrmsd, irmsd, fnat, capri_class, bin_class and dockQ)

  • networkx object (graph) to hdf5 format

  • networkx object (graph) from hdf5 format

get_score(ref)[source]

Assigns scores (lrmsd, irmsd, fnat, dockQ, bin_class, capri_class) to a protein graph

Parameters

ref (path) – path to the reference structure required to compute the different score

nx2h5(f5)[source]

Converts Networkx object to hdf5 format

Parameters

f5 ([type]) – hdf5 file

h52nx(f5name, mol, molgrp=None)[source]

Converts Hdf5 file to Networkx object

Parameters
  • f5name (str) – hdf5 file

  • mol (str) – molecule name

  • molgrp ([type], optional) – hdf5[molecule]. Defaults to None.

plotly_2d(out=None, offline=False, iplot=True, disable_plot=False, method='louvain')[source]

Plots the interface graph in 2D

Parameters
  • out ([type], optional) – output name. Defaults to None.

  • offline (bool, optional) – Defaults to False.

  • iplot (bool, optional) – Defaults to True.

  • method (str, optional) – ‘mcl’ of ‘louvain’. Defaults to ‘louvain’.

plotly_3d(out=None, offline=False, iplot=True, disable_plot=False)[source]

Plots interface graph in 3D

Parameters
  • out ([type], optional) – [description]. Defaults to None.

  • offline (bool, optional) – [description]. Defaults to False.

  • iplot (bool, optional) – [description]. Defaults to True.

Residue Graphs

class deeprank_gnn.ResidueGraph.ResidueGraph(pdb=None, pssm=None, contact_distance=8.5, internal_contact_distance=3, pssm_align='res', biopython=False)[source]

Class from which Residue features are computed

Parameters
  • pdb (str, optional) – path to pdb file. Defaults to None.

  • pssm (str, optional) – path to pssm file. Defaults to None.

  • contact_distance (float, optional) – cutoff distance for external edges. Defaults to 8.5.

  • internal_contact_distance (int, optional) – cutoff distance for internal edges. Defaults to 3.

  • pssm_align (str, optional) – [description]. Defaults to ‘res’.

check_execs()[source]

Checks if all the required external execs are installed.

Raises

OSError – if execs not found

get_graph(db)[source]

Gets the interface graph nodes and edges given the internal and external distance threshold

Parameters

db ([type]) – sqldb database

get_node_features(db)[source]

Assigns features to each node

get_edge_features()[source]

Assigns distance feature to each edge

get_internal_edges(db)[source]

Gets internal edges and the associated distances

onehot(idx, size)[source]

One hot encoder

Graph Generator

Parrallel Graph Generator

class deeprank_gnn.GraphGenMP.GraphHDF5(pdb_path, ref_path=None, graph_type='residue', pssm_path=None, select=None, outfile='graph.hdf5', nproc=1, use_tqdm=True, tmpdir='./', limit=None, biopython=False)[source]

Master class from which graphs are computed :param pdb_path: path to the docking models :type pdb_path: str :param ref_path: path to the reference model. Defaults to None. :type ref_path: str, optional :param graph_type: Defaults to ‘residue’. :type graph_type: str, optional :param pssm_path: path to the pssm file. Defaults to None. :type pssm_path: [type], optional :param select: filter files that starts with ‘input’. Defaults to None. :type select: str, optional :param outfile: Defaults to ‘graph.hdf5’. :type outfile: str, optional :param nproc: number of processors. Default to 1. :type nproc: int, optional :param use_tqdm: Default to True. :type use_tqdm: bool, optional :param tmpdir: Default to ./. :type tmpdir: str, optional :param limit: Default to None. :type limit: int, optional :param >>> pdb_path = ‘./data/pdb/1ATN/’: :param >>> pssm_path = ‘./data/pssm/1ATN/’: :param >>> ref = ‘./data/ref/1ATN/’: :param >>> GraphHDF5(pdb_path=pdb_path: graph_type=’residue’, outfile=’1AK4_residue.hdf5’) :param ref_path=ref: graph_type=’residue’, outfile=’1AK4_residue.hdf5’) :param pssm_path=pssm_path: graph_type=’residue’, outfile=’1AK4_residue.hdf5’) :param : graph_type=’residue’, outfile=’1AK4_residue.hdf5’)

get_all_graphs(pdbs, pssm, ref, outfile, use_tqdm=True, biopython=False)[source]