Re: [AMBER] problems

From: Jason Swails <>
Date: Thu, 11 Jul 2013 14:51:36 -0400

On Thu, Jul 11, 2013 at 1:30 PM, Fabrício Bracht <>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 "./", line 70, in <module>
> newtraj = open_netcdf(opt.outtraj, 'w')
> File "/home/fabricio/amber12/bin/chemistry/amber/", line 45,
> in <lambda>
> open_netcdf = lambda name, mode: NetCDFFile(name, mode)
> File "/usr/lib/python2.7/dist-packages/Scientific/IO/", line
> 171, in NetCDFFile
> filename = os.path.expanduser(filename)
> File "/usr/lib/python2.7/", 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 will create one new,
fixed prmtop and ONE, concatenated, properly ordered NetCDF trajectory.

Hope this helps,

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.,, ParmEd,, update_amber, etc.)

son M. Swails
antum Theory Project,
iversity of Florida
Ph.D. Candidate
AMBER mailing list
Received on Thu Jul 11 2013 - 12:00:04 PDT
Custom Search