# AMBER Archive (2008)Subject: Re: AMBER: mmpbsa molsurf.c error

From: Ilyas Yildirim (yildirim_at_pas.rochester.edu)
Date: Thu Sep 04 2008 - 19:45:58 CDT

I think there is some kind of a bug in MMPBSA's approach on calculating
the molecular surface. The problem looks to be related to rounding of
numbers.

In molsurf.c file, sarg1 is calculated as follows:

------------------
probe_diam) - d_ij * d_ij;
-----------------

When I print out the values of sarg1, ai, aj, probe_diam, and d_ij I get
the following values respectively (as well as the error message):

------------------
-0.0000000000000002949029909 2.9500000000000001776356839
3.1000000000000000888178420 0.0000000000000000000000000
6.0500000000000007105427358
molsurf: molsurf.c:1075: is_buried: Assertion `sarg1 >= 0.0' failed.
------------------

When the function "assert( sarg1 >= 0.0 )" checks sarg1, it fails to
recognize it to be equal to zero.

I added the following code to round sarg1 to 6 decimal points when sarg1
is less than zero.

----------------------
/* For rounding to 6 decimal points in case sarg1 < 0 */
if(sarg1 < 0){
REAL_T check1 = sarg1;
REAL_T check2 = 0, check3 = fabs(modf( check1 * 1000000, &check2)) ;
REAL_T check4 = (floor(check1 * 1000000) + (check3 < 0.5 ? 1 : 0 ))/1000000;
sarg1 = check4;
}

assert( sarg1 >= 0.0 );
assert( sarg2 >= 0.0 );
----------------------

This solves the error problem. My assumption here is that a number for
sarg1 like -0.0000000000000002949029909 means essentially zero. Therefore
we can make a rounding the way described above. Any ideas/suggestions are
welcome.

Best regards,

On Wed, 3 Sep 2008, Ilyas Yildirim wrote:

> find a solution. I tried the suggestions given in the following page, but
> did not work.
>
> http://amber.ch.ic.ac.uk/archive/200605/0068.html
>
> So, let me explain the problem. I have a system which I decomposed to
> complex/ligand/receptor. I am trying to use mmpbsa approach to get the
> binding free energies following the tutorial # 3. Normally, I have over
> 200 structures to analyze, but for one or two structures I am getting the
> following error:
>
> molsurf: molsurf.c:1063: is_buried: Assertion `sarg1 >= 0.0' failed.
>
> So, I am trying to understand what the problem is with this particular
> structure. I followed David Case's suggestion to print out the
> radius/sarg1/probe_diam/etc. values prior to the error by including
>
> -------------------------
> if(sarg1 <0) {
> }
> -------------------------
> When I re-run mm_pbsa.pl script, I am getting the following error:
>> -------------------------
> -0.000 2.950 3.100 0.000 6.050
> molsurf: molsurf.c:1063: is_buried: Assertion
> `sarg1 >= 0.0' failed.
> Aborted
> -0.000 2.950 3.100 0.000 6.050
> molsurf: molsurf.c:1063: is_buried: Assertion
> `sarg1 >= 0.0' failed.
> Aborted
> -------------------------
>
> The structure looks pretty normal, and the printed out value for sarg1
> should not create any problem with the mm_pbsa.pl script (it is 0.0), yet
> the script gives an error. I created a -pqr file using ambpdb and checked
> out that structure (and the values). They look pretty normal. Also, when I
> used molsurf on this .pqr file, I did not get any error message. So, I
> am clueless at this point on what is causing the problem in MMPBSA
> module. Any help is greatly appreciated. Thanks.

```--
Ilyas Yildirim
---------------------------------------------------------------
= Department of Physics        -                              =
= University of Rochester      -                              =
= 585-275-6766 (office)        - 585-267-5644 (home)          =
= http://www.pas.rochester.edu/~yildirim/                     =
---------------------------------------------------------------
-----------------------------------------------------------------------
The AMBER Mail Reflector
To post, send mail to amber_at_scripps.edu
To unsubscribe, send "unsubscribe amber" (in the *body* of the email)
to majordomo_at_scripps.edu
```