Resolving merging conflict.

This commit is contained in:
kozlac
2020-06-24 10:09:27 -04:00
25 changed files with 132 additions and 59 deletions

View File

@@ -59,6 +59,9 @@ message(STATUS "Setting project paths")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -fpermissive -fPIC")
if(WIN32)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /STACK:100000000")
endif()
if(APPLE AND BUILD_SHARED_LIBS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -undefined dynamic_lookup")
endif()

View File

@@ -0,0 +1,23 @@
"""PDB2PQR
This package takes a PDB file as input and performs optimizations before
yielding a new PDB-style file as output.
For more information, see http://www.poissonboltzmann.org/
"""
import logging
from sys import version_info
assert version_info >= (3, 5)
from pdb2pqr.main import main, build_parser
_LOGGER = logging.getLogger(__name__)
logging.captureWarnings(True)
if __name__ == "__main__":
logging.basicConfig(level=logging.DEBUG)
logging.captureWarnings(True)
parser = build_parser()
args = parser.parse_args()
main(args)

View File

@@ -45,19 +45,19 @@ FILTER_WARNINGS = ["Skipped atom during water optimization",
FILTER_WARNINGS_LIMIT = 20
# Expected location for topology definition file
TOPOLOGY_DEF_PATH = "dat/TOPOLOGY.xml"
TOPOLOGY_DEF_PATH = "TOPOLOGY.xml"
# Expected location for amino acid topology definition file
AA_DEF_PATH = "dat/AA.xml"
AA_DEF_PATH = "AA.xml"
# Expected location for nucleic acid topology definition file
NA_DEF_PATH = "dat/NA.xml"
NA_DEF_PATH = "NA.xml"
# Expected location for hydrogens topology definition file
HYD_DEF_PATH = "dat/HYDROGENS.xml"
HYD_DEF_PATH = "HYDROGENS.xml"
# Expected location for topology patch definition file
PATCH_DEF_PATH = "dat/PATCHES.xml"
PATCH_DEF_PATH = "PATCHES.xml"
# Number of angle steps to scan when debumping
DEBUMP_ANGLE_STEPS = 72

View File

@@ -233,9 +233,13 @@ def test_for_file(name, type_):
test_names = [name, name.upper(), name.lower()]
test_suffixes = ["", ".%s" % type_.upper(), ".%s" % type_.lower()]
<<<<<<< HEAD
dat_dir = Path.joinpath(Path(__file__).parents[1], "dat")
test_dirs = sys_path + [dat_dir, "."]
=======
test_dirs = [Path(p).joinpath("pdb2pqr", "dat") for p in sys_path + [Path.cwd()]]
>>>>>>> setup_branc
if name.lower() in FORCE_FIELDS:
name = name.upper()
@@ -272,6 +276,16 @@ def test_dat_file(name):
"""
return test_for_file(name, "DAT")
def test_xml_file(name):
"""Test for the existence of the forcefield file with a few name permutations.
Args:
name of the xml file
Returns:
filename or empty string
"""
return test_for_file(name, "xml")
def get_pdb_file(name):
"""Obtain a PDB file.

View File

@@ -537,3 +537,4 @@ def main(args):
if args.apbs_input:
raise NotImplementedError("Missing argument for APBS input file.")
io.dump_apbs(args.output_pqr)

57
pdb2pqr/setup.py Normal file
View File

@@ -0,0 +1,57 @@
#!/usr/bin/python3
"""
The use of continuum solvation methods such as APBS requires accurate and complete structural data as well as force field parameters such as atomic charges and radii.
Unfortunately, the limiting step in continuum electrostatics calculations is often the addition of missing atomic coordinates to molecular structures from the Protein
Data Bank and the assignment of parameters to these structures. To adds this problem, we have developed PDB2PQR. This software automates many of the common tasks of
preparing structures for continuum solvation calculations as well as many other types of biomolecular structure modeling, analysis, and simulation. These tasks include:
* Adding a limited number of missing heavy (non-hydrogen) atoms to biomolecular structures.
* Estimating titration states and protonating biomolecules in a manner consistent with favorable hydrogen bonding.
* Assigning charge and radius parameters from a variety of force fields.
* Generating "PQR" output compatible with several popular computational modeling and analysis packages.
This service is intended to facilitate the setup and execution of electrostatics calculations for both experts and non-experts and thereby broaden the accessibility of
biomolecular solvation and electrostatics analyses to the biomedical community.
"""
import sys
import setuptools
if sys.version_info[:2] < (3,6):
raise RuntimeError("Python version >= 3.6 is required.")
with open("README.md", "r") as f:
long_description = f.read()
MAJOR = 3
MINOR = 0
MICRO = 0
VERSION = "%d.%d.%d" % (MAJOR, MINOR, MICRO)
setuptools.setup(
name = "pdb2pqr",
version = VERSION,
author = "Baker, Nathan A. et al.",
author_email = "nathan.baker@pnnl.gov",
description = "Automates many of the common tasks of preparing structures for continuum solvation calculations as well as many other types of biomolecular structure modeling, analysis, and simulation.",
long_description = long_description,
install_requires = ["propka >= 3.2", "pandas >= 1.0"],
url = " https://github.com/Electrostatics/apbs-pdb2pqr/tree/master/pdb2pqr",
packages = setuptools.find_packages(exclude = ["pdb2pka", "*.pdb2pka", "pdb2pka.*", "*.pdb2pka.*"]),
package_data = {
"pdb2pqr": ["dat/*.xml", "dat/*.DAT", "dat/*.names"]
},
license = "BSD",
classifiers = [
"Programming Language :: Python :: 3",
"License :: BSD",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS",
"Operating System :: Linux",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Topic :: Scientific/Engineering :: Chemestry"
],
keywords = "science chemestry modelcular biology",
entry_points = {"console_scripts": "pdb2pqr30 = pdb2pqr.main:main"}
)

View File

@@ -0,0 +1,26 @@
"""Tests for PROPKA functionality."""
import logging
from pathlib import Path
import pytest
import common
_LOGGER = logging.getLogger(__name__)
@pytest.mark.parametrize("input_pdb", ["1K1I", "1AFS", "1FAS", "5DV8", "5D8V"], ids=str)
def test_propka_apo(input_pdb, tmp_path):
"""PROPKA non-regression tests on proteins without ligands."""
args = "--log-level=INFO --ff=AMBER --drop-water --titration-state-method=propka"
output_pqr = Path(input_pdb).stem + ".pqr"
common.run_pdb2pqr(args=args, input_pdb=input_pdb, output_pqr=output_pqr,
tmp_path=tmp_path)
# @pytest.mark.parametrize("input_pdb", ["1K1I", "1FAS"], ids=str)
# def test_propka_apo(input_pdb, tmp_path):
# """PROPKA titration of proteins without ligands."""
# args = "--log-level=INFO --ff=AMBER --drop-water --titration-state-method=propka"
# output_pqr = Path(input_pdb).stem + ".pqr"
# run_pdb2pqr(args, input_pdb, output_pqr, tmp_path)

View File

@@ -8,10 +8,9 @@ import common
_LOGGER = logging.getLogger(__name__)
_LOGGER.error("Need functional and regression test coverage for --userff")
_LOGGER.error("Need functional and regression test coverage for --usernames")
_LOGGER.error("Need functional and regression test coverage for --ligand")
_LOGGER.error("Need functional and regression test coverage for --apbs-input")
_LOGGER.warning("Need functional and regression test coverage for --userff")
_LOGGER.warning("Need functional and regression test coverage for --usernames")
_LOGGER.warning("Need functional and regression test coverage for --apbs-input")
@pytest.mark.parametrize("input_pdb", ["1K1I", "1AFS", "1FAS", "5DV8", "5D8V"], ids=str)
@@ -21,53 +20,3 @@ def test_basic_apo(input_pdb, tmp_path):
output_pqr = Path(input_pdb).stem + ".pqr"
common.run_pdb2pqr(args=args, input_pdb=input_pdb, output_pqr=output_pqr,
tmp_path=tmp_path)
@pytest.mark.parametrize("input_pdb", ["1K1I", "1AFS", "1FAS", "5DV8", "5D8V"], ids=str)
def test_propka_apo(input_pdb, tmp_path):
"""PROPKA non-regression tests on proteins without ligands."""
args = "--log-level=INFO --ff=AMBER --drop-water --titration-state-method=propka"
output_pqr = Path(input_pdb).stem + ".pqr"
common.run_pdb2pqr(args=args, input_pdb=input_pdb, output_pqr=output_pqr,
tmp_path=tmp_path)
# @pytest.mark.parametrize("input_pdb", ["1K1I", "1FAS"], ids=str)
# def test_propka_apo(input_pdb, tmp_path):
# """PROPKA titration of proteins without ligands."""
# args = "--log-level=INFO --ff=AMBER --drop-water --titration-state-method=propka"
# output_pqr = Path(input_pdb).stem + ".pqr"
# run_pdb2pqr(args, input_pdb, output_pqr, tmp_path)
# @pytest.mark.parametrize(
# "args, input_pdb, input_mol2, output_pqr",
# [
# pytest.param(
# "--log-level=INFO --ff=AMBER",
# "1HPX",
# common.DATA_DIR / "1HPX-ligand.mol2",
# "output.pqr",
# id="1HPX-ligand AMBER"
# ),
# pytest.param(
# "--log-level=INFO --ff=AMBER",
# common.DATA_DIR / "1QBS.pdb",
# common.DATA_DIR / "1QBS-ligand.mol2",
# "output.pqr",
# id="1QBS-ligand AMBER"
# ),
# pytest.param(
# "--log-level=INFO --ff=AMBER",
# common.DATA_DIR / "1US0.pdb",
# common.DATA_DIR / "1US0-ligand.mol2",
# "output.pqr",
# id="1US0-ligand AMBER"
# ),
# ]
# )
# def test_ligand(args, input_pdb, input_mol2, output_pqr, tmp_path):
# """Test ligand handling."""
# args_ = "{args} --ligand={ligand}".format(args=args, ligand=input_mol2)
# run_pdb2pqr(args_, input_pdb, output_pqr, tmp_path)
# _LOGGER.warning("This test needs better checking to avoid silent failure.")