Hi Weihao,
Based on my memory, I have fixed this bug in a later version of MCPB.py. You can try AmberTools25 or AmberTools26.
Pengfei
> On May 19, 2026, at 8:59 PM, 张玮豪 <m202475999.hust.edu.cn> wrote:
>
> Hi Pengfei,
>
> I have tried Amber21 and Amber24, so the version of MCPB.py should be 21 or 24?
>
>> -----原始邮件-----
>> 发件人: "Pengfei Li" <ambermailpengfei.gmail.com>
>> 发送时间: 2026-05-20 09:52:12 (星期三)
>> 收件人: "张玮豪" <m202475999.hust.edu.cn>, "AMBER Mailing List" <amber.ambermd.org>
>> 抄送:
>> 主题: Re: [AMBER] Error Occurred When Using MCPB.py to Build a Nonbonded Model for a Ligand-Bound Metalloprotein
>>
>> Hi Weihao,
>>
>> Which version of MCPB.py did you use?
>>
>> Best,
>> Pengfei
>>
>>> On May 19, 2026, at 2:35 AM, 张玮豪 via AMBER <amber.ambermd.org> wrote:
>>>
>>> Dear Amber Developersand Users,
>>>
>>> I want to use MCPB.py to construct a nonbonded model (12-6 LJ Nonbonded Model) for a ligand-bound metalloprotein. Following the workflow described in the Amber 24 manual: “For the modeling of a non-bonded model with a refitted charge, users can follow the workflow (3 steps): 1m → 3b → 4n1.”
>>>
>>>
>>>
>>> ”””
>>>
>>> MCPB input file (mcpb.in) is as follows:
>>>
>>> original_pdb 6wfj_H.pdb
>>>
>>> group_name 6wfj
>>>
>>> ion_ids 12980 12981
>>>
>>> ion_mol2files ZN1.mol2 ZN2.mol2
>>>
>>> force_field ff14SB
>>>
>>> water_model SPCE
>>>
>>> gaff 1
>>>
>>> large_opt 1
>>>
>>> cut_off 2.8
>>>
>>> lgmodel_chg 0
>>>
>>> lgmodel_spin 1
>>>
>>> ”””
>>>
>>>
>>>
>>> Step 1 (MCPB.py -i mcpb.in -s 1m) and Step 2 (MCPB.py -i mcpb.in -s 3b) successfully ran. However, when doing Step3 (MCPB.py -i mcpb.in -s4n1), the following error was encountered:
>>>
>>>
>>>
>>> Traceback (most recent call last):
>>>
>>> File "/share/apps/amber/cpu/21/bin/MCPB.py", line 712, in <module>
>>>
>>> gene_leaprc(gname, orpdbf, fipdbf, stpdbf, stfpf, ionids, ionmol2fs,
>>>
>>> File"/share/apps/amber/cpu/21/lib/python3.8/site-packages/pymsmt/mcpb/amber_modeling.py", line 201, in gene_leaprc
>>>
>>> frcmodf = get_frcmod_fname(element, chg, watermodel, paraset)
>>>
>>> File "/share/apps/amber/cpu/21/lib/python3.8/site-packages/pymsmt/mcpb/amber_modeling.py", line 108, in get_frcmod_fname
>>>
>>> return frcmodf
>>>
>>> UnboundLocalError: local variable 'frcmodf' referenced before assignment
>>>
>>>
>>>
>>> I tried to change the water_model as TIP3P, but the error is already existed.Could anyone tell me why this error occurs?
>>>
>>> Thank you very much for your time and assistance.
>>>
>>>
>>>
>>> Best regards,
>>> Weihao Zhang
>>> _______________________________________________
>>> AMBER mailing list
>>> AMBER.ambermd.org
>>> http://lists.ambermd.org/mailman/listinfo/amber
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Tue May 19 2026 - 19:30:02 PDT