Re: [AMBER] fix_traj_parm.py problems

From: Jason Swails <jason.swails.gmail.com>
Date: Thu, 11 Jul 2013 14:51:36 -0400

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
Received on Thu Jul 11 2013 - 12:00:04 PDT
Custom Search