IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
plot_search Namespace Reference

Detailed Description

Path searches
=============
IMP.bff can to search for an optimal path on a grid with obstacles
between two points using established algorithms (e.g., Dijkstra and
A star). These path search algorithms can be used to implement accessible
volume calculations of label for fluorescence or EPR experiments in a
1:N (one starting node N end nodes) path search (Dijkstra) or for 1:1
(one start node one end node) path searches (Astar), e.g., for
implementing cross-linking restraints.

Functions

 get_distances (path)

Variables

 axs
 dea
 ded
 dsa
 dsd
int end_idx = 8062
 extra_radius
 fig
float grid_spacing = 1.0
 hier = IMP.atom.read_pdb(str(pdb_fn), m)
 label
 labeled_p = IMP.core.XYZ(sel_particles[0])
 m = IMP.Model()
float max_path_length = 20.0
 path_astar = path_map.get_tiles()[end_idx].backtrack_to_path()
 path_dijkstra = tiles[end_idx].backtrack_to_path()
 path_map = IMP.bff.PathMap(path_map_header)
 path_map_header = IMP.bff.PathMapHeader(max_path_length, grid_spacing)
 path_origin = labeled_p.get_coordinates()
str pdb_fn = pathlib.Path(IMP.bff.get_example_path('structure')) / "T4L/3GUN.pdb"
list ps = [a.get_particle() for a in IMP.atom.get_leaves(hier)]
 r_end = path_map.get_location_by_voxel(end_idx)
 r_start = path_map.get_location_by_voxel(start_idx)
 sel = IMP.atom.Selection(hier)
 sel_particles = sel.get_selected_particles()
 sharex
 start_idx = path_map.get_voxel_by_location(path_origin)
 tiles = path_map.get_tiles()
 xlabel
 ylabel

Function Documentation

◆ get_distances()

get_distances ( path)

Definition at line 107 of file plot_search.py.

Variable Documentation

◆ axs

plot_search.axs

Definition at line 115 of file plot_search.py.

◆ dea

plot_search.dea

Definition at line 114 of file plot_search.py.

◆ ded

plot_search.ded

Definition at line 113 of file plot_search.py.

◆ dsa

plot_search.dsa

Definition at line 114 of file plot_search.py.

◆ dsd

plot_search.dsd

Definition at line 113 of file plot_search.py.

◆ end_idx

int plot_search.end_idx = 8062

Definition at line 70 of file plot_search.py.

◆ extra_radius

plot_search.extra_radius

Definition at line 60 of file plot_search.py.

◆ fig

plot_search.fig

Definition at line 115 of file plot_search.py.

◆ grid_spacing

float plot_search.grid_spacing = 1.0

Definition at line 48 of file plot_search.py.

◆ hier

plot_search.hier = IMP.atom.read_pdb(str(pdb_fn), m)

Definition at line 31 of file plot_search.py.

◆ label

plot_search.label

Definition at line 117 of file plot_search.py.

◆ labeled_p

plot_search.labeled_p = IMP.core.XYZ(sel_particles[0])

Definition at line 38 of file plot_search.py.

◆ m

plot_search.m = IMP.Model()

Definition at line 29 of file plot_search.py.

◆ max_path_length

float plot_search.max_path_length = 20.0

Definition at line 47 of file plot_search.py.

◆ path_astar

plot_search.path_astar = path_map.get_tiles()[end_idx].backtrack_to_path()

Definition at line 96 of file plot_search.py.

◆ path_dijkstra

plot_search.path_dijkstra = tiles[end_idx].backtrack_to_path()

Definition at line 93 of file plot_search.py.

◆ path_map

plot_search.path_map = IMP.bff.PathMap(path_map_header)

Definition at line 57 of file plot_search.py.

◆ path_map_header

plot_search.path_map_header = IMP.bff.PathMapHeader(max_path_length, grid_spacing)

Definition at line 49 of file plot_search.py.

◆ path_origin

plot_search.path_origin = labeled_p.get_coordinates()

Definition at line 39 of file plot_search.py.

◆ pdb_fn

str plot_search.pdb_fn = pathlib.Path(IMP.bff.get_example_path('structure')) / "T4L/3GUN.pdb"

Definition at line 30 of file plot_search.py.

◆ ps

list plot_search.ps = [a.get_particle() for a in IMP.atom.get_leaves(hier)]

Definition at line 58 of file plot_search.py.

◆ r_end

plot_search.r_end = path_map.get_location_by_voxel(end_idx)

Definition at line 71 of file plot_search.py.

◆ r_start

plot_search.r_start = path_map.get_location_by_voxel(start_idx)

Definition at line 72 of file plot_search.py.

◆ sel

plot_search.sel = IMP.atom.Selection(hier)

Definition at line 33 of file plot_search.py.

◆ sel_particles

plot_search.sel_particles = sel.get_selected_particles()

Definition at line 37 of file plot_search.py.

◆ sharex

plot_search.sharex

Definition at line 115 of file plot_search.py.

◆ start_idx

plot_search.start_idx = path_map.get_voxel_by_location(path_origin)

Definition at line 69 of file plot_search.py.

◆ tiles

plot_search.tiles = path_map.get_tiles()

Definition at line 92 of file plot_search.py.

◆ xlabel

plot_search.xlabel

Definition at line 116 of file plot_search.py.

◆ ylabel

plot_search.ylabel

Definition at line 116 of file plot_search.py.