Project

General

Profile

Bug #239

PATCH: option for centering in xy direction via trjconv

Added by Martin Hoefling about 11 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Erik Lindahl
Category:
analysis tools
Target version:
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

Created an attachment (id=307)
Modifies gmx_trjconv.c to allow centering on group only in x-y direction

trjconv allows centering in the box on a group. Additionally, it allows fitting rotational and translational movement only in xy direction.
This patch slightly modifies the centering routine and adds a new option

-centerxy

centering the group only in xy direction in the box.

trjconv.patch (2.55 KB) trjconv.patch Modifies gmx_trjconv.c to allow centering on group only in x-y direction Martin Hoefling, 10/22/2008 02:32 PM

History

#1 Updated by Berk Hess about 11 years ago

I have just added an option transxy for -fit.
Is it really useful to additionally also have a -centerxy option?
trjconv already has too many command line options.

Berk

#2 Updated by Martin Hoefling about 11 years ago

(In reply to comment #1)

I have just added an option transxy for -fit.
Is it really useful to additionally also have a -centerxy option?
trjconv already has too many command line options.

For me "yes", since I need to fix a group via freezing in a simulation. At the end of all simulation steps. I want to center the box on my group, adsorbing on the frozen surface atoms.

In principle, but you're right: In principle, I can "manually" center the first frame and then fit it.

Another suggestion would be to incorporate -centerxy into -center

e.g.:

-center
-center xy

while the latter replaces centerxy and if called without xy, default behavior is assumed. This could also allow arbitrary centering in x y and z direction. by other combinations such as xz etc.

What are your opinions about this?

#3 Updated by Berk Hess about 11 years ago

But for applying the position restraints
wouldn't you rather use -fit transxy and fit
on the position restraint group,
instead of centering?

The center is only affected by the outer atoms,
whereas I would think you want to weight in all
the position restrained atoms (as a fit would).

Berk

#4 Updated by Martin Hoefling about 11 years ago

(In reply to comment #3)

But for applying the position restraints
wouldn't you rather use -fit transxy and fit
on the position restraint group,
instead of centering?

Well, depends on what you wanna do. In my setup I do the following:

Group 1: Surface (frozen)
Group 2: Protein / Aminoacid (can move freely)

After the simulation, some analysis tools (badly written ones without pbc treatment) need centering of the aminoacid in x-y direction of the box. Also for display and making movies it can be an advantage.

The center is only affected by the outer atoms,
whereas I would think you want to weight in all
the position restrained atoms (as a fit would).

Yepp, what you wanna tell me is that centering does not center the COM of my Protein, that's true. The solution for this would be to calculate the com (via g_traj -com) then translate the first frame and use this for fitting with trjconv, or is there an easier way?

If not, one option would be to add additional options for fitting together with com centering the group?

Best
Martin

#5 Updated by Berk Hess about 11 years ago

Hi,

But fitting will exactly give you the COM,
if you choose as a fit group the atoms that you want.
You only have to have a centered reference system in your tpr file.

Berk

#6 Updated by Martin Hoefling about 11 years ago

(In reply to comment #5)

But fitting will exactly give you the COM,
if you choose as a fit group the atoms that you want.
You only have to have a centered reference system in your tpr file.

Yes, if my reference system would be centered > no problem. Most of the runs are continued runs from a previous pull simulation (pulling in z direction without restricting x-y) and thus the run input for the continued run is not centered.
The option might be useless for most of the other users - I can live with patching my version, too :
)

Best
Martin

#7 Updated by Berk Hess about 11 years ago

But you can just use your original tpr file.
And in 4.0 you no longer need to make new tpr files
to continue your simulation, since there are checkpoints.

Berk

#8 Updated by Martin Hoefling about 11 years ago

(In reply to comment #7)

But you can just use your original tpr file.
And in 4.0 you no longer need to make new tpr files
to continue your simulation, since there are checkpoints.

Maybe "continuing" is the wrong word for what I do. The structures from the pull simulation are taken as initial input for non-pull simulations. Means from one pull simulation, I obtain input structures (and velocities) for several other simulations. These inputs are not centered anymore, while the initial input for the pull simulation was. As a solution, I could use the input of the pull simulation for fitting as this is centered more or less.

There's another simple solution, that I will try out later: I could center the first frame and then use the output, together with your transxy option to obtain a centered (but not COM centered) trajectory. Thanks for the hints.

Best
Martin

#9 Updated by Berk Hess about 11 years ago

I think that you usually do not want to do centering
on a trajectory, since the system will them vibrate
will the fluctuations of the outer atoms of the group.
Centering is mainly useful for a single frame.

But it would be useful to have an option that centers
the center of mass of a group in the box.
We anyhow have to rethink the way trjconv works,
there has been a discussion on this on one of the lists.

Berk

Also available in: Atom PDF