Skip to content

Instantly share code, notes, and snippets.

@goraj
Created June 11, 2018 09:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goraj/fbd77a008045d83a4c74580559f93b65 to your computer and use it in GitHub Desktop.
Save goraj/fbd77a008045d83a4c74580559f93b65 to your computer and use it in GitHub Desktop.
def ic50_in_nM_to_pic50(nM):
try:
return 9.0 - math.log10(float(nM))
except Exception as e:
return 0.0
def ic50_in_uM_to_pic50(uM):
nM = uM * 1000
return ic50_in_nM_to_pic50(nM)
def Ki_in_nM_to_pic50(nM):
# correct according to Kalliokoski et al. using factor 2
return ic50_in_nM_to_pic50(float(nM) * 2.0)
def Ki_in_uM_to_pic50(uM):
nM = uM * 1000
# correct according to Kalliokoski et al. using factor 2
return ic50_in_nM_to_pic50(float(nM) * 2.0)
def pKi_to_pic50(pKi):
# convert pKi to nM
Ki_in_nM = 10.0**(9-float(pKi))
# correct according to Kalliokoski et al. using factor 2
return Ki_in_nM_to_pic50(Ki_in_nM * 2.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment