On Jun 18, 2021, at 9:38 AM, yann claveau <yann.c...@gmail.com> wrote:Hello again,Other question: The default angle cutoff in VMD plugin is 20° while it is 150° in MDA. Does the 0° in VMD is 180° in MDA ? I guess it is not but just to be sure...
I have a remark. For someone (as for me) who begins in Python, the doc for hbonds could be clearer. It took me a lot of time to understand how to access the outputs of hbonds.
Indeed:from MDAnalysis.analysis.hydrogenbonds.hbond_analysis importHydrogenBondAnalysis as HBA
hbonds = HBA(universe=u, donors_sel='name O', hydrogens_sel='name H', acceptors_sel='name O', d_h_a_angle_cutoff=30 ,d_a_cutoff=3.0)
results= hbonds.run()
print(results)gives<MDAnalysis.analysis.hydrogenbonds.hbond_analysis.HydrogenBondAnalysis object at 0x7fa4a60f6580>I have to try a dir(results) to understand that results can be accessed through results.hbonds
--
You received this message because you are subscribed to the Google Groups "MDnalysis discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mdnalysis-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mdnalysis-discussion/691a7b17-6ef0-4776-ab50-261de4192aa1n%40googlegroups.com.
Hi Yann,
On Jun 18, 2021, at 9:38 AM, yann claveau <yann.c...@gmail.com> wrote:Hello again,Other question: The default angle cutoff in VMD plugin is 20° while it is 150° in MDA. Does the 0° in VMD is 180° in MDA ? I guess it is not but just to be sure...
Yes, I am pretty sure that this is the case. You need to check how VMD defines the angle, though. MDAnalysis defines it as the angle with the apex at the hydrogen between donor-H…acceptor:acceptor\\ (angle)\hydrogen————donorI have a remark. For someone (as for me) who begins in Python, the doc for hbonds could be clearer. It took me a lot of time to understand how to access the outputs of hbonds.Sorry, there’s a better hbonds tutorial for the User Guide in the works (see PR 133 — you’re very welcome to add there any comments, it helps us a lot to learn what users really want to see).
Indeed:from MDAnalysis.analysis.hydrogenbonds.hbond_analysis importHydrogenBondAnalysis as HBAhbonds = HBA(universe=u, donors_sel='name O', hydrogens_sel='name H', acceptors_sel='name O', d_h_a_angle_cutoff=30 ,d_a_cutoff=3.0)
results= hbonds.run()There’s a misunderstanding here. hbdonds.run() returns itself, namely results == hbonds. This is a design decision that makes it easier to chain method calls if necessary or combine setup and run (see below). Most of the analysis tools work the same way:1. set up the analysis class instance x2. do x.run()3. pull data from x.results as indicated by the docs for the analysis toolOften 1 and 2 are combined:# set up and runx = XAnalysis(…).run()# analyze “observable"plt.plot(x.results.time, x.results.observable)I see that you’re using 2.0.0b. Starting with MDAnalysis 2.0.0 we are trying to make clearer where the computed results are so in 2.x, you’ll find them in hbonds.results.hbonds — all standard analysis tools get the “results” attribute to hold computed data. Once you know this, it makes it easier to discover the output, even if the docs are less clear.
print(results)gives<MDAnalysis.analysis.hydrogenbonds.hbond_analysis.HydrogenBondAnalysis object at 0x7fa4a60f6580>I have to try a dir(results) to understand that results can be accessed through results.hbondsHydrogenBondAnalysis is a complicated analysis tool. We strive to make the docs complete and we appreciate it when you tell us what’s missing from https://docs.mdanalysis.org/2.0.0-dev0/documentation_pages/analysis/hydrogenbonds.html . As I said above, beyond the API docs, we’re also working on tutorial-style docs and we love any contributions — be it comments or otherwise.
To view this discussion on the web visit https://groups.google.com/d/msgid/mdnalysis-discussion/c09b151d-0ae1-4d2d-aa1d-9244be4b0d9an%40googlegroups.com.