-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in PQR parser #1855
Comments
Thank you. So, we should probably just use ranges for coordinates where they might lose the space and keep the field splitting with spaces for the rest. |
However, it seems like this could be a problem depending on the program too: |
I suppose we need some kind of check for how many fields we get by splitting with whitespace delimiting and what we get if we use the standard columns |
ok, I think I have a fix. Please try checking out the pqr_fix branch from https://github.com/jamesmkrieger/ProDy.git and testing a few files. I have tried some example lines from the ones you provided and they work. |
I haven't merged this branch as I don't have any unit tests yet, but I guess at some point I can make them from the example snippets you gave here. |
This looks like an appropriate fix to me. |
thank you |
paresPQR() TestI was able to test your fix this weekend. Your correction can't handle lines starting with HEADER, TER, CONECT, etc. because they don't have the same number of fields. Input PQR file
Error message
FixI moved your field splitting code so that it is only applied to ATOM and HETATM lines.
New fix applied to an example with no XYZ whitespaceparsePQR() input file
parsePQR() --> writePQR() output file
Other bugs in pdbfile.pyI used the writePQR() function to do some of my testing, but this function only works if an alpha carbon is present in the atom group. I added a try block in the writePQRstream() function to quickly get around this issue. Requiring an alpha carbon to write a PQR file seems like a bug to me. Quick fix writePQRstream():
|
Thank you very much! I’ll look over these in a month or so when I’m less busy |
(Closed it by accident) |
It looks like the last one should have the calphas line included in the try block |
ok, I've just added these two fixes to my branch and pull request too @atbogetti, it would still be great if you could check this more thoroughly |
Summary
The Prody PQR parser fails to parse PQR files that do not have white space between their data fields. I have encountered this issue when the XYZ coordinates have 3 digits in front of the decimal place and are negative.
Example: lines from a file that failed to parse
There is no whitespace between the Y and Z coordinates in this file, so Prody fails to parse it.
Fix
Currently, Prody is parsing PQR files differently than PDB files by splitting each line on whitespaces. (prody/proteins/pdbfile.py)
To avoid parsing issues Prody should parse PQR files by position/index which conforms to the file specification for a PQR file and matches other PQR parsers such as Biopython.
Caveat
It appears that different softwares write the charge and radius information in different positions. (This may be the reason why Prody chose to parse on whitespace from the beginning.)
The text was updated successfully, but these errors were encountered: