RDF calculation results are not normalized when using "around" in atom group selection #4872
Unanswered
Chengeng-Yang
asked this question in
Q&A
Replies: 1 comment
-
Looking at the source code mdanalysis/package/MDAnalysis/analysis/rdf.py Lines 314 to 318 in 263bbe6 g1 and g2 at the last frame. With an updating AtomGroup (as in your second example), you will get a different number than if you had the same number of waters in the group at every step (first example). Thus, I'd say, the norm="rdf" is not guaranteed to work with updating groups.
I'd think, You can raise an issue for this problem (if you have the "Create issue from this discussion" link then you can use it directly). At a minimum, RDF should fail if |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Dear Developers,
I'm posting this because I have a question regarding RDF calculation inconsistency. I realized that the calculation results are not normalized when I used "around" in atom group selection of one group.
I have a quick example below:
Case 1
from MDAnalysis.tests.datafiles import TPR,XTC
from MDAnalysis.analysis import rdf
u1 = mda.Universe(TPR,XTC)
res60 = u1.select_atoms('resid 60')
water60 = u1.select_atoms('resname SOL')
rdf1 = rdf.InterRDF(res60, water60,
nbins=75, # default
range=(0.0, 15.0), # distance in angstroms
)
rdf1.run()
plt.plot(rdf1.results.bins,rdf1.results.rdf)
Case 2
from MDAnalysis.tests.datafiles import TPR,XTC
from MDAnalysis.analysis import rdf
u1 = mda.Universe(TPR,XTC)
res60 = u1.select_atoms('resid 60')
water60 = u1.select_atoms('byres resname SOL and around 15 group res60',res60 = res60, updating = True)
rdf1 = rdf.InterRDF(res60, water60,
nbins=75, # default
range=(0.0, 15.0), # distance in angstroms
)
rdf1.run()
plt.plot(rdf1.results.bins,rdf1.results.rdf)
Question
Could anyone help explain why there's such a difference in the rdf calculation and the normalization doesn't work? Usually, norm is set to "rdf" as default. So I was confused how the calculation works. I'm using MDAnalysis 2.4.3 and python 3.8.18. Thanks so much and I appreciate any answers.
Beta Was this translation helpful? Give feedback.
All reactions