Find Shortest Pathways

Introduction

Once you have a processed emap object which contains the graph theory model of the protein structure, you can search for pathways. There are two modes of search: source only and specified target. Pathways are stored as ShortestPath objects, which are organized into Branch objects. The data is stored in the emap object which was passed in. For a report of pathways found by pyemap, use report().

Source only

When only a source node is selected, a NetworkX implementation of Dijkstra’s algorithm is used to calculate the shortest path from the source to each surface-exposed residue. In the output, the pathways are organized into “branches” based on the first surface-exposed residue reached during the course of the pathway. The source node will be colored yellow in the graph visualization.

Specified target

If a target is specified, a NetworkX procedure based on Yen’s algorithm is used to calculate the shortest paths from source to target. The target does not need to be a surface-exposed residue. The target node will be colored blue in the graph visualization.

Examples

Source only:

>>> import pyemap
>>> my_emap = pyemap.fetch_and_parse("1u3d")
>>> pyemap.process(my_emap)
>>> pyemap.find_paths(my_emap,"FAD510(A)-2")
>>> print(my_emap.report())
Branch: W356(A)
1a: ['FAD510(A)-2', 'W356(A)'] 9.48
1b: ['FAD510(A)-2', 'W356(A)', 'Y432(A)', 'W436(A)'] 26.44
1c: ['FAD510(A)-2', 'W356(A)', 'W213(A)', 'W62(A)', 'W217(A)'] 34.72
Branch: ANP511(A)
2a: ['FAD510(A)-2', 'FAD510(A)-1', 'ANP511(A)'] 14.15
...
>>> my_emap.paths_graph_to_Image().show()
../../_images/source_only.png

Specified Target:

>>> pyemap.find_paths(my_emap,"FAD510(A)-2", target = "W324(A)", max_paths=10)
>>> my_emap.report()
Branch: W324(A)
1a: ['FAD510(A)-2', 'W400(A)', 'W377(A)', 'W324(A)'] 24.15
1b: ['FAD510(A)-2', 'W385(A)', 'Y53(A)', 'W377(A)', 'W324(A)'] 35.25
1c: ['FAD510(A)-2', 'W400(A)', 'W334(A)', 'W379(A)', 'W324(A)'] 36.37
1d: ['FAD510(A)-2', 'W400(A)', 'W377(A)', 'W492(A)', 'W324(A)'] 49.20
1e: ['FAD510(A)-2', 'W385(A)', 'Y53(A)', 'Y309(A)', 'W377(A)', 'W324(A)'] 50.67
...
>>> my_emap.paths_graph_to_Image().show()
../../_images/target.png

Find Paths

pyemap.pathway_analysis.find_paths(emap, source, target=None, max_paths=10)[source]

Function which calculates pathways from source to target or surface exposed residues.

Performs shortest path analysis on source and (optionally) target residues.

Parameters
  • emap (emap) – Object for storing state of emap analysis.

  • source (str) – source node for analysis

  • target (str, optional) – target node for analysis

  • max_paths (int, optional) – maximum number of paths to search for in yen’s algorithm