Project

General

Profile

Bug #894

Wrong rms deviation calculation in g_rmsf

Added by Manuel Luitz over 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
High
Assignee:
-
Category:
-
Target version:
-
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

The implementation of rms deviation in g_rmsf which can be switched on with the -od flag does not treat the periodic boundary conditions. Atoms which jump through the periodic boundary between two frames get an overrated rms because their distance vector is in the order of the box size.

The correct treatment is to find the smallest distance vector between two atom positions including periodic boundary conditions.

I attached a small patch to fix this issue.

g_rmsf-correct-rmsdev.patch (881 Bytes) g_rmsf-correct-rmsdev.patch Manuel Luitz, 03/08/2012 05:36 PM

History

#1 Updated by Roland Schulz over 7 years ago

Could you please upload the patch to gerrit.gromacs.org?

#2 Updated by Berk Hess about 7 years ago

g_rmsf does take pbc within a molecule into account with the -fit option.
So or you are not using -fit, or you have multiple molecules.
The fix you submitted is sub optimal for the single molecule case,
as there we should make molecules whole.
What case are you trying to address here?

#3 Updated by Roland Schulz about 7 years ago

  • Status changed from New to Feedback wanted

#4 Updated by Manuel Luitz almost 7 years ago

The short version:
- there is no option -pbc in g_rmsf probably you mistake it for g_rms
- as Berk says, the fitting does only work if one molecule is considered (in case the reference frame considers pbc...), for multi-molecule cases the current implementation does not work
- this patch does no harm to the single molecule -fit case (so why should this be suboptimal?)
- why should somebody want to NOT consider pbc in rmsf calculation within a molecule?

The long version:
I used this patch to calculate the mobility of water molecules which could be done easily with the -prev patch I also submitted. If a water molecule jumps through the border, it gets assigned a high distance vector which puts a bias on the rmsf calculation what is definitely not deserved. In this case pbc should be taken into account. However, for such an application, the -fit option would be meanlingless (fitting of highly fluctuating water molecules).

#5 Updated by Mark Abraham almost 7 years ago

Manuel Luitz wrote:

The short version:
- there is no option -pbc in g_rmsf probably you mistake it for g_rms

Fitting can take PBC into account without there needing to be a -pbc option available.

- as Berk says, the fitting does only work if one molecule is considered (in case the reference frame considers pbc...), for multi-molecule cases the current implementation does not work

OK, then I think we agree that a fix is needed for proper treatment of the multi-molecule case?

- this patch does no harm to the single molecule -fit case (so why should this be suboptimal?)

It's a lot slower.

- why should somebody want to NOT consider pbc in rmsf calculation within a molecule?

They might already know that the trajectory is continuous, e.g. from trjconv pre-processing.

The long version:
I used this patch to calculate the mobility of water molecules which could be done easily with the -prev patch I also submitted. If a water molecule jumps through the border, it gets assigned a high distance vector which puts a bias on the rmsf calculation what is definitely not deserved. In this case pbc should be taken into account. However, for such an application, the -fit option would be meanlingless (fitting of highly fluctuating water molecules).

Is g_msd suited to measuring what you want in your problem?

I think we need to see more detail of what the problem is - you haven't yet identified whether you are measuring MSF on a group with more than one molecule in it.

#6 Updated by Rossen Apostolov over 6 years ago

  • Status changed from Feedback wanted to Closed
  • Affected version set to 4.5.3

No feedback, please comment again if the issue is still present.

Also available in: Atom PDF