Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compute the number of hbonds in pdb #112

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions data/hbonds/hbonds.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import mdtraj as md
import os
# _FILE_DIR_ = '.'
top_path = os.path.join(_FILE_DIR_,'top.pdb')
system = md.load_pdb(top_path)
h_bonds = md.baker_hubbard(system, periodic=False)
num = len(h_bonds)

result = True if hbonds(top_path) == num else False
4 changes: 4 additions & 0 deletions data/hbonds/hbonds.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
def hbonds(pdb):
"""
This function returns the number of hydrogen bonds in file pdb via the baker-hubbard method
"""
6 changes: 6 additions & 0 deletions data/hbonds/hbonds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: hbonds
language: python
prompt: hbonds.txt
label: hbonds.py
context: mdtraj
test: hbonds.py
Loading