Registry / ai-ml / pdb2pqr

pdb2pqr

JSON →
library3.7.1pypypiunverified

PDB2PQR is a Python software package designed to automate the preparation of biomolecular structures for continuum solvation calculations and various other modeling, analysis, and simulation tasks. It processes PDB files, adding missing heavy atoms and hydrogens, optimizing hydrogen bonding, estimating titration states, and assigning atomic charges and radii from various force fields to generate PQR files. The current version is 3.7.1, and the project maintains an active release cadence with updates typically on an annual or semi-annual basis.

pip install pdb2pqr
INSTALL
IMPORT
SIG · PDB2PQR
P
pdb2pqr
ai-mlpythonv3.7.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

PDB2PQR is primarily used as a command-line tool. This quickstart demonstrates how to execute it from Python using the `subprocess` module to convert a PDB file to PQR format. It creates a simple dummy PDB file, runs the `pdb2pqr` command, and then prints the output PQR file content. For real-world usage, the command-line arguments would be expanded to include options for force fields, pH calculation, hydrogen bonding optimization, etc.

import subprocess import os # Create a dummy PDB file for demonstration pdb_content = """ HETATM 1 N UNL A 1 -0.003 -0.003 0.000 1.00 0.00 N HETATM 2 C UNL A 1 1.400 0.001 0.000 1.00 0.00 C HETATM 3 O UNL A 1 2.000 -0.800 0.000 1.00 0.00 O END """ with open("dummy.pdb", "w") as f: f.write(pdb_content) input_pdb = "dummy.pdb" output_pqr = "dummy.pqr" try: # Run pdb2pqr as a command-line tool via subprocess # Using --keep-chain to preserve chain IDs, --ff=PARSE for force field, --clean for minimal processing # Note: For complex proteins, you would typically use options like --with-ph, --titration-state-method=propka, etc. command = [ "pdb2pqr", "--keep-chain", "--ff=PARSE", "--clean", # Use --clean to skip optimization for a minimal example input_pdb, output_pqr ] print(f"Executing command: {' '.join(command)}") result = subprocess.run(command, capture_output=True, text=True, check=True) print("PDB2PQR ran successfully.") print("STDOUT:", result.stdout) print("STDERR:", result.stderr) if os.path.exists(output_pqr): print(f"Generated PQR file: {output_pqr}") with open(output_pqr, "r") as f: print("\nContent of dummy.pqr:") print(f.read()) else: print("Error: PQR file not generated.") except FileNotFoundError: print("Error: 'pdb2pqr' command not found. Please ensure pdb2pqr is installed and in your PATH.") except subprocess.CalledProcessError as e: print(f"Error running pdb2pqr: {e}") print("STDOUT:", e.stdout) print("STDERR:", e.stderr) finally: # Clean up dummy files if os.path.exists(input_pdb): os.remove(input_pdb) if os.path.exists(output_pqr): os.remove(output_pqr)
pdb2pqr --version
Debug
Known issues
breakingThe primary executable name changed from `pdb2pqr30` to `pdb2pqr` in version 3.6.0. While `pdb2pqr30` is still available, it is slated for future deprecation. Users should update scripts to use `pdb2pqr` to ensure future compatibility.
fix
Replace all calls to `pdb2pqr30` with `pdb2pqr` in your scripts.
affects: >=3.6.0
gotchaPDB2PQR has limitations regarding ligand processing, specifically it cannot handle more than one ligand per structure. This includes multiple copies of the same ligand, where only one will be processed. Additionally, residues not recognized by the chosen force field will be omitted from the output. Users should pre-process PDB files to remove unwanted residues (e.g., waters) or ensure only a single ligand is present.
fix
Ensure PDB files contain only one ligand to be parameterized or remove/ignore additional ligands. Delete solvent molecules (e.g., waters) before processing if they are not intended to be part of the PQR output.
affects: All versions
gotchaAs of version 3.7.1, PDB2PQR requires Python versions `>=3.11` and `<4`. Older versions (e.g., v3.6.0) supported `>=3.8` to `3.11`. Upgrading PDB2PQR may necessitate updating your Python environment, and using it with unsupported Python versions can lead to installation or runtime errors.
fix
Ensure your Python environment is compatible with the installed PDB2PQR version. For 3.7.1, use Python 3.11, 3.12, or 3.13.
affects: >=3.7.1
gotchaThere are confirmed issues with naming conventions when using the CHARMM force field for uncommon protonation states. There is also a potential problem when adding hydrogens to non-experimental computer-generated structures.
fix
Be aware of these limitations when processing structures with uncommon CHARMM protonation states or non-experimental origins. Manual review of the output may be necessary.
affects: >=3.6.2
deprecatedThe web service provided by the National Biomedical Computation Resource (NBCR) was discontinued on April 30, 2020. Any tools or scripts (e.g., older Chimera integrations) that relied on this specific web service will no longer function unless PDB2PQR is installed locally and configured to use a local backend.
fix
Install PDB2PQR locally and configure any dependent tools to use the local executable instead of the discontinued NBCR web service. The official web service is now at `server.poissonboltzmann.org`.
affects: All versions (if relying on the NBCR web service)
Errors
Common errors & fixes
PDB2PQR could not successfully parameterize the desired ligand; it has been left out of the PQR file.
The ligand's atoms or residues are not recognized by the default or specified force field, preventing the assignment of charges and radii. This is common for custom or non-standard ligands and HETATM entries.
fix
Provide a user-defined force field using the `--userff` option, or ensure the ligand's MOL2 file (if using `--ligand`) has atom types and charges consistent with an available force field. Manually check and correct atom naming if it deviates from standard force field conventions.
FileNotFoundError: [Errno 2] No such file or directory: 'your_input.pdb'
The input PDB file specified in the command line does not exist at the provided path or the filename is incorrect.
fix
Verify that the PDB file exists and the full path, including the filename and extension (e.g., `.pdb`), is correctly provided to the `pdb2pqr` command. Ensure the current working directory is correct if using relative paths.
ValueError: 'P' is not in list
This specific error often occurs during ligand processing, particularly in `pdb2pqr/ligand/mol2.py`, when the code expects a phosphorus atom ('P') based on atom type and bonding information but cannot find it, often due to unusual ligand structures or incorrect atom typing in the MOL2 file.
fix
Review and potentially modify the ligand's MOL2 file to ensure atom types and formal charges are consistent. If the ligand genuinely lacks a phosphorus atom, this might indicate an incompatibility with `pdb2pqr`'s automated formal charge calculation for that specific atom environment. Consider manually verifying or simplifying the ligand's structure for processing.
CRITICAL:Unable to debump biomolecule. Biomolecular structure is incomplete: Found gap in biomolecule structure for atom ATOM X ...
PDB2PQR detected missing heavy atoms or a discontinuity (gap) in the backbone of the input protein structure, which prevents it from successfully rebuilding, optimizing hydrogen bonding, or debumping the molecule.
fix
Pre-process the input PDB file using other molecular modeling software to add missing heavy atoms, repair breaks in the backbone, or resolve ambiguities before running `pdb2pqr`. Ensure the PDB file represents a complete and continuous structure.
AttributeError: module 'pdb2pqr.aa' has no attribute 'RU'
PDB2PQR encountered a residue name (like 'RU' in the example) in the input PDB file that it does not recognize as a standard amino acid or nucleic acid within its internal residue definition modules. This usually happens with modified residues or non-standard components.
fix
Inspect the input PDB file for non-standard residue names. For modified or ligand residues, remove them from the PDB file or treat them separately using the `--ligand` option with a corresponding MOL2 file. Ensure all standard residues conform to common PDB nomenclature.
Upgrade
Version history
3.7.1latest on PyPI · released Dec 28, 2024
Audit
Dependencies
pythonrequiredRequired Python version as specified by the package metadata.
Agent activity
29 hits · last 30 days
node
24
OpenAI (training)
1
Resources
pdb2pqr — pip install pdb2pqr · libregistry