-
Notifications
You must be signed in to change notification settings - Fork 265
Graphical interface for AutoDock Vina #107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Loosely based on the original AutoDock plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't run a docking (don't know how to use it) but the code looks pretty clean, nice job.
plugins/vina.py
Outdated
DEFAULT_PREFS = { | ||
'DOCKING_VINA': '/usr/bin/vina', | ||
'DOCKING_OBABEL': '/usr/bin/obabel', | ||
'DOCKING_ADT_PYTHON': '/usr/bin/python2.7', | ||
'DOCKING_PREPARE_RECEPTOR': '/usr/lib/python2.7/dist-packages/AutoDockTools/Utilities24/prepare_receptor4.py', | ||
'DOCKING_PREPARE_FLEXRECEPTOR': '/usr/lib/python2.7/dist-packages/AutoDockTools/Utilities24/prepare_flexreceptor4.py', | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could try something like this:
try:
from AutoDockTools import Utilities24
utilities24_dir = os.path.dirname(Utilities24.__file__)
docking_adt_python = sys.executable
except ImportError:
try:
utilities24_dir = glob('/usr/lib/python*/dist-packages/AutoDockTools/Utilities24')[0]
docking_adt_python = '/usr/bin/' + utilities24_dir.split('/')[3]
except IndexError:
utilities24_dir = ''
docking_adt_python = ''
DEFAULT_PREFS = {
'DOCKING_VINA': 'vina', # without /usr/bin, will pick it up from $PATH
'DOCKING_OBABEL': 'obabel',
'DOCKING_ADT_PYTHON': docking_adt_python,
'DOCKING_PREPARE_RECEPTOR': os.path.join(utilities24_dir, 'prepare_receptor4.py'),
'DOCKING_PREPARE_FLEXRECEPTOR': os.path.join(utilities24_dir, 'prepare_flexreceptor4.py'),
}
plugins/vina.py
Outdated
command = ( | ||
f'"{adt_python}"' | ||
f' "{prepare_target}" -r "{target_pdb}"' | ||
) | ||
output, success = run(command) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to remove the shlex.split
call in run
and do this:
command = [adt_python, prepare_target, "-r", target_pdb]
plugins/vina.py
Outdated
def run(command): | ||
ret = subprocess.run( | ||
shlex.split(command), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to pass a list and not do shlex.split
(see other comment below)
Checking in to see what the status of this PR is since it's been quite some time. @pslacerda |
i'm needing to make this plugin public. |
Loosely based on the original AutoDock plugin. It isn't ready yet, there is more work to do:
Must be a more convenient way to set the prefs. I'm thinking of guess the defaults for Ubuntu and Windows and let users adjust the prefs themselves if don't work.