AMBER Archive (2004)

Subject: Re: AMBER: restraintmask problem in ptraj

From: Viktor Hornak (
Date: Mon Nov 15 2004 - 07:37:24 CST

Takanori TANAKA wrote:
> Has the problem presented by Oliver Hucke at Apr 21, 2004,
> titled "AMBER: restraintmask and ambmask" already been solved?
> Now, I found the similer problems applying restraintmask to ptraj.

Dear Takanori,

the problem described by Oliver in the mentioned e-mail regarded
specifically the distance selection in atom mask in sander. The problem
was fixed by bugfix.7. However you seem to be having a different problem
which is not directly related to the bugfix. You should be aware that
sander and ptraj are two different programs (one written in fortran the
other one in C) and they don't share the code for atom selection mask.
Currently the selection syntax in sander/ambmask ('restraintmask'
implementation) allows more flexible atom selection than the one
implemented in ptraj. We'll try to incorporate the same selection
mechanism in sander and ptraj soon. This would most likely allow you to
get the standalone version of ptraj (distributed separately from amber8)
with this feature implemented.

> I am trying to use the restraintmask to observe fluctuation of
> backbone atom or sidechain atom, individually. So I wrote in
> script file for ptraj as below:
> atomicfluct out fluct1.txt @CA,C,N,O byres
> atomicfluct out fluct2.txt "!@CA,C,N,O" byres
> The first line was accepted and worked normally,
> but the second line causes no response after the message
> "PTRAJ: atomicfluct out fluct2.txt "!@CA,C,N,O" byres"
> and ptraj never finish.

That's correct. The second line would currently not be recognised by
ptraj. What might work for you is the following:

atomicfluct out fluct2.txt ~@CA,C,N,O byres

> Moreover, the script:
> strip "@H="
> seems to be unrecognized, with the message
> "Mask [@H=] represents 0 atoms !!!NO ATOMS DETECTED!!!"
> though H atoms are surely included in both topology and coordinate files.

Again, currently this won't work in ptraj. I don't know of any easy way
to describe "everything but hydrogens" in ptraj right now (unless you
specifically list all hydrogen types you have: ~@H,HA2,HA3,HH31,etc).

> With ambmask the selection string "@CA" works.
> "!@CA" returns the error with "Event not found."
> (because '!' character has some special meaning in UNIX),
> while "\!@CA" and "@H=" work normally.

This is normal behavior. Unix (bash/csh) expansions won't be applied
when selections are specified in input files. To test things directly
with ambmask you have to apply escape sequences as you found out
yourself. Remember though that this kind of selections is currently
working in sander/ambmask but not in ptraj. Hopefully we'll be able to
put the same implementation into ptraj (I wouldn't hold my breath
though, give it a month or two before checking on ptraj again)...

The AMBER Mail Reflector
To post, send mail to
To unsubscribe, send "unsubscribe amber" to