Skip to content

Commit

Permalink
PY3K for getChannelAtoms (CaviFinder)
Browse files Browse the repository at this point in the history
  • Loading branch information
karolamik13 committed Dec 18, 2024
1 parent 6478534 commit 56fcbf0
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion prody/proteins/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 56fcbf0

Please sign in to comment.