Skip to content

Commit

Permalink
convert selection string to atomgroup object
Browse files Browse the repository at this point in the history
Here I convert hbond code from selection strings to atom group object issue MDAnalysis#3933.If you think my approach is correct then please let me know.I will update this full code.Please merge this pull request so i can have pull request for my gsoc
  • Loading branch information
utkarsh147-del committed Feb 12, 2023
1 parent 096f799 commit 5bca13d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions package/MDAnalysis/analysis/hydrogenbonds/hbond_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,11 @@
u = MDAnalysis.Universe(psf, trajectory)
hbonds = HBA(universe=u)
hbonds.hydrogens_sel = hbonds.guess_hydrogens("protein")
hbonds.acceptors_sel = hbonds.guess_acceptors("protein")
hydrogens = u.select_atoms("protein")
acceptors = u.select_atoms("protein")
hbonds = HBA(universe=u)
hbonds.hydrogens_sel = hydrogens
hbonds.acceptors_sel = acceptors
hbonds.run()
Slightly more complex selection strings are also possible. For example, to find hydrogen bonds involving a protein and
Expand Down

0 comments on commit 5bca13d

Please sign in to comment.