# Surface rdf

**URL:** <https://gromacs.bioexcel.eu/t/surface-rdf/860>\
**Category:** User discussions\
**Created:** [September 23, 2020, 2:09pm UTC](https://gromacs.bioexcel.eu/t/surface-rdf/860 "2020-09-23T14:09:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kosmith](https://avatars.discourse-cdn.com/v4/letter/k/f04885/32.png) [@kosmith](https://gromacs.bioexcel.eu/u/kosmith)\
**Post date:** [September 23, 2020, 2:09pm UTC](https://gromacs.bioexcel.eu/t/surface-rdf/860/1 "2020-09-23T14:09:52Z")

</div>

GROMACS version: 2018  
GROMACS modification: Yes/No

Hello,

I am trying to use the -surf option in gmx rdf in order to compute the rdf of certain molecules from the surface of my reference molecule (nearest atoms).  
My script is:  
gmx rdf -s tpr.tpr -ref ‘resname URA’ -sel ‘resname OCS’ -f xtc.xtc -surf mol -seltype whole\_mol\_com -bin 0.03

Unfortunately, I get the following error:  
“Inconsistency in user input:  
-surf only works with -ref that consists of atoms”

Obviously my molecule consists of atoms. And different scripts that don’t have the -surf flag work perfectly fine.

Anyone has an idea what is the problem?

Here are things I’ve tried but didn’t change the error:

1. I tried adding -selrpos whole\_mol\_com, same error.
2. I tried changing the molecules that I put under “resname X” but for any X it’s the same error.
3. I tried changing the order in which all my flags appear.
4. I tried doing -surf mol and -surf res.
5. I tried running this script on different gromacs versions.

---

<div class="post-metadata">

**Author:** ![MarceloAlbuquerque](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@MarceloAlbuquerque](https://gromacs.bioexcel.eu/u/MarceloAlbuquerque)\
**Post date:** [September 23, 2020, 5:56pm UTC](https://gromacs.bioexcel.eu/t/surface-rdf/860/2 "2020-09-23T17:56:16Z")

</div>

Dear Kosmith,

That means that you must use atoms as -seltype option.

Please, check the following manual (gmx rdf), specifically the second to last paragraph.

> **[gmx rdf — GROMACS 2018.3 documentation](http://manual.gromacs.org/documentation/2018.3/onlinehelp/gmx-rdf.html)**

I hope it helps you.

Best wishes,

Marcelo Albuquerque  
PhD Student  
Physics Institute (IF-UFF)  
Universidade Federal Fluminense (UFF)  
Brazil - Niterói/RJ

---

<div class="post-metadata">

**Author:** ![kosmith](https://avatars.discourse-cdn.com/v4/letter/k/f04885/32.png) [@kosmith](https://gromacs.bioexcel.eu/u/kosmith)\
**Post date:** [September 24, 2020, 5:23am UTC](https://gromacs.bioexcel.eu/t/surface-rdf/860/3 "2020-09-24T05:23:01Z")

</div>

Dear Marcelo,

Thank you for your reply.  
Once I removed the -seltype flag, it works.  
Thanks for your help.  
I don’t know how you knew that was the issue. I read the documentation several times before. But the COM restrictions for -surf flag are only written for the -ref flag, not the -sel flag.

Best,  
Ilan

---

<div class="post-metadata">

**Author:** ![kosmith](https://avatars.discourse-cdn.com/v4/letter/k/f04885/32.png) [@kosmith](https://gromacs.bioexcel.eu/u/kosmith)\
**Post date:** [October 4, 2020, 6:58am UTC](https://gromacs.bioexcel.eu/t/surface-rdf/860/4 "2020-10-04T06:58:53Z")

</div>

Hello Marcelo,

The code works now, but it causes some unnormalized-looking g® (see attached png file):

 ![g(r)](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/1X/70ea16f707afde541a3b58563a8e5c9088c58565.png)

gmx\_mpi rdf -s tpr.tpr -ref ‘resname TST’ -sel 'resname RER -f movie.xtc -o test.xvg -bin 0.03 -surf res

Any idea why? And how do I fix this?

Thanks again,  
Ilan

---

<div class="post-metadata">

**Author:** ![Dr\_DBW](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/dr_dbw/32/42_2.png) [@Dr\_DBW](https://gromacs.bioexcel.eu/u/Dr_DBW)\
**Post date:** [October 5, 2020, 12:51am UTC](https://gromacs.bioexcel.eu/t/surface-rdf/860/5 "2020-10-05T00:51:46Z")

</div>

How are TST and RER distributed with respect to each other within your simulation?

[http://manual.gromacs.org/documentation/current/onlinehelp/gmx-rdf.html](http://manual.gromacs.org/documentation/current/onlinehelp/gmx-rdf.html)

> For `-surf` , the selection provided to `-ref` must select atoms, i.e., centers of mass are not supported. Further, `-nonorm` is implied, as the bins have irregular shapes and the volume of a bin is not easily computable.

> `none` : Use only the first factor. In this case, the RDF is only scaled with the bin width to make the integral of the curve represent the number of pairs within a range.

In other words the RDF is not normalised.

---

<div class="post-metadata">

**Author:** ![MarceloAlbuquerque](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@MarceloAlbuquerque](https://gromacs.bioexcel.eu/u/MarceloAlbuquerque)\
**Post date:** [October 5, 2020, 6:54pm UTC](https://gromacs.bioexcel.eu/t/surface-rdf/860/6 "2020-10-05T18:54:26Z")

</div>

I knew that because I had already done that once ago, when I was trying different options to see what would be the outcome.  
In fact, as far as I remember, the error you informed was the same I had gotten previously. That’s why I knew what to do. :)

---

<div class="post-metadata">

**Author:** ![MarceloAlbuquerque](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@MarceloAlbuquerque](https://gromacs.bioexcel.eu/u/MarceloAlbuquerque)\
**Post date:** [October 5, 2020, 6:56pm UTC](https://gromacs.bioexcel.eu/t/surface-rdf/860/7 "2020-10-05T18:56:47Z")

</div>

I think you must specify an option of normalization, as @Dr_DBW has replied.

---

<div class="post-metadata">

**Author:** ![kosmith](https://avatars.discourse-cdn.com/v4/letter/k/f04885/32.png) [@kosmith](https://gromacs.bioexcel.eu/u/kosmith)\
**Post date:** [October 6, 2020, 6:02am UTC](https://gromacs.bioexcel.eu/t/surface-rdf/860/8 "2020-10-06T06:02:51Z")

</div>

@Dr_DBW @MarceloAlbuquerque So what is the point of RDF with the -surf flag if it’s not normalized?  
What information does it give me?  
The -norm flag doesn’t work with -surf.  
My TST is just one molecule and RER is the solvent, so plenty of RER.
