Re: [AMBER] fix_traj_parm.py problems

From: Jason Swails <jason.swails.gmail.com>
Date: Thu, 11 Jul 2013 21:15:02 -0400

On Thu, Jul 11, 2013 at 7:04 PM, Fabrício Bracht <fabracht1.gmail.com>wrote:

> Hi Jason. Indeed my input had a silly mistake. Instead of using -x to
> indicate the output trajectory, I used -y again. Very silly indeed.
> Now I have another error.
> The input line
> ./fix_traj_parm.py -p HOH_wat.prmtop -y mdcrd.md2 mdcrd.md3 -o
> fixedparm.prmtop -x fixed.mdcrd
> seems to be correct, but an error comes up anyway:
>
> Re-ordering the trajectories. This may take awhile...
> Traceback (most recent call last):
> File "./fix_traj_parm.py", line 110, in <module>
> pbcang =
> newtraj.createVariable('cell_angular','d',('frame','cell_angular'))
> IOError: netcdf: NetCDF: String match to name in use
>

Ah, a stupid typo (in 2 places, actually).

When I tested this script, I created an system without PBC, so I never
tested this particular bit of code... It seems to work now, although it
may be quite slow for large systems (it is in Python, after all).

I've uploaded the fixed version to my Wiki.

Thanks,
Jason


> I have tried with two different sets of trajectories and the error was the
> same.
>
>
>
> 2013/7/11 Jason Swails <jason.swails.gmail.com>
>
> > On Thu, Jul 11, 2013 at 1:30 PM, Fabrício Bracht <fabracht1.gmail.com
> > >wrote:
> >
> > > Hi Jason. Thanks for the reply. It worked fine until it started working
> > on
> > > the trajectory. Here is the screen output:
> > >
> > > Re-ordering the trajectories. This may take awhile...
> > > Traceback (most recent call last):
> > > File "./fix_traj_parm.py", line 70, in <module>
> > > newtraj = open_netcdf(opt.outtraj, 'w')
> > > File "/home/fabricio/amber12/bin/chemistry/amber/readparm.py", line
> 45,
> > > in <lambda>
> > > open_netcdf = lambda name, mode: NetCDFFile(name, mode)
> > > File "/usr/lib/python2.7/dist-packages/Scientific/IO/NetCDF.py", line
> > > 171, in NetCDFFile
> > > filename = os.path.expanduser(filename)
> > > File "/usr/lib/python2.7/posixpath.py", line 252, in expanduser
> > > if not path.startswith('~'):
> > > AttributeError: 'NoneType' object has no attribute 'startswith'
> > >
> > > Looked it up on the web to see if there was something I could do, but
> > found
> > > lots of generic forums discussing things that I didn't really
> understand.
> > >
> > > Am I missing something here?
> > >
> >
> > Could be. What command-line did you use (user input is frequently
> helpful
> > debugging information)? It *looks* like you didn't specify an output
> > trajectory on the command-line, so the default "None" (Python equivalent
> of
> > NULL) was passed to the NetCDF constructor. Apparently I did not add
> much
> > error checking to make sure that the user input was sufficient. You can
> > use the "--help" flag to provide some level of help.
> >
> > Note, this script does _not_ modify the trajectories in-place. It
> writes a
> > new trajectory that is a concatenation of all input trajectories (and so
> > requires you to supply an output trajectory).
> >
> > This script is intended to be used *once* for your system. That is, if
> you
> > ran your simulation in 20 chunks, you should supply your prmtop file and
> 20
> > NetCDF trajectories, after which fix_parm_traj.py will create one new,
> > fixed prmtop and ONE, concatenated, properly ordered NetCDF trajectory.
> >
> > Hope this helps,
> > Jason
> >
> > P.S. While 99.9% of my Python scripts have a sophisticated command-line
> > parser that documents all options with the "--help" flag, mature input
> > error-checking I tend to reserve for scripts and programs I release for
> > general use (e.g., MMPBSA.py, ParmEd, cpinutil.py, update_amber, etc.)
> >
> > --
> >
> >
> > Ja
> >
> > son M. Swails
> > Qu
> >
> >
> > antum Theory Project,
> > Un
> >
> > iversity of Florida
> > Ph.D. Candidate
> > 352-392-4032
> > _______________________________________________
> > 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
>



-- 
Jason M. Swails
Quantum Theory Project,
University of Florida
Ph.D. Candidate
352-392-4032
_______________________________________________
AMBER mailing list
AMBER.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber
Received on Thu Jul 11 2013 - 18:30:04 PDT
Custom Search