Bug #381

g_saltbridge produces several outputs with identical names for molecules with more than one charge group

Added by Sarah Witzke almost 11 years ago. Updated over 10 years ago.

Erik Lindahl
analysis tools
Target version:
Affected version - extra info:
Affected version:


Created an attachment (id=407)
A 2 ns .xtc file of DMPC lipids, small organic acids and positive counter ions

1) An. xtc file with molecules with more than one charge group (for instance lipids)
2) Run g_saltbridge -f xxx.xtc -s xxx.tpr -sep
3) For each combination of lipid with lipid four files with identical names will be produced (three of them will have names starting with '#'). This is because each lipid in this case has two charge groups giving a total of four combinations.
4) The explanation provided by Tjserk Wassenaar:

Of course the real answer is in the code...

if (bSep) {
for(i=0; (i<ncg); i++)
for(j=i+1; (j<ncg); j++) {
if (nWithin[i][j]) {
fp=xvgropen(buf,buf,"Time (ps)","Distance (nm)");

So, a file is opened for each combination of charge(d) groups for
which the distance is lower than the cut-off, at least once in the
trajectory. The label is a property of the charge group, and is set
somewhere before:


Althogether, this just means that you have multiple charge(d) groups
per residue, which are assigned the same label. Let's see, a phosphate
and a choline, two residues, 2*2=4 possible salt bridges between them.
Seems to add up, doesn't it?

5) More explicit naming would be very nice - in particular in this case because you need to run g_saltbridge again without the -sep flag to get a list of all negative-negative interactions, positive-positive interactions and positive-negative interactions. But even though one has run the command twice it is still not clear for instance which positive-negative interaction between to lipids is which (because you get two with the same name).

dmpc-acid_small.xtc (24.8 MB) dmpc-acid_small.xtc A 2 ns .xtc file of DMPC lipids, small organic acids and positive counter ions Sarah Witzke, 12/20/2009 12:22 PM
dmpcdpac14_tma-1.tpr (1.1 MB) dmpcdpac14_tma-1.tpr The .tpr file for the .xtc file Sarah Witzke, 12/20/2009 12:24 PM


#1 Updated by Sarah Witzke almost 11 years ago

Created an attachment (id=408)
The .tpr file for the .xtc file

#2 Updated by David van der Spoel over 10 years ago

Fixed bug 381 by adding the number of the first atom in the charged group
to the name of the charged group. This should be unique now. For the example
in bugzilla g_saltbr now happily creates > 40000 unique output files.

Also available in: Atom PDF