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

Update coloraf.py #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
28 changes: 18 additions & 10 deletions coloraf.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,37 @@
from pymol import cmd


def coloraf(selection="all"):
def AFcolors(selection="all"):

"""
AUTHOR
Christian Balbin

Christian Balbin

ADAPTATION
Nicolas-Frederic Lipp

DESCRIPTION
Colors Alphafold structures by pLDDT
An improved version of the original
Prevent exact values of 90, 70, and 50 from not being recolored.
Ranges were checked on AFDB to ensure that 90, 70, and 50 match their color scheme, despite the nonsensical model confidence legend available on AFDB website.
The colors now match exactly AFDB color scheme
Replace 'coloraf' by 'AFcolors'

USAGE
coloraf sele
AFcolors sele

PARAMETERS

sele (string)
The name of the selection/object to color by pLDDT. Default: all
"""

cmd.color("blue", f"({selection}) and b > 90")
cmd.color("cyan", f"({selection}) and b < 90 and b > 70")
cmd.color("yellow", f"({selection}) and b < 70 and b > 50")
cmd.color("orange", f"({selection}) and b < 50")
cmd.color("0x0053D6", f"({selection}) and (b > 90 or b = 90)")
cmd.color("0x64CBF3", f"({selection}) and ((b < 90 and b > 70) or b = 70)")
cmd.color("0xFFDB13", f"({selection}) and ((b < 70 and b > 50) or b = 50)")
cmd.color("0xFE7D45", f"({selection}) and b < 50")


cmd.extend("coloraf", coloraf)
cmd.auto_arg[0]["coloraf"] = [cmd.object_sc, "object", ""]
cmd.extend("AFcolors", AFcolors)
cmd.auto_arg[0]["AFcolors"] = [cmd.object_sc, "object", ""]