Re: [AMBER] [Potencjalny SPAM] Re: MCPB.py Error at Step 2: TypeError with numpy.complex128 in angle parameter generation

From: maciej.spiegel via AMBER <amber.ambermd.org>
Date: Fri, 01 Aug 2025 21:34:26 +0200

Hello Zhen,

Thanks for the suggestion—that’s a helpful perspective.

I need to stick with the Seminario method for this project, so it seems
I’ll have to tweak the approach a bit—not only because of the imaginary
frequency, but also because Pt appears to break its bond with the O atom
from H₂O, which might be the root cause of the issue I encountered in
TLeap.

Cheers,
Maciej

W dniu 2025-08-01 20:27, Li, Zhen napisał(a):
> Hi Maciej,
>
> I am afraid that this "discarding imaginary" message is a bad sign.
> This likely means the Gaussian analysis from step 1 generates
> imaginary frequencies. This means that either the small or the large
> model is not being calculated correctly by the QM package.
>
> There are several walk-around, and one of them, according to Q2.2 of
> the MCPB.py FAQ page [1], is to use Z-matrix or empirical methods to
> generate force constants. To use them, simply call MCPB.py -i <your
> input file> -s 2z (for Z-matrix method) or MCPB.py -i <your input
> file> -s 2e (for empirical method).
>
> If it is still failing, a revisit of the Gaussian calculation may be
> needed.
>
> Best regards,
>
> Zhen.
>
> _____________________
>
> Zhen Li [2], Ph.D.,
>
> The Merz Research Group [3],
>
> Michigan State University,
>
> Cleveland Clinic.
>
> -------------------------
>
> From: maciej.spiegel via AMBER <amber.ambermd.org>
> Sent: Friday, August 1, 2025 2:13 PM
> To: Jeffrey Wagner <jwagnerjpl.gmail.com>
> Cc: AMBER Mailing List <amber.ambermd.org>
> Subject: Re: [AMBER] MCPB.py Error at Step 2: TypeError with
> numpy.complex128 in angle parameter generation
>
> Hi Jeff,
> Thanks, I got it working — unless the following message is a bad
> omen:
>
> "/mnt/storage_2/project_data/pl0251-02/bin/miniconda3/envs/AmberTools24/lib/python3.13/site-packages/pymsmt/mcpb/gene_final_frcmod_file.py:166:
>
> ComplexWarning: Casting complex values to real discards the imaginary
> part print('%8s %7.2f %7.2f %-s' %(angtyp,param[0], param[1],
> note), file=finfrcmod)"
>
> Moreover, tleap step fails now with several issues:
>
> """
> /mnt/storage_2/project_data/pl0251-02/bin/miniconda3/envs/AmberTools24/bin/teLeap:
>
> Error!
> Could not find bond parameter for atom types: Y4 - HO
> for atom O at position -1.116000, 0.112000, -3.037000
> and atom H1 at position -1.336000, -0.804000, -3.283000.
>
> /mnt/storage_2/project_data/pl0251-02/bin/miniconda3/envs/AmberTools24/bin/teLeap:
>
> Error!
> Could not find bond parameter for atom types: HO - Y4
> for atom H at position -2.016000, 0.519000, -2.641000
> and atom O at position -1.116000, 0.112000, -3.037000.
> Building angle parameters.
>
> /mnt/storage_2/project_data/pl0251-02/bin/miniconda3/envs/AmberTools24/bin/teLeap:
>
> Error!
> Could not find angle parameter for atom types: HO - Y4 - HO
> for atom H at position -2.016000, 0.519000, -2.641000,
> atom O at position -1.116000, 0.112000, -3.037000,
> and atom H1 at position -1.336000, -0.804000, -3.283000.
> Building proper torsion parameters.
> Building improper torsion parameters.
> total 8 improper torsions applied
> Building H-Bond parameters.
> Incorporating Non-Bonded adjustments.
>
> /mnt/storage_2/project_data/pl0251-02/bin/miniconda3/envs/AmberTools24/bin/teLeap:
>
> Warning!
> Parameter file was not saved.
> Solute vdw bounding box: 13.217 8.896 10.247
> Total bounding box for atom centers: 33.217 28.896 30.247
> Solvent unit box: 18.865 18.478 19.006
> Total vdw box size: 36.472 32.030 33.355
> angstroms.
> Volume: 38965.483 A^3
> Total mass 15504.078 amu, Density 0.661 g/cc
> Added 831 residues.
>
> /mnt/storage_2/project_data/pl0251-02/bin/miniconda3/envs/AmberTools24/bin/teLeap:
>
> Warning!
> addIons: 1st Ion & target unit have charges of the same sign:
> unit charge = 0.999998; ion1 charge = 1;
> can't neutralize.
> 1 Cl- ion required to neutralize.
> Adding 1 counter ions to "mol" using 1A grid
> Grid extends from solute vdw + 2.36 to 8.31
> Resolution: 1.00 Angstrom.
> Solvent present: replacing closest with ion
> when steric overlaps occur
> Calculating grid charges
> (Replacing solvent molecule)
> Placed Cl- in mol at (-4.14, 2.14, -4.40).
>
> Done adding ions.
> Writing pdb file: CIX_solv.pdb
> printing CRYST1 record to PDB file with box info
> Checking Unit.
>
> /mnt/storage_2/project_data/pl0251-02/bin/miniconda3/envs/AmberTools24/bin/teLeap:
>
> Note.
> Ignoring the warnings from Unit Checking.
>
> Building topology.
> Building atom parameters.
> Building bond parameters.
>
> /mnt/storage_2/project_data/pl0251-02/bin/miniconda3/envs/AmberTools24/bin/teLeap:
>
> Error!
> Could not find bond parameter for atom types: Y4 - HO
> for atom O at position -1.144589, -0.137137, -3.112954
> and atom H1 at position -1.364589, -1.053137, -3.358954.
>
> /mnt/storage_2/project_data/pl0251-02/bin/miniconda3/envs/AmberTools24/bin/teLeap:
>
> Error!
> Could not find bond parameter for atom types: HO - Y4
> for atom H at position -2.044589, 0.269863, -2.716954
> and atom O at position -1.144589, -0.137137, -3.112954.
> Building angle parameters.
>
> /mnt/storage_2/project_data/pl0251-02/bin/miniconda3/envs/AmberTools24/bin/teLeap:
>
> Error!
> Could not find angle parameter for atom types: HO - Y4 - HO
> for atom H at position -2.044589, 0.269863, -2.716954,
> atom O at position -1.144589, -0.137137, -3.112954,
> and atom H1 at position -1.364589, -1.053137, -3.358954.
> Building proper torsion parameters.
> Building improper torsion parameters.
> total 8 improper torsions applied
> Building H-Bond parameters.
> Incorporating Non-Bonded adjustments.
>
> /mnt/storage_2/project_data/pl0251-02/bin/miniconda3/envs/AmberTools24/bin/teLeap:
>
> Warning!
> Parameter file was not saved.
> Quit
> """
>
> W dniu 2025-08-01 18:18, Jeffrey Wagner napisał(a):
>> Hi Maciej,
>>
>> I've never used MCPB but we're seeing some issues in ParmEd arising
>> from last month's numpy 2.3 release. Downgrading to a 2.2.X version
> is
>> helping people get around some of those errors and may also help
> here.
>>
>>
> https://urldefense.com/v3/__https://github.com/ParmEd/ParmEd/issues/1406__;!!HXCxUKc!3EmOwMQTNcBv6X6yX-Z13ud6T7ex8pb-68_akEQGUMHknLeEU2YPhK6cXJLHQRLm3Q-zELe-xfShoBMFP4c8MZs$
> [4]
>>
>> Cheers,
>> Jeff
>>
>> On Fri, Aug 1, 2025 at 8:24 AM maciej.spiegel via AMBER
>> <amber.ambermd.org> wrote:
>>
>>> Hello Everyone,
>>>
>>> I am following the MCPB.py tutorial and encountered an error at the
>>> step:
>>> "MCPB.py -i MCPB.in -s 2"
>>>
>>> The program starts as expected and parses the input successfully,
>>> but
>>> then fails during the angle parameter generation using the
> Seminario
>>>
>>> method, with the following error:
>>>
>>> """
>>> ******************************************************************
>>> * Welcome to use the MCPB.py program *
>>> * Version 2024 *
>>> * Author: Pengfei Li *
>>> * Merz Research Group *
>>> * Michigan State University *
>>> * AND *
>>> * Hammes-Schiffer Research Group *
>>> * Yale University *
>>> * AND *
>>> * Li Research Group *
>>> * Loyola University Chicago *
>>> ******************************************************************
>>> The input file you are using is : MCPB.in
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>>> The following is the input variable you have:
>>> The variable ion_ids is : [1]
>>> The variable ion_info is : []
>>> The variable ion_mol2files is : ['PT.mol2']
>>> The variable original_pdb is : CIX.pdb
>>> The variable add_bonded_pairs is : []
>>> The variable add_redcrd is : 0
>>> The variable additional_resids is : []
>>> The variable anglefc_avg is : 0
>>> The variable bondfc_avg is : 0
>>> The variable chgfix_resids is : []
>>> The variable cut_off is : 2.8
>>> The variable force_field is : ff19SB
>>> The variable frcmod_files is : ['ISX.frcmod']
>>> The variable gaff is : 1
>>> The variable group_name is : CIX
>>> The variable ion_paraset is : 12_6 (Only for the ions using the
>>> nonbonded model).
>>> The variable large_opt is : 1
>>> The variable lgmodel_chg is : -99
>>> The variable lgmodel_spin is : -99
>>> -99 means program will assign a charge automatically.
>>> The variable naa_mol2files is : ['ISX.mol2', 'WAT.mol2',
> 'CL.mol2']
>>> The variable scale_factor is : 1.0
>>> ATTENTION: This is the scale factor of frequency. The
>>> force constants will be scaled by multiplying the
>>> square
>>> of scale_factor.
>>> The variable smmodel_chg is : -99
>>> The variable smmodel_spin is : -99
>>> -99 means program will assign a charge automatically.
>>> The variable software_version is : gau
>>> The variable sqm_opt is : 0
>>> The variable water_model is : OPC
>>> The variable xstru is : 0
>>> ******************************************************************
>>> * *
>>> *===================Generate the Initial frcmod file=============*
>>> * *
>>> ******************************************************************
>>> Atoms which has changed the atom types: [1, 2, 18, 34, 36]
>>> 1-PT.1-PT : PT --> M1
>>> 2-ISX.2-N1 : n2 --> Y1
>>> 3-ISX.18-N1 : n2 --> Y2
>>> 4-CL.34-CL : Cl --> Y3
>>> 5-WAT.36-O : OW --> Y4
>>> ******************************************************************
>>> * *
>>> *=========Using the Seminario method to solve the problem========*
>>> * *
>>> ******************************************************************
>>> =======================Generate the bond parameters===============
>>> For bondtype: M1-Y1. There are 1 bond(s) in this type:
>>> The bond length(s) is(are): [2.0637]
>>> The average bond length is: 2.0637 Angstrom.
>>> The force constant(s) is(are): [np.float64(103.8)]
>>> The average force constant is: 103.8 Kcal*mol^-1*A^-2.
>>> For bondtype: M1-Y2. There are 1 bond(s) in this type:
>>> The bond length(s) is(are): [1.9964]
>>> The average bond length is: 1.9964 Angstrom.
>>> The force constant(s) is(are): [np.float64(144.8)]
>>> The average force constant is: 144.8 Kcal*mol^-1*A^-2.
>>> For bondtype: M1-Y3. There are 1 bond(s) in this type:
>>> The bond length(s) is(are): [2.311]
>>> The average bond length is: 2.311 Angstrom.
>>> The force constant(s) is(are): [np.float64(140.6)]
>>> The average force constant is: 140.6 Kcal*mol^-1*A^-2.
>>> For bondtype: M1-Y4. There are 1 bond(s) in this type:
>>> The bond length(s) is(are): [2.1182]
>>> The average bond length is: 2.1182 Angstrom.
>>> The force constant(s) is(are): [np.float64(87.7)]
>>> The average force constant is: 87.7 Kcal*mol^-1*A^-2.
>>> =======================Generate the angle parameters==============
>>> For angletype: M1-Y1-c1. There are 1 angle(s) in this type:
>>> The angle value(s) is(are): [134.7]
>>> The average angle value is: 134.7 Degree.
>>> The force constant(s) is(are): [np.float64(143.92)]
>>> The average force constant is: 143.92 Kcal*mol^-1*Rad^-2.
>>> Traceback (most recent call last):
>>> File
>>>
>>
> "/mnt/storage_2/project_data/pl0251-02/bin/miniconda3/envs/AmberTools24/bin/MCPB.py",
>>>
>>> line 682, in <module>
>>> gene_by_QM_fitting_sem(smpdbf, ionids, xstru, stfpf, prefcdf,
>>> finfcdf,
>>>
>>>
>>
> ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>> fcfchkf, fclogf, g0x, scalef, bondfc_avg, anglefc_avg)
>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>> File
>>>
>>
> "/mnt/storage_2/project_data/pl0251-02/bin/miniconda3/envs/AmberTools24/lib/python3.13/site-packages/pymsmt/mcpb/gene_final_frcmod_file.py",
>>>
>>> line 835, in gene_by_QM_fitting_sem
>>> ang_para = avg_angle_para(misangat123, angvals, afconst)
>>> File
>>>
>>
> "/mnt/storage_2/project_data/pl0251-02/bin/miniconda3/envs/AmberTools24/lib/python3.13/site-packages/pymsmt/mcpb/gene_final_frcmod_file.py",
>>>
>>> line 131, in avg_angle_para
>>> afconst = [round(i, 2) for i in afconst]
>>> ~~~~~^^^^^^
>>> TypeError: type numpy.complex128 doesn't define __round__ method
>>> """
>>>
>>> It seems that the program is attempting to round a value of type
>>> numpy.complex128, which leads to a TypeError since complex numbers
>>> cannot be directly rounded.
>>>
>>> For convenience, I’ve made all the relevant input files available
>>> in
>>> this GitHub repository:
>>>
> https://urldefense.com/v3/__https://github.com/farmaceut/ERROR_MCPB.py.git__;!!HXCxUKc!3EmOwMQTNcBv6X6yX-Z13ud6T7ex8pb-68_akEQGUMHknLeEU2YPhK6cXJLHQRLm3Q-zELe-xfShoBMFYyJu8ow$
> [5]
>>>
>>> Has anyone encountered a similar issue? Any suggestions or insights
>>> on
>>> how to resolve this would be greatly appreciated.
>>> Thank you in advance !
>>> -
>>> Maciej Spiegel, MPharm PhD
>>> assistant professor
>>>
>>> Department of Organic Chemistry and Pharmaceutical Technology,
>>> Faculty of Pharmacy, Wroclaw Medical University
>>> Borowska 211A, 50-556 Wroclaw, Poland
>>>
>>> _______________________________________________
>>> AMBER mailing list
>>> AMBER.ambermd.org
>>>
> https://urldefense.com/v3/__http://lists.ambermd.org/mailman/listinfo/amber__;!!HXCxUKc!3EmOwMQTNcBv6X6yX-Z13ud6T7ex8pb-68_akEQGUMHknLeEU2YPhK6cXJLHQRLm3Q-zELe-xfShoBMFw0R7Ya4$
> [6]
>
> --
> -
> Maciej Spiegel, MPharm PhD
> assistant professor
>
> Department of Organic Chemistry and Pharmaceutical Technology,
> Faculty of Pharmacy, Wroclaw Medical University
> Borowska 211A, 50-556 Wroclaw, Poland
>
> _______________________________________________
> AMBER mailing list
> AMBER.ambermd.org
> https://urldefense.com/v3/__http://lists.ambermd.org/mailman/listinfo/amber__;!!HXCxUKc!3EmOwMQTNcBv6X6yX-Z13ud6T7ex8pb-68_akEQGUMHknLeEU2YPhK6cXJLHQRLm3Q-zELe-xfShoBMFw0R7Ya4$
>
>
>
> Links:
> ------
> [1] https://ambermd.org/tutorials/advanced/tutorial20/mcpbpyfaq.php
> [2] http://lizhen62017.wixsite.com/home
> [3] http://merzgroup.org
> [4]
> https://urldefense.com/v3/__https://github.com/ParmEd/ParmEd/issues/1406__;!!HXCxUKc!3EmOwMQTNcBv6X6yX-Z13ud6T7ex8pb-68_akEQGUMHknLeEU2YPhK6cXJLHQRLm3Q-zELe-xfShoBMFP4c8MZs$
> [5]
> https://urldefense.com/v3/__https://github.com/farmaceut/ERROR_MCPB.py.git__;!!HXCxUKc!3EmOwMQTNcBv6X6yX-Z13ud6T7ex8pb-68_akEQGUMHknLeEU2YPhK6cXJLHQRLm3Q-zELe-xfShoBMFYyJu8ow$
> [6]
> https://urldefense.com/v3/__http://lists.ambermd.org/mailman/listinfo/amber__;!!HXCxUKc!3EmOwMQTNcBv6X6yX-Z13ud6T7ex8pb-68_akEQGUMHknLeEU2YPhK6cXJLHQRLm3Q-zELe-xfShoBMFw0R7Ya4$

-- 
-
Maciej Spiegel, MPharm PhD
assistant professor
Department of Organic Chemistry and Pharmaceutical Technology,
Faculty of Pharmacy, Wroclaw Medical University
Borowska 211A, 50-556 Wroclaw, Poland
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Fri Aug 01 2025 - 13:00:02 PDT
Custom Search