Skip to content

Instantly share code, notes, and snippets.

@bougui505
Last active January 2, 2016 02:00
Show Gist options
  • Save bougui505/e86aadf2d93c12b02b20 to your computer and use it in GitHub Desktop.
Save bougui505/e86aadf2d93c12b02b20 to your computer and use it in GitHub Desktop.
compute h-bonds with chimera. Launch it with chimera --nogui --script 'contacts.py structure.pdb'
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# for chimera 1.4
from chimera import runCommand
import sys
rec_file = sys.argv[1]
basename = rec_file.split('/')[-1].split('.')[0]
#runCommand("open 0 receptor.pdb")
runCommand("open 0 %s"%rec_file)
runCommand("hbonds intramodel true distSlop 0.65 angleSlop 80 saveFile output/%s_hbonds.txt namingStyle serial"%basename)
runCommand("findclash #0 test #0 overlapCutoff 0 hbondAllowance 0 intraRes true saveFile output/%s_contacts.txt namingStyle serial"%basename)
runCommand("close 1")
runCommand("close 0")
#for ligNum in range(1, 1001):
#runCommand("open 1 ligand.%03d.pdb" % ligNum)
#runCommand("hbonds intramodel false saveFile ligand.%03d.hbonds" %
#ligNum)
#runCommand("close 1")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment