"""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,
    install_requires=[],
    entry_points={'console_scripts': ['pdbfixer = pdbfixer.pdbfixer:main']})

check_dependencies()

41ac1552c166b861d85a2dd43b91d65298521794
<mask token>


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)


<mask token>

<mask token>


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)


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, install_requires=[], entry_points={'console_scripts':
    ['pdbfixer = pdbfixer.pdbfixer:main']})
check_dependencies()

<mask token>
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)


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, install_requires=[], entry_points={'console_scripts':
    ['pdbfixer = pdbfixer.pdbfixer:main']})
check_dependencies()

<mask token>
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)


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, install_requires=[], entry_points={'console_scripts':
    ['pdbfixer = pdbfixer.pdbfixer:main']})
check_dependencies()

"""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,
    install_requires=[],
    entry_points={'console_scripts': ['pdbfixer = pdbfixer.pdbfixer:main']})

check_dependencies()
