electrostatics / pdb2pqr Goto Github PK
View Code? Open in Web Editor NEWPDB2PQR - determining titration states, adding missing atoms, and assigning charges/radii to biomolecules.
Home Page: http://www.poissonboltzmann.org/
License: Other
PDB2PQR - determining titration states, adding missing atoms, and assigning charges/radii to biomolecules.
Home Page: http://www.poissonboltzmann.org/
License: Other
This is a feature request. It would be great if pdb2pqr and apbs could replace the PQR format with a modified mmCIF based format which simply adds a charge (e.g. _atom_site.pqr_partial_charge
) and a radius column (e.g. _atom_site.pqr_radius
).
Advantages over current PQR format:
Example which demonstrates that the change could be very minimal. In fact, this file loads correct into PyMOL as PQR and as CIF format (the latter currently simply ignores the added columns, but it would be trivial to add support for them).
data_pqr
_pqr_header.remarks
;
REMARK 1 PQR file generated by PDB2PQR (Version master)
REMARK 1
REMARK 1 Command line used to generate this file:
REMARK 1 --chain --ff=AMBER alagly.pdb alagly.pqr
REMARK 1
REMARK 1 Forcefield Used: AMBER
REMARK 1
REMARK 5
REMARK 6 Total charge on this protein: 0.0000 e
REMARK 6
;
loop_
_atom_site.group_PDB
_atom_site.id
_atom_site.label_atom_id
_atom_site.label_comp_id
_atom_site.label_asym_id
_atom_site.label_seq_id
_atom_site.Cartn_x
_atom_site.Cartn_y
_atom_site.Cartn_z
_atom_site.pqr_partial_charge
_atom_site.pqr_radius
ATOM 1 N ALA A 1 -0.677 -1.230 -0.491 0.1414 1.8240
ATOM 2 CA ALA A 1 -0.001 0.064 -0.491 0.0962 1.9080
ATOM 3 C ALA A 1 1.499 -0.110 -0.491 0.6163 1.9080
ATOM 4 O ALA A 1 2.030 -1.227 -0.502 -0.5722 1.6612
ATOM 5 CB ALA A 1 -0.509 0.856 0.727 -0.0597 1.9080
ATOM 6 H2 ALA A 1 -1.253 -1.311 -1.308 0.1997 0.6000
ATOM 7 H3 ALA A 1 0.003 -1.967 -0.492 0.1997 0.6000
ATOM 8 H ALA A 1 -1.251 -1.312 0.327 0.1997 0.6000
ATOM 9 HA ALA A 1 -0.272 0.568 -1.322 0.0889 1.1000
ATOM 10 HB1 ALA A 1 0.003 0.575 1.535 0.0300 1.4870
ATOM 11 HB3 ALA A 1 -0.374 1.830 0.562 0.0300 1.4870
ATOM 12 HB2 ALA A 1 -1.479 0.666 0.858 0.0300 1.4870
ATOM 13 N GLY A 2 2.250 0.939 -0.479 -0.3821 1.8240
ATOM 14 CA GLY A 2 3.700 0.771 -0.479 -0.2493 1.9080
ATOM 15 C GLY A 2 4.400 2.108 -0.463 0.7231 1.9080
ATOM 16 O GLY A 2 3.775 3.173 -0.453 -0.7855 1.6612
ATOM 17 OXT GLY A 2 5.615 2.369 -0.458 -0.7855 1.6612
ATOM 18 H GLY A 2 1.784 1.852 -0.470 0.2681 0.6000
ATOM 19 HA2 GLY A 2 3.972 0.236 0.331 0.1056 1.3870
ATOM 20 HA3 GLY A 2 3.974 0.254 -1.301 0.1056 1.3870
The apbs input files creating during pdb2pka runs use a grid that is way too coarse.
apbs/contrib/iapbs (is this used?)
Hello PDB2PQR Team,
during protonation with the flag --protonate-all the following TypeError is raised:
apbs-pdb2pqr/pdb2pqr/pdb2pqr/utilities.py, line 26, in sort_dict_by_value: items.sort() TypeError: '<' not supported between instances of 'PotentialBond' and 'PotentialBond'
Since you are sorting tuples at this point in the code this might be interesting to you: https://stackoverflow.com/questions/5292303/how-does-tuple-comparison-work-in-python
I think the TypeError appears when the first element (distance in your case) of some pair of tuples is equal. Then the second element will be compared. Since the second element is an instance of 'PotentialBond' and the comparison operator is not implemented an error is raised.
Changing items.sort()
to items.sort(key = lambda x: x[0])
in apbs-pdb2pqr/pdb2pqr/pdb2pqr/utilities.py, line 26
works. Does this alter the intended behavior?
Cheers,
Daniel
One example is the PDB2PKA graph clique-finding code?
https://www.python.org/dev/peps/pep-0008/ or similar
Dear APBS community,
I would like to know if APBS can be used with coarse-grained protein structures (for example protein models with one pseudo-atom per residue) for which I know the relevant quantities such as pseudo-atom radii and charges. It seems that the PQR file format should be flexible enough to do it. However, I am not sure if during calculation APBS expects to find conventional atoms for each given protein residue.
Any guidance to be able to set up the calculation of the electrostatic potential surface of a generic coarse-grained protein model is highly appreciated.
Thank you and keep up with the good work!
Fabio
We don't handle nucleic acids with H-bonding right now, but, this user's code below will be a good starting place.
"I think I traced this back to the structures.py, where it defined the acceptor types. I am not sure whether it should be defined as N's in DNA with 2 bonds and C or A, or whether it should be <3 bonds (ie. if a single bond to an N would allow it to hydrogen bond to 2 other atoms). The reason I included G was to pick up the N7 position (the A also has it). The A&C have the N3 position, which is the standard place DNA hbonds.
I just wanted to let you guys know so if you want to include this fix in the next release, that would be great (also, I am not 100% on all of the objects, so if there were a DNA object or something, that would be good to minimize the possibility of screwing up other code)."
if atomname.startswith("N"):
bonded = 0
for bondedatom in atom.bonds:
if bondedatom.isHydrogen():
atom.set("hdonor",1)
bonded = 1
break
if not bonded and self.reference.name == "HIS":
atom.set("hacceptor",1)
###### I ADDED THIS CODE ######
elif not bonded and len(atom.bonds) == 2 and \
(self.reference.name == "C" or self.reference.name == "A" or self.reference.name == "G"):
atom.set("hacceptor",1)
##########################
elif atomname.startswith("O") or \
(atomname.startswith("S") and self.reference.name == "CYS"):
atom.set("hacceptor",1)
for bondedatom in atom.bonds:
if bondedatom.isHydrogen():
atom.set("hdonor",1)
break
The --ph-calc-method option is incorrect. It should be --pka-calc-method. I've attached a main.py that may fix some of this (at least the problems with the option name and description).
Here's a fixed description but it should be fixed elsewhere, too:
pka_group.add_option('--pka-calc-method', dest='pka_calc_method', metavar='PH_METHOD', choices=('propka', 'pdb2pka'), help='Method used to calculate pKa values. If a pKa calculation method is selected, titratable residue pKa values will be calculated and the residue potentially modified after comparison with the pH value supplied by --with_ph\n' 'propka - Use PROPKA to calculate pKa values. Actual PROPKA results will be output to <output-path>.propka.\n' 'pdb2pka - Use PDB2PKA to calculate pKa values. Requires the use of the PARSE force field.' 'Warning: Larger residues can take a very long time to run using this method. EXPERIMENTAL!')
Lots of bare exceptions in cif.py lead to confusing debugging.
PDB2PQR fails to find the dat
folder when running from outside the source folder with error:
$ raise RuntimeError("Unable to load parameter file for forcefield %s" % args.ff)
$ RuntimeError: Unable to load parameter file for forcefield charmm
Move http://www.poissonboltzmann.org/docs/pdb2pqr-programmers/ into the PDB2PQR repo
Apparently pdb2pqr results depend on hash ordering, which is platform-dependent. If you run 3PTB with -R (randomize hashes), HIS 91 turns out to be HID/HIE at random (roughly 50%). This becomes an issue under Python 3, which has random hashes on by default.
To check:
for i in `seq 10`; do python2 -R main.py --with-ph=7.0 --ff=parse 3PTB.pdb py2-$i.pqr; done
grep -c "HD1 HIS 91" py2-*.pqr
T
Need to cache information in loggingFilter and extract during PQR output.
There is at least one bug in hydrogens.py related to improper variable setting and/or break from loops.
See the following line for context:
See tests/ligand_test.py::test_bad_bonds
for examples.
Add email address to PDB2PQR job submission form and email them a link to the results page for their job. This will allow users to close their web browser for long calculations and retrieve the results later.
@Eo300 is probably the best person to tackle this.
@sobolevnrm is going to get a jump start on this by removing the pdb2pqr/html/
directory to partially address Electrostatics/apbs-pdb2pqr#537
Currently only have 1 test tied to PROPKA functionality that compares to known result.
Adding two more tests for ligands but not compared to known result.
I think inputgen.py and psize.py are still important for the web server version of PDB2PQR. However, we appear to have no test coverage of these modules.
Hi, I was using the pdb2pqr server to convert my pdb file to pqr file, using PROPKA to assign protonation states at pH 7 (AMBER selected as forcefield and for output naming). But the calculation ended with this error message in the file stderr from the server:
Traceback (most recent call last):
File "/opt/pdb2pqr_2.1.1/pdb2pqr.py", line 62, in <module>
mainCommand(sys.argv)
File "main.py", line 740, in mainCommand
File "main.py", line 339, in runPDB2PQR
File "src/routines.py", line 1596, in runPROPKA
File "propka30/Source/protein.py", line 581, in writePKA
File "propka30/Source/output.py", line 174, in writePKA
File "propka30/Source/output.py", line 283, in getFoldingProfileSection
File "propka30/Source/protein.py", line 629, in getPHopt
UnboundLocalError: local variable 'pH_opt' referenced before assignment
Then I downloaded apbs-pdb2pqr from this repository and, after the installation, I run pdb2pqr locally, trying to use the minor amount of parameters possible with the following command:
python pdb2pqr.py --ff=AMBER --with-ph=7.0 --ph-calc-method=propka --ffout=AMBER GDH454.pdb GDH454_pka.pqr
But, this created an empty file "GDH454_pka.propka" and return the following error:
writing pkafile GDH454_pka.propka
Traceback (most recent call last):
File "/home/pgaray/Programas/apbs-pdb2pqr/pdb2pqr/pdb2pqr.py", line 62, in <module>
mainCommand(sys.argv)
File "/home/pgaray/Programas/apbs-pdb2pqr/pdb2pqr/main.py", line 740, in mainCommand
include_old_header = options.include_header)
File "/home/pgaray/Programas/apbs-pdb2pqr/pdb2pqr/main.py", line 339, in runPDB2PQR
myRoutines.runPROPKA(ph, ff, outroot, pkaname, ph_calc_options)
File "/home/pgaray/Programas/apbs-pdb2pqr/pdb2pqr/src/routines.py", line 1596, in runPROPKA
myPkaProtein.writePKA(options=options, filename=outname)
File "/home/pgaray/Programas/apbs-pdb2pqr/pdb2pqr/propka30/Source/protein.py", line 581, in writePKA
output.writePKA(self, filename=filename, reference=reference, direction=direction, options=options)
File "/home/pgaray/Programas/apbs-pdb2pqr/pdb2pqr/propka30/Source/output.py", line 174, in writePKA
str += getFoldingProfileSection(protein, reference=reference, direction=direction, window=[0., 14., 1.0], options=options)
File "/home/pgaray/Programas/apbs-pdb2pqr/pdb2pqr/propka30/Source/output.py", line 283, in getFoldingProfileSection
pH, dG = protein.getPHopt()
File "/home/pgaray/Programas/apbs-pdb2pqr/pdb2pqr/propka30/Source/protein.py", line 629, in getPHopt
self.property["pH-opt"] = [pH_opt, dG_opt]
UnboundLocalError: local variable 'pH_opt' referenced before assignment
How you can see is the same error obtained from the server.
Searching in the file "apbs-pdb2pqr/pdb2pqr/propka30/Source/protein.py" I found that the variable pH_opt
wasn't created before line 629 because in the previous if
the condition dG < dG_opt
never was achieved (line 627). So, changing the previous assignation in the values of dG_opt
from 999.
to 999999.
(little exaggeration) the error can be avoided and I got the corresponding pqr file, using the same command that I mentioned before. I suppose that this happens because I have a tetrameric protein and the default value of dG_opt
isn't big enough to get a result from propka.
I don't know if this is a useful practice and I know this error was mentioned in another Issue Electrostatics/apbs-pdb2pqr#466, but maybe it is useful for avoiding this error in the server, or if somebody gets the same error when running this repository locally.
Regards.
Too many data/parameter files in APBS/PDB2PQR use their own bespoke format, generating code bloat for parsing. It would be good to standardize on a readable (e.g., not XML) format that has simple support through Python. Possibilities include JSON (https://docs.python.org/3/library/json.html) or Python config format (https://docs.python.org/3/library/configparser.html). Comments are a bit more straightforward in the latter.
git clone https://github.com/Electrostatics/apbs-pdb2pqr.git
cd apbs-pdb2pqr/pdb2pqr
TOPDIR=/usr/common/modules/el8/x86_64/software/pdb2pqr/0.0.0-CentOS-vanilla
cp build_config.py build_config.py.dist
extract -in build_config.py.dist -out build_config.py \
-if '#PREFIX="~/pdb2pqr"' -fmt "PREFIX=\"$TOPDIR\""
#note, converted from \r\n to \n
python2 scons/scons.py 2>&1 | tee build_2020_04_21.log
#fails with:
scons: *** [html/server.html] Source `html/server.html.in' not found, needed by target `html/server.html'.
scons: building terminated because of errors.
The entire html subdirectory is missing. Either the build needs to ignore it or the download needs to supply it.
Upgrade to PROPKA 3.1.
3.0 and 3.1 are generally more strict in what they will accept from a user. 3.1 seems to be a little more forgiving (or more complete, but whatever). There are two known users cases. One would be resolved by an upgrade to 3.1, the other would not. Both work in 1.0.
Follow standard docstring format (e.g., Google)
The import * are inhibiting refactoring.
See tests/ligand_test.py::test_bad_rings
for example.
@intendo or @kozlac - would you be willing to develop some outputs for PEOE
and calcchi
as performing in PDB2PQR 2.1.1 https://github.com/Electrostatics/apbs-pdb2pqr/blob/433a1984a632b396bda11416b757d00e4ef5189e/pdb2pqr/pdb2pka/ligandclean/peoe_PDB2PQR.py ? I'd like to develop some regression tests for the branch I'm working on.
Thank you!
Added some new changes so that we can find the /dat folder regardless of where pdb2pqr is being run. Also, I added the setup.py script so that we can run pdb2pqr as a module. I'm excluding pdb2pka from the installation for now. And now that I remember I may be missing some dependencies in the setup script.
The building and installation are the same as propka:
$ cd pdb2qqr
$ python3 -m pip install --upgrade .
$ python3 -m pdb2pqr [flags|options] <file_name>.pdb <file_name>.pqr
Is this documented anywhere? If not, can we add the documentation?
Note that for development, we probably want to suggest pip install -e .
.
Originally posted by @sobolevnrm in Electrostatics/apbs-pdb2pqr#605 (comment)
@sobolevnrm - add list of proteins
This is a very important set of implicit solvent parameters that is currently missing from PDB2PQR.
We need to add a link to the Visualization landing page on the server to also view results in NGL.
Instructions from Alexander:
Liz made the suggestion to link from the APBS results page to the NGL
Viewer web app. I looked into it and pushed a few adjustments out. Now
you can pass urls to a pqr and dx file as GET parameters to load and
display them automatically. In the following example the files are
loaded from my github.io site.
This works from any server that has set the
"Access-Control-Allow-Origin" header for the files. This is a security
measure by modern browsers to prevent gathering e.g. cookie data which
is sent with every request. Quite annoying if you ask me, they should
have just disallowed sending cookies by default to resources from
foreign domains, but not plain data. Anyway, that header is not set on
the UCSD server and raises an error in the browser console.
XMLHttpRequest cannot load
http://nbcr-222.ucsd.edu/pdb2pqr_2.0.0/tmp/14493210441/14493210441-pot-PE0.dx.gz.
No 'Access-Control-Allow-Origin' header is present on the requested
resource. Origin 'http://arose.github.io' is therefore not allowed
access.
XMLHttpRequest cannot load
http://nbcr-222.ucsd.edu/opal-jobs/appapbs_1.31449321069277-2004040615/14493210441.pqr.
No 'Access-Control-Allow-Origin' header is present on the requested
resource. Origin 'http://arose.github.io' is therefore not allowed
access.
There is good information at http://enable-cors.org/ on how to set the
headers on various servers.
If enable a link to NGL in a release by default I think it might be a
good idea if you do not link directly to my github.io site but to a page
you control that redirects to the github.io page. That way you can
easily change the redirect target if it becomes necessary.
There is some other issue that might arise. Modern browser do not allow
"mixed content" that is when a resource loaded from HTTPS loads content
from HTTP. My site on github.io can also be retrieved via HTTPS but the
UCSD server only supports HTTP. So when some security aware person has a
browser add-on installed that tries to use HTTPS anywhere, my github.io
site will be loaded from HTTPS and is then unable to retrieve anything
from the UCSD server...
Attempt to modernize API documentation--at least for PDB2PQR.
The current apbs-pdb2pqr 3.0 release doesn't appear to perform any installations for pdb2pqr. Using...
$ mkdir build
$ cd build
$ cmake -DENABLE_PYTHON=ON -DCMAKE_C_FLAGS="-fPIC" ..
$ cmake --build .
however it is unclear how the 'built' pdb2pqr is supposed to be installed. Certainly executing...
PYTHONPATH=propka31 python3.8 -m pytest
fails with...
/opt/local/bin/python3.8: No module named pytest
despite apbs-3.0.0/pdb2pqr/README.md claiming that 'Testing can happen from this directory:'
Hello,
I ran a job with the 3WIP acetylcholinesterase enzyme on both the old web server and the new updated web server. For this job I created a mol2 file for the ACH ligand using the PRODRG web tool and asked that parameters be generated for the ligand as well. When the job completes the XYZ coordinates for the ligand in the PQR file do not match that of the XYZ coordinates in the PDB file, and thus the ligand is no longer in the pocket.
I also tested the 5GV7 system with a mol2 file for the ligand as well on both servers and the same result was observed, i.e. the ligand has moved from the proper coordinate position.
With 1HPX and using chimera to generate a mol2 file, ligand is in the incorrect spot as well. Not as bad as the previous two examples I tried, but still not correct.
Using 1ABF with a mol2 file for the ligand using the PRODRG web tool, leads to the ligand in the incorrect spot.
Is there a way to keep the ligand in the correct spot??
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.