forked from openmm/pdbfixer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
116 lines (101 loc) · 4.23 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
"""pdbfixer: Fixes problems in PDB files
Protein Data Bank (PDB) files often have a number of problems that must be
fixed before they can be used in a molecular dynamics simulation. The details
vary depending on how the file was generated. Here are some of the most common
ones:
- If the structure was generated by X-ray crystallography, most or all of the
- hydrogen atoms will usually be missing.
- There may also be missing heavy atoms in flexible regions that could not be
clearly resolved from the electron density. This may include anything from a
few atoms at the end of a sidechain to entire loops.
- Many PDB files are also missing terminal atoms that should be present at the
ends of chains.
- The file may include nonstandard residues that were added for crystallography
purposes, but are not present in the naturally occurring molecule you want to
simulate.
- The file may include more than what you want to simulate. For example, there
may be salts, ligands, or other molecules that were added for experimental
purposes. Or the crystallographic unit cell may contain multiple copies of a
protein, but you only want to simulate a single copy.
- There may be multiple locations listed for some atoms.
- If you want to simulate the structure in explicit solvent, you will need to
add a water box surrounding it.
PDBFixer can fix all of these problems for you in a fully automated way. You
simply select a file, tell it which problems to fix, and it does everything else.
"""
from __future__ import print_function
import os
import sys
from os.path import relpath, join
from setuptools import setup, find_packages
DOCLINES = __doc__.split("\n")
########################
__version__ = '1.0'
VERSION = __version__
ISRELEASED = False
########################
CLASSIFIERS = """\
Development Status :: 3 - Alpha
Intended Audience :: Science/Research
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Programming Language :: Python
Programming Language :: Python :: 3
Topic :: Scientific/Engineering :: Bio-Informatics
Topic :: Scientific/Engineering :: Chemistry
Operating System :: Microsoft :: Windows
Operating System :: POSIX
Operating System :: Unix
Operating System :: MacOS
"""
def find_package_data():
files = []
for root, dirnames, filenames in os.walk('pdbfixer'):
for fn in filenames:
files.append(relpath(join(root, fn), 'pdbfixer'))
return files
def check_dependencies():
from distutils.version import StrictVersion
found_openmm = True
found_openmm_52_or_later = True
found_numpy = True
try:
from simtk import openmm
openmm_version = StrictVersion(openmm.Platform.getOpenMMVersion())
if openmm_version < StrictVersion('5.2'):
found_openmm_52_or_later = False
except ImportError as err:
found_openmm = False
try:
import numpy
except:
found_numpy = False
msg = None
bar = ('-' * 70) + "\n" + ('-' * 70)
if found_openmm:
if not found_openmm_52_or_later:
msg = [bar, '[Unmet Dependency] PDBFixer requires OpenMM version 5.2 or later. You have version %s.' % openmm_version, bar]
else:
msg = [bar, '[Unmet Dependency] PDBFixer requires the OpenMM python package. Refer to <http://openmm.org> for details and installation instructions.', bar]
if not found_numpy:
msg = [bar, '[Unmet Dependency] PDBFixer requires the numpy python package. Refer to <http://www.scipy.org/scipylib/download.html> for numpy installation instructions.', bar]
if msg is not None:
import textwrap
print()
print(os.linesep.join([line for e in msg for line in textwrap.wrap(e)]), file=sys.stderr)
#print('\n'.join(list(textwrap.wrap(e) for e in msg)))
setup(
name='pdbfixer',
author='Peter Eastman',
description=DOCLINES[0],
long_description="\n".join(DOCLINES[2:]),
version=__version__,
license='MIT',
url='https://github.com/SimTk/pdbfixer',
platforms=['Linux', 'Mac OS-X', 'Unix', 'Windows'],
classifiers=CLASSIFIERS.splitlines(),
packages=find_packages(),
package_data={'pdbfixer': find_package_data()},
zip_safe=False,
entry_points={'console_scripts': ['pdbfixer = pdbfixer.pdbfixer:main']})
check_dependencies()