Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
5b18e3a
commit new file: drugui/.DS_Store
Cventura18 Aug 5, 2025
fe63bde
Drugui
Cventura18 Aug 5, 2025
5b006f0
Drugui
Cventura18 Aug 6, 2025
9e08bac
import error
Cventura18 Aug 6, 2025
725bfa5
test
Cventura18 Aug 6, 2025
e23b566
Update __init__.py
Cventura18 Aug 6, 2025
d93dea7
test
Cventura18 Aug 14, 2025
822d3c4
test
Cventura18 Aug 14, 2025
c7bc2b1
test
Cventura18 Aug 20, 2025
46f2b8e
test
Cventura18 Aug 20, 2025
0a261e3
test
Cventura18 Aug 20, 2025
a608c49
test
Cventura18 Aug 20, 2025
f309f27
test
Cventura18 Aug 20, 2025
bd12697
Merge branch 'prody:main' into main
Cventura18 Aug 20, 2025
b251915
Add files via upload
Cventura18 Aug 20, 2025
755582e
Add files via upload
Cventura18 Aug 20, 2025
a1926cc
Add files via upload
Cventura18 Aug 20, 2025
81e14eb
test
Cventura18 Aug 20, 2025
a47cc73
test
Cventura18 Aug 20, 2025
66540b8
fixed analysis error
Cventura18 Aug 23, 2025
c01d2aa
fixed analysis error
Cventura18 Aug 23, 2025
7772b8e
Remove .DS_Store files
Cventura18 Aug 23, 2025
ff5ba22
fixed type error in analysis result
Cventura18 Aug 25, 2025
bef54f5
fixed negative number of ion and adding test
Cventura18 Oct 8, 2025
f90feb0
fixed negative number of ion and adding test
Cventura18 Oct 8, 2025
a474ece
added halogen based probes and finished test for drugui
Cventura18 Oct 15, 2025
ddcb0d9
added files for drugui tests
Cventura18 Oct 15, 2025
9722cb9
Merge branch 'prody:main' into main
Cventura18 Oct 16, 2025
8fecfc7
added dcd for drugui test
Cventura18 Oct 16, 2025
0177299
add dcd file for drugui test
Cventura18 Oct 16, 2025
de9e063
add dcd file for drugui test
Cventura18 Oct 16, 2025
770ed93
add function to evaluate ligand
Cventura18 Oct 21, 2025
effc84e
add function to test ligand in druggable sites
Cventura18 Oct 22, 2025
2c91b52
Remove .DS_Store files, added evalaute ligand function to gui, and up…
Cventura18 Oct 23, 2025
84f329c
add ligand for drugui test
Cventura18 Oct 23, 2025
ec98cb0
updated code for test errors
Cventura18 Oct 28, 2025
787ec49
Update test_pdbfile.py to fix type in line 28
AnthonyBogetti Dec 3, 2025
83632b6
fix local filesystem
Cventura18 Dec 3, 2025
ae280f3
Update gui.py
Cventura18 Jan 14, 2026
3b78246
Update no_gui.py
Cventura18 Jan 14, 2026
9979415
remove cgenff files and added method to prepare probe
Cventura18 Jan 19, 2026
cb8a638
Delete prody/drugui/DruGUI-script/druggability/top_all36_cgenff.rtf
Cventura18 Jan 20, 2026
3d04962
Delete prody/tests/datafiles/final.dcd
Cventura18 Jan 20, 2026
e0a699c
added new test trajectory file
Cventura18 Jan 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ sdist
develop-eggs
.installed.cfg
__pycache__
.DS_Store

# ProDy
*.nmd
Expand Down
10 changes: 10 additions & 0 deletions prody/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ def turnonDeprecationWarnings(action='always'):
__all__.extend(dynamics.__all__)
__all__.append('dynamics')

from . import drugui
from .drugui import *
__all__.extend(drugui.__all__)
__all__.append('drugui')

from . import ensemble
from .ensemble import *
__all__.extend(ensemble.__all__)
Expand All @@ -134,6 +139,11 @@ def turnonDeprecationWarnings(action='always'):
__all__.extend(domain_decomposition.__all__)
__all__.append('domain_decomposition')

from . import drugui
from .drugui import *
__all__.extend(drugui.__all__)
__all__.append('drugui')

#from . import comd
#from .comd import *
#__all__.extend(comd.__all__)
Expand Down
42 changes: 42 additions & 0 deletions prody/drugui/DruGUI-script/0chlcmpall.tcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 2020-05-12 Ji Young Lee

set struc ./t0.pdb
set psffi XXX
set trajec RRR
set freq SSTEP
set start FSTEP

mol load psf $psffi pdb $struc
animate read dcd $trajec beg $start end -1 skip $freq waitfor all

####wrap
package require pbctools
pbc wrap -compound fragment -center com -centersel "protein" -sel " SSS " -all

####alignment
set ref_molid [molinfo top get id]
set traj_molid [molinfo top get id]

set calpha "alpha carbon"
set CAreference [atomselect $ref_molid $calpha frame 0]
set CAcompare [atomselect $traj_molid $calpha]
set System [atomselect $traj_molid " SSS "]

set num_frames [molinfo $traj_molid get numframes]

for {set f 1} {$f < $num_frames} {incr f} {
molinfo $traj_molid set frame $f
$CAcompare frame $f
$System frame $f
set trans_mat [measure fit $CAcompare $CAreference]
$System move $trans_mat
}
####alignment

animate write pdb pp0.pdb beg 0 end 0 sel [atomselect top " SSS "]
animate write psf pp0.psf beg 0 end 0 sel [atomselect top " SSS "]
animate write pdb pp1.pdb beg 1 end 1 sel [atomselect top " SSS "]
animate write psf pp1.psf beg 1 end 1 sel [atomselect top " SSS "]
animate write dcd pp.dcd beg 1 end -1 waitfor all sel [atomselect top " SSS "]

exit
21 changes: 21 additions & 0 deletions prody/drugui/DruGUI-script/1a.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 2020-05-12 Ji Young Lee

###Check
Struc=../md.pdb
PSFfi=' ..\/md.psf '
Traje=' ..\/sim.dcd '
Selec='all '
Step=1
Start=0
Head='CRYST1 85.328 96.807 93.491 90 90 90'
###Check

sed '1,1d' $Struc > __test ## Check!!!
echo "$Head " > t0.pdb
cat __test >> t0.pdb

cp 0chlcmpall.tcl ___ligb.tcl
sed -e "s/XXX/$PSFfi/g" -e "s/RRR/$Traje/g" -e "s/SSS/$Selec/g" -e "s/FSTEP/$Start/g" -e "s/SSTEP/$Step/g" ___ligb.tcl > __ligb.tcl

vmd -dispdev text -e __ligb.tcl
rm __*
31 changes: 31 additions & 0 deletions prody/drugui/DruGUI-script/druggability/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Druggability: Python Package and VMD GUI for Druggability Index Analysis
# Copyright (C) 2010 Ahmet Bakan <ahb12@pitt.edu>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""Python Package for druggability index analysis"""

__author__ = 'Ahmet Bakan'
__copyright__ = 'Copyright (C) 2010 Ahmet Bakan'
__version__ = '0.5.2'


from . import functions
from . import grid
from . import probe
from .functions import pickler
from .dia import DruggabilityIndexAnalysis as DIA

__all__ = ['DIA', 'pickler']

250 changes: 250 additions & 0 deletions prody/drugui/DruGUI-script/druggability/abase.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,250 @@
# Druggability: Python Package and VMD GUI for Druggability Index Analysis
# Copyright (C) 2010 Ahmet Bakan <ahb12@pitt.edu>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""This module defines a base class for other classes. Important features of
this base class are its logging and self pickling functionalities.

Classes:

* :class:`ABase`

Functions:

* :func:`get_logger`

"""

__author__ = 'Ahmet Bakan'
__copyright__ = 'Copyright (C) 2010 Ahmet Bakan'
__version__ = '0.5.2'

import pickle
import gzip
import logging
import logging.handlers
import os
import os.path

LOGGING_LEVELS = {'debug': logging.DEBUG,
'info': logging.INFO,
'warning': logging.WARNING,
'error': logging.ERROR,
'critical': logging.CRITICAL}
LOGGING_LEVELS.setdefault(logging.INFO)

SIGNATURE = '@>'

__all__ = ['ABase']

def _set_workdir(workdir):
"""Set a working directory, by creating if it doesn't exist."""
if os.path.isabs(workdir):
workdir = os.path.relpath(workdir)
if not os.path.isdir(workdir):
dirs = workdir.split(os.sep)
for i in range(len(dirs)):
dirname = os.sep.join(dirs[:i+1])
try:
if not os.path.isdir(dirname):
os.mkdir(dirname)
except OSError:
return os.getcwd()
return os.path.join(os.getcwd(), workdir)

def get_logger(name, **kwargs):
"""Return a logger.

:arg name: name of the logger instance
:type name: str

:keyword verbose: loglevel for console verbosity
:type verbose: str, default is "info"

:keyword writelog: control logging in a file
:type writelog: bool, default is True

:keyword workdir: location of logfile
:type workdir: str, default is "."

:keyword loglevel: loglevel for logfile verbosity
:type loglevel: str, default is "debug"

:keyword logfilemode: mode in which logfile will be opened
:type logfilemode: str, default is "w"

:keyword backupcount: number of old *name.log* files to save
:type backupcount: int, default is 3

======== ==================================================================
Loglevel Description
======== ==================================================================
debug Eveything will be printed on the colsole or written into logfile.
info Only brief information will be printed or written.
warning Only critical information will be printed or written.
error This loglevel is equivalent to *warning* in package.
critical This loglevel is equivalent to *warning* in package.
======== ==================================================================


"""
logger = logging.getLogger(name)
logger.setLevel(logging.DEBUG)

if logger.handlers:
return logger


console = logging.StreamHandler()
console.setLevel(LOGGING_LEVELS[kwargs.get('verbose', 'info')])
console.setFormatter(logging.Formatter(SIGNATURE + ' %(message)s'))
logger.addHandler(console)

if not ('writelog' in kwargs and not kwargs['writelog']):
logfilename = os.path.join(kwargs.get('workdir', '.'), name+'.log')
rollover = False
# if filemode='a' is provided, rollover is not performed
if os.path.isfile(logfilename) and kwargs.get('filemode', None) != 'a':
rollover = True
logfile = logging.handlers.RotatingFileHandler(logfilename,
mode=kwargs.get('filemode', 'a'), maxBytes=0,
backupCount=kwargs.get('backupcount', 3))
logfile.setLevel(LOGGING_LEVELS[kwargs.get('loglevel', 'debug')])
logfile.setFormatter(logging.Formatter('%(message)s'))
logger.addHandler(logfile)
if rollover:
logger.debug('Saving this log file and starting a new one.')
logfile.doRollover()
return logger

class ABase(object):

"""A base class that provides logging and self pickling functionality.


.. attribute:: name

Name of the instance, which is frequently used as a prefix to output
names.

.. attribute:: workdir

Working directory for the instance, into which outputs are written.

.. attribute:: logger

A Python logger for the instance. By default a log file is started for
the instance with the name :file:`workdir/name.log`.

"""


def __init__(self, name, **kwargs):
"""Instantiate class using an instance name.

:arg name: name of the class instance
:type name: str

:keyword workdir: location of all outputs and logfile
:type workdir: str, default is "."

:keyword logger: logger instance to log actions and method calls
:type logger: logging.Logger, default None

Unless an existing logger is passed as a keyword argument, a new logger
is started for the object. All keyword arguments are passed to the
:meth:`get_logger` method.

"""
self.name = name

if 'wordkdir' in kwargs:
workdir = kwargs['workdir']
else:
workdir = '.'

kwargs['workdir'] = _set_workdir(workdir)

if 'logger' in kwargs:
self.logger = kwargs['logger']
else:
self.logger = get_logger(name, **kwargs)
self.logger.info('{0:s} is initialized.'.format(self.name))
self.set_workdir(workdir)

def set_workdir(self, workdir):
"""Change working directory.

If *workdir* does not exist, it is created.

:arg workdir: new working directory
:type workdir: str

"""
self.workdir = _set_workdir(workdir)
self.logger.info('{0:s} working directory is set to "{1:s}".'
.format(self.name, os.path.relpath(workdir)))

def set_logger(self, **kwargs):
"""Setup a logger.

This method can be used to reset current logger or to restart logger
after the object is unpickled.

All keyword arguments are passed to the :func:`get_logger` method.

"""
if not kwargs.has_key('filemode'):
kwargs['filemode'] = 'a'
self.logger = get_logger(self.name, workdir=self.workdir, **kwargs)

def pickle(self, filename=None, compress=True):
"""cPickle the object into a file with .dso(.gz) extension.

Handler objects of logger attribute prevents pickling of this
object. Hence, this method is defined. It temporarily removes
handlers from the logger, pickles the object, and restores the
handlers.

To restore the object, use pickler method in Functions module.

:arg filename: name of the file to dump object (without an extension)
:type filename: str or None, default is :attr:`ABase.name`

:arg compress: gzip output
:type compress: bool, default is True

"""
if filename is None:
filename = os.path.join(self.workdir, self.name)
filename += '.dso'
if compress:
filename += '.gz'
out = gzip.open(filename, 'w')
else:
out = open(filename, 'w')

# spare logger
logger = self.logger
self.logger = None

pickle.dump(self, out)
out.close()

# restore logger and kdtree
self.logger = logger

self.logger.info('{0:s} is cPickled into file {1:s}.'
.format(self.name, os.path.relpath(filename)))
Loading
Loading