Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
Evry-Paris-Saclay
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
2024 Competition
Software Tools
Evry-Paris-Saclay
Commits
5af57aea
Commit
5af57aea
authored
5 months ago
by
paradoxe-tech
Browse files
Options
Downloads
Patches
Plain Diff
converted kcal/mol to J/mol
parent
d7f24e04
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
eval/chemutils.py
+15
-5
15 additions, 5 deletions
eval/chemutils.py
with
15 additions
and
5 deletions
eval/chemutils.py
+
15
−
5
View file @
5af57aea
import
math
def
kd
(
delta_G
:
float
,
temperature
:
float
=
298
)
->
float
:
def
kcalmol_to_jmol
(
x
:
float
):
"""
converts an energy from kcal/mol to J/mol
@x (float): energy value to convert (kcal/mol)
@return (float): converted energy value (J/mol)
"""
return
x
*
4184.0
def
kd
(
delta_G
:
float
,
temperature
:
float
=
298.0
)
->
float
:
"""
calculates the affinity constant depending on the binding free energy
@param delta_G: the value of the binding free energy
@param temperature: temperature
, using Kelvin degrees
@return: affinity constant
(alias Kd)
@param delta_G
(float)
: the value of the binding free energy
(kcal/mol)
@param temperature
(float)
: temperature
(kelvin)
@return
(float)
: affinity constant
"""
return
math
.
exp
(
delta_G
/
(
8.314
*
temperature
))
\ No newline at end of file
return
math
.
exp
((
-
1
*
kcalmol_to_jmol
(
delta_G
))
/
(
8.314
*
temperature
))
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment