Hi all,
I experienced this issue as well in both pdb4amber and parmed. I was able to fix this error and get parmed to run by altering all the specific commands related to the np.array lines (for parmed case, 1 line in each .in ./parmed/structure.py & ./parmed/amber/_amberparm.py). An example is shown here:
coords = np.array(value, dtype=np.float64, copy=False, subok=True)
becomes
coords = np.asarray(value, dtype=np.float64)
I installed Amber and Ambertools 24 with Python 3.12 and NumPy 2.1.1 for reference.
Best,
Reilly Osadchey Brown
Boston University
________________________________
From: LI An-Bang via AMBER <amber.ambermd.org>
Sent: 04 December 2024 04:25
To: amber <amber.ambermd.org>
Subject: [AMBER] pdb4amber works error
Hi,
I have installed Amber 24 on Ubuntu 24.04, and encountered errors with pdb4amber.
When I executed command "pdb4amber -h", it displayed help message, it's ok.
But when I execute command "pdb4amber 1esh.pdb", I got error message as following:
$ pdb4amber 1esh.pdb
==================================================
Summary of pdb4amber for: 1esh.pdb
===================================================
Traceback (most recent call last):
File "/home/anbang/amber24/bin/pdb4amber", line 33, in <module>
sys.exit(load_entry_point('pdb4amber==22.0', 'console_scripts', 'pdb4amber')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/anbang/amber24/lib/python3.12/site-packages/pdb4amber/pdb4amber.py", line 819, in main
run(
File "/home/anbang/amber24/lib/python3.12/site-packages/pdb4amber/pdb4amber.py", line 516, in run
parm = parmed.read_PDB(pdbin)
^^^^^^^^^^^^^^^^^^^^^^
File "/home/anbang/amber24/lib/python3.12/site-packages/parmed/formats/pdb.py", line 432, in parse
inst._parse_open_file(fileobj)
File "/home/anbang/amber24/lib/python3.12/site-packages/parmed/formats/pdb.py", line 495, in _parse_open_file
method_dispatch[rec](line)
File "/home/anbang/amber24/lib/python3.12/site-packages/parmed/formats/pdb.py", line 571, in _parse_cryst1
self.struct.box = [a, b, c, A, B, C]
^^^^^^^^^^^^^^^
File "/home/anbang/amber24/lib/python3.12/site-packages/parmed/structure.py", line 1880, in box
box = np.array(box, dtype=np.float64, copy=False, subok=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: Unable to avoid copy while creating an array as requested.
If using `np.array(obj, copy=False)` replace it with `np.asarray(obj)` to allow a copy when needed (no behavior change >
For more details, see
https://numpy.org/devdocs/numpy_2_0_migration_guide.html#adapting-to-changes-in-the-copy-keyword.
It seems there's something wrong with Parmed, but I have no idea to solve the problem. Please help me.
Thanks,
Anbang Li
Institute of Biophysics, College of Physical Science and Technology,
Central China Normal University, China
_______________________________________________
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 Wed Dec 04 2024 - 06:00:08 PST