Skip to content
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

Proper check for PDB format #6

Closed
JoaoRodrigues opened this issue Aug 12, 2015 · 11 comments
Closed

Proper check for PDB format #6

JoaoRodrigues opened this issue Aug 12, 2015 · 11 comments

Comments

@JoaoRodrigues
Copy link
Contributor

Another little issue: when reading a PDB file that has trimmed lines (shorter than 80 characters), which is actually quite common when dealing with processed PDBs from other programs, freesasa fails to read any atom info but attributes the class 'unknown' for the calculations. This makes things extremely slow and isn't easy to figure out at first. I'd suggest you add a small check during the PDB reading routine to see not if any atoms were read (that is there) but if any were read properly. Otherwise, just set the line length to a minimum with occupancy as the last field.

@mittinatten
Copy link
Owner

Wasn't aware of this. Do you have any example files?

mittinatten added a commit that referenced this issue Aug 12, 2015
@mittinatten
Copy link
Owner

I think it is fixed now, committed a patch to the dev branch.

@JoaoRodrigues
Copy link
Contributor Author

Thanks! I can give you a test file for unit testing if necessary.

On Wed, Aug 12, 2015 at 11:37 AM, Simon Mitternacht
notifications@github.com wrote:

I think it is fixed now, committed a patch to the dev branch.

Reply to this email directly or view it on GitHub:
#6 (comment)

@mittinatten
Copy link
Owner

Yes that would be good, thanks!

@JoaoRodrigues
Copy link
Contributor Author

Here.

Running it gives this output:

## freesasa 0.1.1 ##
name: 3BZD.pdb
algorithm: Shrake & Rupley
probe-radius: 1.400000 A
n_thread: 1
n_testpoint: 100
time_elapsed: 41.485172 s
n_atoms: 2754

Total:   69762.71 A2
Polar:       0.00 A2
Apolar:  69762.71 A2

Fixing the lines and re-running:

## freesasa 0.1.1 ##
name: 3BZD_fixed.pdb
algorithm: Shrake & Rupley
probe-radius: 1.400000 A
n_thread: 1
n_testpoint: 100
time_elapsed: 0.090440 s
n_atoms: 2754

Total:   16064.83 A2
Polar:    8599.18 A2
Apolar:   7465.65 A2

@mittinatten
Copy link
Owner

With my patch the calculation runs normally and gives the same result for the trimmed file you provided, and one that I "fixed" by adding whitespace at the end of each line. But I my results are, in both cases,

Total:   15955.55 A2
Polar:    6543.36 A2
Apolar:   9412.19 A2

Any chance a line was deleted or duplicated or something in your 3BZD_fixed.pdb? Or have you been customizing atomic radii maybe?

@JoaoRodrigues
Copy link
Contributor Author

The PDB file is just padded so that each line has 80 characters.

I did a fresh cloning of your master branch and ran it on the same 2 structures. I get different (although not 0) values for the classes:

joao@jr-mbp:src$ ./freesasa ~/Downloads/3BZD.pdb
## freesasa 0.1.1 ##
name: /Users/joao/Downloads/3BZD.pdb
algorithm: Shrake & Rupley
probe-radius: 1.400000 A
n_thread: 1
n_testpoint: 100
time_elapsed: 36.049243 s
n_atoms: 2754

Total:   74753.07 A2
Polar:     963.12 A2
Apolar:  73789.95 A2
joao@jr-mbp:src$ ./freesasa ~/Downloads/3BZD_fixed.pdb
## freesasa 0.1.1 ##
name: …ao/Downloads/3BZD_fixed.pdb
algorithm: Shrake & Rupley
probe-radius: 1.400000 A
n_thread: 1
n_testpoint: 100
time_elapsed: 0.090429 s
n_atoms: 2754

Total:   15955.55 A2
Polar:    6543.36 A2
Apolar:   9412.19 A2

@mittinatten
Copy link
Owner

Ok, but then we get consistent results. I added your file to the unit tests. Thanks for pointing this out!

@mittinatten
Copy link
Owner

Will add it to the master branch within a few days. In the mean-time you can change the number 78 to 54 on line 66 in pdb.c if you don't want to use the dev branch.

@JoaoRodrigues
Copy link
Contributor Author

Thanks!

@mittinatten
Copy link
Owner

Decided to add it as a minor release 0.1.2 in master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants