Re: [AMBER] pdb4amber works error

From: Carlos Simmerling via AMBER <amber.ambermd.org>
Date: Wed, 4 Dec 2024 09:19:14 -0500

actually the original post is not related to parmed, and this change to the
code is not needed.
the source of the problem is that the syntax for using pdb4amber was not
correct.
from section 12.4 of the Amber 24 manual, the correct syntax is
  : pdb4amber [-h] [-i FILE] [-o FILE] [-y] [-d] [-s STRIP_ATOM_MASK] ...

  -i FILE, --in FILE PDB input file (default: stdin)

so, one must put "-i" before the name of the input pdb file (or pipe the
pdb file into pdb4amber, using a command such as "cat 1esh.pdb |
pdb4amber".

On Wed, Dec 4, 2024 at 8:58 AM Osadchey Brown, Reilly via AMBER <
amber.ambermd.org> wrote:

> 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,&nbsp;
>
>
> 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):
> &nbsp; File "/home/anbang/amber24/bin/pdb4amber", line 33, in <module&gt;
> &nbsp; &nbsp; sys.exit(load_entry_point('pdb4amber==22.0',
> 'console_scripts', 'pdb4amber')())
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
> &nbsp;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> &nbsp; File
> "/home/anbang/amber24/lib/python3.12/site-packages/pdb4amber/pdb4amber.py",
> line 819, in main
> &nbsp; &nbsp; run(
> &nbsp; File
> "/home/anbang/amber24/lib/python3.12/site-packages/pdb4amber/pdb4amber.py",
> line 516, in run
> &nbsp; &nbsp; parm = parmed.read_PDB(pdbin)
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;^^^^^^^^^^^^^^^^^^^^^^
> &nbsp; File
> "/home/anbang/amber24/lib/python3.12/site-packages/parmed/formats/pdb.py",
> line 432, in parse
> &nbsp; &nbsp; inst._parse_open_file(fileobj)
> &nbsp; File
> "/home/anbang/amber24/lib/python3.12/site-packages/parmed/formats/pdb.py",
> line 495, in _parse_open_file
> &nbsp; &nbsp; method_dispatch[rec](line)
> &nbsp; File
> "/home/anbang/amber24/lib/python3.12/site-packages/parmed/formats/pdb.py",
> line 571, in _parse_cryst1
> &nbsp; &nbsp; self.struct.box = [a, b, c, A, B, C]
> &nbsp; &nbsp; ^^^^^^^^^^^^^^^
> &nbsp; File
> "/home/anbang/amber24/lib/python3.12/site-packages/parmed/structure.py",
> line 1880, in box
> &nbsp; &nbsp; box = np.array(box, dtype=np.float64, copy=False, subok=True)
>
> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 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 &gt;
> 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
>
>
> &nbsp;
> _______________________________________________
> 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
>
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Wed Dec 04 2024 - 06:30:05 PST
Custom Search