diff --git a/prody/proteins/channels.py b/prody/proteins/channels.py index c4e00e5d2..eba7b73af 100644 --- a/prody/proteins/channels.py +++ b/prody/proteins/channels.py @@ -377,6 +377,7 @@ def showCavities(surface, show_surface=False): vis.run() vis.destroy_window() + def calcChannels(atoms, output_path=None, separate=False, r1=3, r2=1.25, min_depth=10, bottleneck=1, sparsity=15): """ Computes and identifies channels within a molecular structure using Voronoi and Delaunay tessellations. @@ -637,6 +638,7 @@ def calcChannelsMultipleFrames(atoms, trajectory=None, output_path=None, separat return channels_all, surfaces_all + def getChannelParameters(channels): """ Extracts and returns the lengths, bottlenecks, and volumes of each channel in a given list of channels. @@ -667,6 +669,7 @@ def getChannelParameters(channels): return lengths, bottlenecks, volumes + def getChannelAtoms(channels, protein=None, num_samples=5): """ Generates an AtomGroup object representing the atoms along the paths of the given channels @@ -698,7 +701,12 @@ def getChannelAtoms(channels, protein=None, num_samples=5): Example usage: atomic_structure = getChannelAtoms(channels, protein) """ - import io + + if PY3K: + import io + else: + import StringIO as io + from prody import parsePDBStream, writePDBStream def convert_lines_to_atomic(atom_lines): @@ -742,6 +750,7 @@ def convert_lines_to_atomic(atom_lines): channels_atomic = convert_lines_to_atomic(pdb_lines) return channels_atomic + class Channel: def __init__(self, tetrahedra, centerline_spline, radius_spline, length, bottleneck, volume): self.tetrahedra = tetrahedra