Re: [AMBER] Sander python API problem (?)

From: Elisa Pieri <elisa.pieri90.gmail.com>
Date: Fri, 24 Feb 2017 15:40:46 +0100

I used this simple script:

parm state00.parm7
trajin frame.nc
trajout frame.rst7
go
quit

or, from command line, "cpptraj -p state00.parm7 -y frame.nc -x frame.rst7"
(which, I guess, it's the same thing).

On Fri, Feb 24, 2017 at 3:38 PM, Hai Nguyen <nhai.qn.gmail.com> wrote:

> ah, can you also provide exact cpptraj command to convert that .nc file to
> rst7?
>
> Hai
>
> On Fri, Feb 24, 2017 at 9:35 AM, Hai Nguyen <nhai.qn.gmail.com> wrote:
>
> > thank you.
> >
> > Hai
> >
> >
> > On Fri, Feb 24, 2017 at 9:23 AM, Elisa Pieri <elisa.pieri90.gmail.com>
> > wrote:
> >
> >> Yes, of course! I hope they are small enough.
> >>
> >> Anyway, if I use the NC, I get this:
> >>
> >> Traceback (most recent call last):
> >> File "qmmm_sander.py", line 22, in <module>
> >> with sander.setup(parm, parm.coordinates, parm.box, inp, qm_inp):
> >> File "/home/elisa/amber16/lib/python2.7/site-packages/sander/__
> >> init__.py",
> >> line 268, in __init__
> >> box = _np.array([float(x) for x in box])
> >> TypeError: only length-1 arrays can be converted to Python scalars
> >>
> >> On Thu, Feb 23, 2017 at 6:55 PM, Hai Nguyen <nhai.qn.gmail.com> wrote:
> >>
> >> > thanks. Can you please provide us a small .nc file with prmtop file so
> >> we
> >> > can reproduce your issue with ParmEd.
> >> >
> >> > (We might fix in next AmberTools17 but just want to make sure). thanks
> >> >
> >> > By the way, it's ok to use
> >> >
> >> > parm = pmd.load_file('state00.parm7', 'frame.nc')
> >> > (vs parm = pmd.load_file('state00.parm7', 'frame.rst7')
> >> >
> >> > If you want to update coordinates for given frame number, try
> >> >
> >> > parm.coordinates = parm.get_coordinates(frame_number)
> >> >
> >> > thx
> >> > Hai
> >> >
> >> > On Thu, Feb 23, 2017 at 11:18 AM, Elisa Pieri <
> elisa.pieri90.gmail.com>
> >> > wrote:
> >> >
> >> > > Sorry, I didn't mean "useless" in general, but just to my case :)
> >> > > Actually, it is not just VMD that cannot read it: it is unreadable
> to
> >> the
> >> > > script too. This is what you get using the rst7 file as provided by
> >> > cpptraj
> >> > > without removing this energies:
> >> > >
> >> > > Traceback (most recent call last):
> >> > > File "qmmm_sander.py", line 10, in <module>
> >> > > parm = pmd.load_file('state00.parm7', 'frame.rst7')
> >> > > File
> >> > > "/home/elisa/amber16/lib/python2.7/site-packages/
> >> > > ParmEd-2.7.2-py2.7-linux-x86_64.egg/parmed/formats/registry.py",
> >> > > line 197, in load_file
> >> > > return cls.parse(filename, *args, **kwargs)
> >> > > File
> >> > > "/home/elisa/amber16/lib/python2.7/site-packages/
> >> > > ParmEd-2.7.2-py2.7-linux-x86_64.egg/parmed/amber/amberformat.py",
> >> > > line 353, in parse
> >> > > return LoadParm(filename, *args, **kwargs)
> >> > > File
> >> > > "/home/elisa/amber16/lib/python2.7/site-packages/
> >> > > ParmEd-2.7.2-py2.7-linux-x86_64.egg/parmed/amber/readparm.py",
> >> > > line 73, in LoadParm
> >> > > f = load_file(xyz)
> >> > > File
> >> > > "/home/elisa/amber16/lib/python2.7/site-packages/
> >> > > ParmEd-2.7.2-py2.7-linux-x86_64.egg/parmed/formats/registry.py",
> >> > > line 182, in load_file
> >> > > raise FormatNotFound('Could not identify file format')
> >> > > parmed.exceptions.FormatNotFound: Could not identify file format
> >> > >
> >> > > So maybe the way cpptraj is creating a rst7 file is just
> incompatible
> >> > with
> >> > > the parmed.load_file.
> >> > > Sorry again!
> >> > >
> >> > > On Thu, Feb 23, 2017 at 5:10 PM, Nhai <nhai.qn.gmail.com> wrote:
> >> > >
> >> > > >
> >> > > >
> >> > > > > On Feb 23, 2017, at 10:54 AM, Elisa Pieri <
> >> elisa.pieri90.gmail.com>
> >> > > > wrote:
> >> > > > >
> >> > > > > So..I solved two problems:
> >> > > > >
> >> > > >
> >> > > >
> >> > > > > -for some reason, cpptraj is adding two useless numbers to the
> >> rst7,
> >> > > > which
> >> > > > > makes it unreadable. Nothing that sed cannot handle, I guess.
> >> > > >
> >> > > > ? Why do you think it's useless? If vmd can not read it, it's vmd
> >> > > problem,
> >> > > > not ours.
> >> > > >
> >> > > > > -"coordinates" has to be used instead of "coords" as attribute.
> >> The
> >> > > > manual
> >> > > > > would need an extensive debug.
> >> > > >
> >> > > > Thx. I will update the manual.
> >> > > >
> >> > > > Hai
> >> > > > >
> >> > > > > Now it is working on my computer, we can try it tomorrow on
> yours!
> >> > > > >
> >> > > > > Elisa
> >> > > > >
> >> > > > > On Thu, Feb 23, 2017 at 4:43 PM, Elisa Pieri <
> >> > elisa.pieri90.gmail.com>
> >> > > > > wrote:
> >> > > > >
> >> > > > >> Uh, thanks! Easier than expected! I took the main structure
> from
> >> the
> >> > > > >> manual examples, I don't know if the same correction should be
> >> > applied
> >> > > > to
> >> > > > >> the manual..
> >> > > > >> BTW, I discovered that the RST7 was unreadable for VMD just
> >> because
> >> > on
> >> > > > >> line 2 cpptraj adds two numbers (energy and force?) after the
> >> number
> >> > > of
> >> > > > >> atoms; another possible bug to be fixed?
> >> > > > >>
> >> > > > >> Thank you!
> >> > > > >> Elisa
> >> > > > >>
> >> > > > >>> On Thu, Feb 23, 2017 at 4:36 PM, Nhai <nhai.qn.gmail.com>
> >> wrote:
> >> > > > >>>
> >> > > > >>> Hi
> >> > > > >>>
> >> > > > >>> Change coords to coordinates.
> >> > > > >>>
> >> > > > >>> Hai Nguyen
> >> > > > >>>
> >> > > > >>>> On Feb 23, 2017, at 10:05 AM, Elisa Pieri <
> >> > elisa.pieri90.gmail.com>
> >> > > > >>> wrote:
> >> > > > >>>>
> >> > > > >>>> coords
> >> > > > >>>
> >> > > > >>> _______________________________________________
> >> > > > >>> 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
> >> > > >
> >> > > _______________________________________________
> >> > > 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
> >>
> >>
> >
> _______________________________________________
> 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 Fri Feb 24 2017 - 07:00:03 PST
Custom Search