Hello,
In the function "gasiter" in charge.c
($AMBERHOME/AmberTools/src/antechamber), an integer "total charge" is
compared to a double "gas charge". This will only work if the total charge
calculated in the floating point number reaches exactly 3, but it's pretty
easy to make this fail. For example, using gcc, the result
3 == 0.0003 * 10000
returns False. Try changing the line
if(TotalGasCharge != netcharge) {
To
if(fabs(TotalGasCharge - (double) netcharge) < 1e-6) {
That should get rid of any minor roundoff error (maybe make the value of "0"
a little smaller if you're worried about a 1 x 10^-6 difference in charges).
Good luck!
Jason
On Wed, Aug 18, 2010 at 4:41 AM, Alan <alanwilter.gmail.com> wrote:
> This a sort of test I am doing and found something bizarre.
>
> I have an ARG tri-peptide (NARG-ARG-CARG), but pretend you don't know this,
> and I want to use antechamber to get its topology.
>
> BTW, I use tleap to create the peptide and then sander to optimise it.
>
> If I do:
>
> ------------------------------------------------------------------
> antechamber -i agRRR.mol2 -fi mol2 -o agRRR_bcc_amber.mol2 -fo mol2 -c bcc
> -nc 3 -m 1 -s 2 -df 2 -at amber -pf n
>
> Running: /Users/alan/Programmes/amber11/bin/bondtype -j full -i
> ANTECHAMBER_BOND_TYPE.AC0 -o ANTECHAMBER_BOND_TYPE.AC -f ac
>
> ---Judge bond type for Residue 1 with ID of 1 and Name of ARG ---
>
> Info: Bond types are assigned for valence state 1 with penalty of 1
>
> ---Judge bond type for Residue 2 with ID of 2 and Name of ARG ---
>
> Info: Bond types are assigned for valence state 15 with penalty of 1
>
> ---Judge bond type for Residue 3 with ID of 3 and Name of ARG ---
>
> Info: Bond types are assigned for valence state 15 with penalty of 1
>
> Running: /Users/alan/Programmes/amber11/bin/atomtype -i ANTECHAMBER_AC.AC0
> -o ANTECHAMBER_AC.AC -p amber
>
> Total number of electrons: 262; net charge: 3
>
> Running: /Users/alan/Programmes/amber11/bin/sqm -O -i sqm.in -o sqm.out
> ------------------------------------------------------------------
>
> Then parmchk and tleap etc.
>
> * It works. *
>
> But if I want to use Gasteiger charges:
>
> ------------------------------------------------------------------
> antechamber -i agRRR.mol2 -fi mol2 -o agRRR_gas_amber.mol2 -fo mol2 -c gas
> -nc 3 -m 1 -s 2 -df 2 -at amber -pf n
>
> Running: /Users/alan/Programmes/amber11/bin/bondtype -j full -i
> ANTECHAMBER_BOND_TYPE.AC0 -o ANTECHAMBER_BOND_TYPE.AC -f ac
>
> ---Judge bond type for Residue 1 with ID of 1 and Name of ARG ---
>
> Info: Bond types are assigned for valence state 1 with penalty of 1
>
> ---Judge bond type for Residue 2 with ID of 2 and Name of ARG ---
>
> Info: Bond types are assigned for valence state 15 with penalty of 1
>
> ---Judge bond type for Residue 3 with ID of 3 and Name of ARG ---
>
> Info: Bond types are assigned for valence state 15 with penalty of 1
>
> Running: /Users/alan/Programmes/amber11/bin/atomtype -i ANTECHAMBER_AC.AC0
> -o ANTECHAMBER_AC.AC -p amber
>
> Running: /Users/alan/Programmes/amber11/bin/atomtype -i
> ANTECHAMBER_GAS.AC-o
> ANTECHAMBER_GAS_AT.AC -d
> /Users/alan/Programmes/amber11/dat/antechamber/ATOMTYPE_GAS.DEF
>
> The net charge of the molecule (3) does not equal to the total charge (3.00
> ) based on Gasteiger atom type, exit
> ------------------------------------------------------------------
>
> This fails, since file agRRR_gas_amber.mol2 is not generated, so parmchk
> and
> tleap will never work.
>
>
> And if I use, for example babel, to get the Gasteiger charges in
> my agRRR.mol2, and do:
>
> antechamber -i agRRR.mol2 -fi mol2 -o agRRR_user_amber.mol2 -fo mol2 -c
> user
> -nc 3 -m 1 -s 2 -df 2 -at amber -pf n
>
> All works, with a tleap warning about the net charge generated by babel.
> >From tleap log:
>
> ------------------------------------------------------------------
> [snip]
> ERROR: The unperturbed charge of the unit: 2.969400 is not integral.
> WARNING: The unperturbed charge of the unit: 2.969400 is not zero.
>
> -- ignoring the error and warning.
> [snip]
> ------------------------------------------------------------------
>
> But I get the prmtop and inpcrd files in the end.
>
> So I am trying to understand why antechamber with gasteiger fails with an
> incomprehensible error message:
>
> "The net charge of the molecule (3) does not equal to the total charge
> (3.00
> ) based on Gasteiger atom type, exit"
>
> Sounds like I have decimal rounds off problems here?
>
> Many thanks,
>
> Alan
> --
> Alan Wilter S. da Silva, D.Sc. - CCPN Research Associate
> Department of Biochemistry, University of Cambridge.
> 80 Tennis Court Road, Cambridge CB2 1GA, UK.
> >>http://www.bio.cam.ac.uk/~awd28 <http://www.bio.cam.ac.uk/%7Eawd28><<
> _______________________________________________
> AMBER mailing list
> AMBER.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber
>
--
Jason M. Swails
Quantum Theory Project,
University of Florida
Ph.D. Graduate Student
352-392-4032
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Wed Aug 18 2010 - 07:30:04 PDT