Skip to content

Commit

Permalink
added Eair term
Browse files Browse the repository at this point in the history
  • Loading branch information
cunlianggeng committed Jun 1, 2017
1 parent 964975e commit bb23737
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pdb_gethaddockterms.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python
"""
Extract HADDOCK terms (Evdw, Eelec, Edesolv and BSA) from a HADDOCK-format PDB file.
Extract HADDOCK terms (Eair, Evdw, Eelec, Edesolv and BSA) from a HADDOCK-format PDB file.
Usage: python pdb_gethaddockterms.py <HADDOCK PDB file>
Example: python pdb_gethaddockterms.py cluster1_1.pdb
Expand Down Expand Up @@ -48,6 +48,7 @@ def ExtractHaddockTerms(pdbfhandle):
ene = line.split(',')
terms['Evdw'] = ene[5].strip()
terms['Eelec'] = ene[6].strip()
terms['Eair'] = ene[7].strip()
elif re.match(r'REMARK Desolvation energy', line):
terms['Edesolv'] = line.split()[3].strip()
elif re.match(r'REMARK buried surface area', line):
Expand All @@ -61,7 +62,7 @@ def ExtractHaddockTerms(pdbfhandle):
def WriteHaddockTerms(pdbfhandle):
terms = ExtractHaddockTerms(pdbfhandle)
if terms:
header = ['Evdw', 'Eelec', 'Edesolv', 'BSA']
header = ['Eair', 'Evdw', 'Eelec', 'Edesolv', 'BSA']
haddockterms = [terms[i] for i in header]
print("\t".join(header))
print("\t".join(haddockterms))
Expand Down

0 comments on commit bb23737

Please sign in to comment.