GithubHelp home page GithubHelp logo

electrostatics / pdb2pqr Goto Github PK

View Code? Open in Web Editor NEW
113.0 113.0 33.0 40.48 MB

PDB2PQR - determining titration states, adding missing atoms, and assigning charges/radii to biomolecules.

Home Page: http://www.poissonboltzmann.org/

License: Other

Python 99.93% Shell 0.07%
bioinformatics biophysics chemistry hacktoberfest

pdb2pqr's People

Contributors

eo300 avatar erikjensen avatar intendo avatar j3mdamas avatar karinaliles avatar keith923 avatar kmonson avatar kozlac avatar mchun0630 avatar mimminou avatar pzli3 avatar rkretsch avatar sobolevnrm avatar speleo3 avatar sphuber avatar stefdoerr avatar tonigi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pdb2pqr's Issues

Address user feedback on documentation

  • General usability of the software – starting with http://www.poissonboltzmann.org/, how difficult is it get up and running with useful biomolecular visualization?
    • I was not able to download the APBS and PDB software onto my laptop with Windows 10 and get it properly functioning, as I do not have experience with python and compiling codes. When I tried downloaded the software from the source forge sites (https://sourceforge.net/projects/pdb2pqr/, https://sourceforge.net/projects/apbs/reviews/), I could not find an exe file for APBS after unzipping it while I could find an executable for PDB but it would fail to open. From a novice perspective, a more user-friendly installation process could make the software more accessible.
    • I tested the PDB and APBS software on the web server with 3Dmol visualization and was able to run jobs and visualizations from the PDB databank easily.
  • Accuracy and completeness of the documentation – how difficult it is to follow the documentation at starting with http://www.poissonboltzmann.org/?
    • The documentation is generally easy to follow and has an enough information to get started. The documentation was also generally complete, though some links were not working perhaps due to the transferring of files. For instance, in the ligand parameterization example https://apbs-pdb2pqr.readthedocs.io/en/latest/examples/parameterizing-ligands.html, the “PRODRG web server” link was not working.
    • I also enjoyed the tutorials as these provided a good introduction for the programs’ capabilities. I noticed the format for the tutorials for PDB2QR and APBS differed from one another. That is, the tutorials for PDB2QR were generally point by point instructions with little background information, while the APBS tutorials contained a lot of background and conceptual information but then did not really outline steps as there were not as many calculation options (e.g., it was just the choice in calculation type). I found the documentation for the APBS tutorials more impactful because of the brief conceptual and theoretical explanations provided. The PDB2QR tutorial was also helpful in that it was a quick way to get introduced to the software, though the downside was that it was a bit of a blackbox approach.
    • I would’ve like to see documentation/links describing the different run conditions for the software. For instance, I could not find information on what the different calculation types in APBS were for. Again, as a novice, this information would enable users to dig deeper and determine what and how exactly they want their calculations to be performed.
  • What else would be useful in your use of the software?
    • As mentioned above, it would be nice to have a brief description of the different calculation options available, e.g., charm vs. amber vs. parse, etc.,
    • It would also potentially be nice to error codes. For instance, when I tried running PDB 1FAS example with a calculation type of “Fe manual” and I received an “error failed” message. A specific error code could perhaps be helpful for figuring out the details of the calculation, which the user could include if seeking help from the community.

PDB2PQR Unable to load parameter file for forcefield

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

Add NGL to available visualization tools

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.

http://arose.github.io/ngl/?plugin=apbs&pqr=http://arose.github.io/ngl/data/1crn_apbs.pqr&dx=http://arose.github.io/ngl/data/1crn_apbs_pot.dx.gz

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.

http://arose.github.io/ngl/?plugin=apbs&pqr=http://nbcr-222.ucsd.edu/opal-jobs/appapbs_1.31449321069277-2004040615/14493210441.pqr&dx=http://nbcr-222.ucsd.edu/pdb2pqr_2.0.0/tmp/14493210441/14493210441-pot-PE0.dx.gz

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...

Ligands with mol2 files are displaced from the proper coordinates after assigning charges.

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??

Handle nucleic acids with H-bonding

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

Need testing of ligand parameterization

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.

Address user feedback on documentation

  • Initially, it wasn’t clear if I needed to download or use the website
  • There doesn’t seem to be a link to download the ligand MOL2 for 1HPX or 1ABF. I don’t know if I was supposed to find that somewhere else?
  • I had a pretty hard time following the documentation – I could get it to do the initial PDB2PQR bit, but I couldn’t find the next steps – did I need to use with APBS? Because I did and I couldn’t find information on which setting I needed.
  • Titles on the visualization would be helpful so I know which protein I am looking at
  • Is there a way to visualize solvent accessible channels? Or zoom in on a binding pocket?

mmCIF based PQR format

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:

  • no whitespace and/or column alignment issues
  • every software which support mmCIF format could read those files

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

Alternative for the error: UnboundLocalError: local variable 'pH_opt' referenced before assignment

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.

Document PIP installation behavior of PDB2PQR

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)

installing pdb2pqr from apbs-pdb2pqr 3.0?

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:'

Add email address to PDB2PQR job submission form

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.

pdb2pqr git download not complete or inconsistent

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 PDB2PQR instance of PROPKA to 3.1

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.

Using APBS with coarse-grained models of proteins

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

'PotentialBond' comparison raises TypeError

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

pHs are not pKas

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!')

pdb2pqr runs not deterministic

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

Can these files be removed?

apbs/contrib/iapbs (is this used?)

  • pdb2pqr/visualize.cgi
  • pdb2pqr/SCons*
  • pdb2pqr/main_cgi.pyc
  • pdb2pqr/html
  • pdb2pqr/.htaccess
  • pdb2pqr/scons*
  • pdb2pqr/site_scons*
  • pdb2pqr/.variables.cache*
  • pdb2pqr/.scons.dblite*
  • pdb2pqr/build_config.py*
  • pdb2pqr/propka30
  • need to check that we have all builds and tests moved out of Scon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.