Skip to content

Commit

Permalink
Fixed filter when restraints are active
Browse files Browse the repository at this point in the history
  • Loading branch information
brianjimenez committed Feb 14, 2019
1 parent d98e7c1 commit f666e52
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/post/lgd_filter_restraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ def get_restraints(restraints_file):
line = line.rstrip(os.linesep)
if line:
if line.startswith('R'):
restraints_receptor.add(line)
restraints_receptor.add(line.split[1])
if line.startswith('L'):
restraints_ligand.add(line)
restraints_ligand.add(line.split[1])
return restraints_receptor, restraints_ligand


Expand Down Expand Up @@ -110,14 +110,14 @@ def parse_command_line():
contacts = protein_contacts.select(args.cutoff, ligand)
if contacts:
for contact in contacts:
contacts_receptor.add("R {}.{}.{}".format(contact.getChid(), contact.getResname(), contact.getResnum()))
contacts_receptor.add("{}.{}.{}".format(contact.getChid(), contact.getResname(), contact.getResnum()))

# Contacts on ligand side
protein_contacts = Contacts(ligand)
contacts = protein_contacts.select(args.cutoff, receptor)
if contacts:
for contact in contacts:
contacts_ligand.add("L {}.{}.{}".format(contact.getChid(), contact.getResname(), contact.getResnum()))
contacts_ligand.add("{}.{}.{}".format(contact.getChid(), contact.getResname(), contact.getResnum()))

# Calculate percentage of satisfied restraints
perc = (len(contacts_receptor & restraints_receptor) + len(contacts_ligand & restraints_ligand)) / total
Expand Down
Empty file modified bin/post/lgd_rank_swarm.py
100644 → 100755
Empty file.

0 comments on commit f666e52

Please sign in to comment.