AMBER Archive (2005)

Subject: Re: AMBER: rounding in xleap when using saveoff command...

From: Wei Zhang (zweig_at_scripps.edu)
Date: Wed Nov 02 2005 - 13:34:10 CST


Hi Ilyas,

I think I have found the reason, it is because xleap use a "%1.4lf"
format to display and save charge. To fix it is easy, I think you
can do it by yourself, it is in file

    amber9/src/leap/src/leap/xaAtomTable.c

line 163:

    #define DBLFMT "%1.4lf"

replace it with

    #define DBLFMT "%10.6lf"

and if you want to show charge in more precision format via "charge"
command, you can modify file

    amber9/src/leap/src/leap/commands.c

line 2892-2894

VP0(( "Total unperturbed charge: %6.4lf\n", dCharge ));
/*dPertCharge is now the delta of the charge and not the actual
perturbed charge*/
VP0(( "Total perturbed charge: %6.4lf\n", (dCharge+dPertCharge) ));

replace %6.4lf with %10.6lf,

recompile and install xleap by

make
make install

I think it would fix your problem.

Please do tell me whether it works, since we may want to make a bugfix
for it.

Sincerely

Wei Zhang

On Fri, 2005-10-28 at 21:26 -0400, Ilyas Yildirim wrote:
> Dear All,
>
> I have calculated the RESP charges for some structures by doing
> multimolecular charge fitting. I followed the RESP protocol. I have
> created the .prepi files for these structures using the new RESP charges,
> and everything is fine; namely, the charges of each structure looks ok.
> (By ok, I mean the following: The RX5' and RX3' parts add to -1 while the
> intermediate residues (RX) have -1 charge) Then I have loaded these
> structures into xleap and entered the perturbed charge information (also
> the other parameters needed to do perturbation) in the "Edit Selected
> Atoms" window. In that window, I kept the "unused" parts blank. Then I
> have saved the structures using saveoff command. Here, I am copy/pasting
> some part of a file created:
>
> .
> .
> .
> "C6" "CM" 0 1 131073 29 6 -0.040620
> "H6" "H4" 0 1 131073 30 1 0.225025
> "C3'" "CT" 0 1 131073 31 6 0.176434
> "H3'" "H1" 0 1 131073 32 1 0.069871
> "O3'" "OH" 0 1 131073 33 8 -0.660896
> "H3T" "HO" 0 1 131073 34 1 0.442954
> !entry.RC3.unit.atomspertinfo table str pname str ptype int ptypex int
> pelmnt dbl pchg
> "P" "P" 0 -1 0.0
> "O1P" "O2" 0 -1 0.0
> "O2P" "O2" 0 -1 0.0
> "O5'" "OS" 0 -1 0.0
> "C5'" "CT" 0 -1 -0.001094
> "H5'1" "H1" 0 -1 0.002027
> "H5'2" "H1" 0 -1 0.002027
> "C4'" "CT" 0 -1 -0.028908
> "H4'" "H1" 0 -1 -0.000479
> .
> .
> .
>
> When I use the command "charge <name of the structure>", it is giving me
> the expected charge informations. As an example;
>
> > charge RC3
> Total unperturbed charge: -0.6805
> Total perturbed charge: -0.6805
> >
>
> or
>
> > charge RC
> Total unperturbed charge: -1.0000
> Total perturbed charge: -1.0000
> >
>
> Now, when I put the 'true' variable into the "unused" parts of the
> perturbed atoms (in the "Edit Selected Atoms" window), and saveoff the
> structures, the charges I see in the files are rounded off. As I an
> example, I am getting the following charges compared to the charges I
> copy/pasted above:
>
> .
> .
> .
> "C6" "CM" 0 1 131073 29 6 -0.040600
> "H6" "H4" 0 1 131073 30 1 0.225000
> "C3'" "CT" 0 1 131073 31 6 0.176400
> "H3'" "H1" 0 1 131073 32 1 0.069900
> "O3'" "OH" 0 1 131073 33 8 -0.660900
> "H3T" "HO" 0 1 131073 34 1 0.443000
> !entry.RC3.unit.atomspertinfo table str pname str ptype int ptypex int
> pelmnt dbl pchg
> "P" "P" 0 -1 0.0
> "O1P" "O2" 0 -1 0.0
> "O2P" "O2" 0 -1 0.0
> "O5'" "OS" 0 -1 0.0
> "C5'" "CT" 0 -1 -0.001100
> "H5'1" "H1" 0 -1 0.002000
> "H5'2" "H1" 0 -1 0.002000
> "C4'" "CT" 0 -1 -0.028900
> "H4'" "H1" 0 -1 -0.000500
> .
> .
> .
>
> The problem is when I check out the total charge of the structures. When I
> use the "charge" command in xleap for these .lib filed structures, I am
> getting the following results:
>
> > charge RC3
> Total unperturbed charge: -0.6805
> Total perturbed charge: -0.6806
> > charge RC
> Total unperturbed charge: -1.0000
> Total perturbed charge: -1.0001
> >
>
> In this example, the difference is small, but in some other examples, the
> difference is 0.0002 or 0.0003. This happens because of the roundoff. I
> wonder if I HAVE to use 'true' variables in the "Edit Selected Atoms"
> window (for the perturbed atoms) if I want to do perturbation simulation.
> If the answer is yes, how can I solve the problem I am having here?
> Thanks in advance.
>
> Best,
>

-- 
Wei Zhang <zweig_at_scripps.edu>
The Scripps Research Institute

----------------------------------------------------------------------- The AMBER Mail Reflector To post, send mail to amber_at_scripps.edu To unsubscribe, send "unsubscribe amber" to majordomo_at_scripps.edu