Re: Code question: Partitioning the patch contents into water and non-water

From: Floris Buelens (
Date: Sat Aug 18 2007 - 05:20:32 CDT

Hi Vincent,

I can see a couple of ways of doing this may be a bit dirtier than what you have in mind but should get the job done.
First you could make use of eg. the FEP / LES / pair interaction codes, which need to do something similar insofar as they have to be able to tell apart certain 'special' atoms and modify their interactions - for example, look for the 'ifep_type' and 'jfep_type' in the nonbonded code and follow this trail back, you'll find this information is extracted from pdb file flags at startup and is available during the nonbonded calculations. You can pretty easily hijack this or put some analogous structure alongside it - provide a pdb file with solvent and solute atoms differently flagged, and use the information at the level of the nonbonded code to modify your interactions.
A second, cruder way might be just to hard-code the parameters of water-water interactions at the level of nonbonded loops - I mean that water H:O, H:H and O:O pairings should be recognisable by their precise atomic charges and lennard-jones A and B parameters, so you could look out for these exact values and modify the behaviour on the fly - it's not pretty but if you want a quick hack it ought to work.
Hope that's helpful,

Floris Buelens
Department of Crystallography, Birkbeck College, London

----- Original Message ----
From: Vincent Kraeutler <>
Sent: Friday, 17 August, 2007 11:01:24 AM
Subject: namd-l: Code question: Partitioning the patch contents into water and non-water


I'm currently looking into customized water-water interactions. So one
thing I need to do is to partition the atoms contained in a patch into
water and non-water. From what I can tell so far, this seems to be
non-trivial, i.e. it looks like the atoms contained in a given patch
come in no particular order.

I would be deeply grateful if anyone could answer the following questions:

i) Are the atoms in a patch sorted in any particular way? (I think they
are not, but I'm not sure). If so, which one?

ii) If I need to sort the atoms, I suppose it would be best to perform
the sort right after atom migration and before the assignment to compute
objects. Could you suggest where (in the code) I would best do that?
(I'm currently looking at PatchMgr.* and friends with limited success)

iii) How would I go about distinguishing water from non-water atoms? Or
even just solvent from solute atoms? Is there an explicit way to do it,
or would I have to go via topological information?

Thanks & cheers,

Yahoo! Answers - Got a question? Someone out there knows the answer. Try it

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:45:07 CST