This commit is contained in:
Gaspard Jankowiak 2024-03-01 13:43:14 +01:00
parent 6d01fb23ed
commit 6d363c4883

View file

@ -25,45 +25,45 @@ from scipy import ndimage
############### GLOBAL VARIABLES ###############
# POPG molar ratio
x_PG = 0.05
CONST_x_PG = 0.05
# ############## POPC and POPG ###############
# 1-palmitoyl-2-oleoyl-sn-glycero-3-phosphocholine
# 1-palmitoyl-2-oleoyl-sn-glycero-3-phosphoglycerol
# number of chain groups
n_CH = 2
n_CH2 = 28
n_CH3 = 2
CONST_n_CH = 2
CONST_n_CH2 = 28
CONST_n_CH3 = 2
#X-ray scattering length chain groups (nm)
b_CH = 1.97256E-05 ;
b_CH2 = 2.25435E-05 ;
b_CH3 = 2.53615E-05 ;
CONST_b_CH = 1.97256E-05 ;
CONST_b_CH2 = 2.25435E-05 ;
CONST_b_CH3 = 2.53615E-05 ;
### POPC
# Lipid-head volume
V_HL_PC = 0.331 # 0.320
CONST_V_HL_PC = 0.331 # 0.320
# X-ray scattering length of head groups (nm)
b_PC = 2.73340E-04
b_CG = 1.88802E-04
b_PCN = 1.97256E-04
b_Chol = 7.60844E-05
CONST_b_PC = 2.73340E-04
CONST_b_CG = 1.88802E-04
CONST_b_PCN = 1.97256E-04
CONST_b_Chol = 7.60844E-05
# Lipid-volume temperature-dependencies a0 + a1*T (nm^3)
a0_V_POPC = 1.22810311835285
a1_V_POPC = 0.000934915795086395
CONST_a0_V_POPC = 1.22810311835285
CONST_a1_V_POPC = 0.000934915795086395
### POPG
# Lipid-head volume
V_HL_PG = 0.289 ;
CONST_V_HL_PG = 0.289 ;
# X-ray Scattering length of head groups (nm)
b_PG = 2.47979E-04
b_PG1 = 1.32443E-04
b_PG2 = 1.15536E-04
CONST_b_PG = 2.47979E-04
CONST_b_PG1 = 1.32443E-04
CONST_b_PG2 = 1.15536E-04
# Lipid-volume temperature-dependencies a0 + a1*T (nm^3)
a0_V_POPG = 1.17881068602663
a1_V_POPG = 0.00108364914520327
CONST_a0_V_POPG = 1.17881068602663
CONST_a1_V_POPG = 0.00108364914520327
############### Other variables ###############
@ -71,33 +71,33 @@ a1_V_POPG = 0.00108364914520327
# V_PW = 24.5e-3 #(nm^3) Perkins 2001 (Hydration shell in proteins)
# polynome coefficient for T-dependency of bulk-water-molecule volume (V_HW)
# Units in degree Celsius
p0_VW = 0.0299218
p1_VW = -2.25941e-06
p2_VW = 2.5675e-07
p3_VW = -1.69661e-09
p4_VW = 6.52029e-12
CONST_p0_VW = 0.0299218
CONST_p1_VW = -2.25941e-06
CONST_p2_VW = 2.5675e-07
CONST_p3_VW = -1.69661e-09
CONST_p4_VW = 6.52029e-12
# polynome coefficient for T-dependency of bulk-water molar concentration (Cw)
#Units in degree Celsius
p0_Cw = 55.5052
p1_Cw = 0.00131894
p2_Cw = -0.000334396
p3_Cw = 9.10861e-07
CONST_p0_Cw = 55.5052
CONST_p1_Cw = 0.00131894
CONST_p2_Cw = -0.000334396
CONST_p3_Cw = 9.10861e-07
b_HW = 2.8179E-05
d_shl = 0.31 # (nm) Perkins 2001 (Hydration shell in proteins)
CONST_b_HW = 2.8179E-05
CONST_d_shl = 0.31 # (nm) Perkins 2001 (Hydration shell in proteins)
# Composition of the Reconstitution buffer (M)
ctris = 0.02
cEDTA = 0.002
CONST_ctris = 0.02
CONST_cEDTA = 0.002
### Extra molecules
# TRIS buffer
b_tris = 1.860E-04
V_tris = 0.15147 # (nm^3)
CONST_b_tris = 1.860E-04
CONST_V_tris = 0.15147 # (nm^3)
# EDTA
b_EDTA = 4.340E-04 ;
V_EDTA = 0.56430 # (nm^3)
CONST_b_EDTA = 4.340E-04 ;
CONST_V_EDTA = 0.56430 # (nm^3)
##################################################################################################################
@ -110,11 +110,11 @@ def PDF_normal(x, mu, sig) :
#########################################################
def lipid_volume(T) :
return (1-x_PG) * (a0_V_POPC +T * a1_V_POPC) + x_PG * (a0_V_POPG + T * a1_V_POPG)
return (1-CONST_x_PG) * (CONST_a0_V_POPC +T * CONST_a1_V_POPC) + CONST_x_PG * (CONST_a0_V_POPG + T * CONST_a1_V_POPG)
#########################################################
def water_volume(T) :
return p0_VW + p1_VW*T + p2_VW*T**2 + p3_VW*T**3 + p4_VW*T**4
return CONST_p0_VW + CONST_p1_VW*T + CONST_p2_VW*T**2 + CONST_p3_VW*T**3 + CONST_p4_VW*T**4
#########################################################
#@njit(parallel=True)
@ -146,7 +146,7 @@ def mu4(q, Z, a) :
################################ SYMMETRIC VESICLE FOR X-RAY SLDs #########################################
######################################### SDP MODELLING #########################################
######################################## SDP MODELLING #########################################
#################################### SEPARATED FORM FACTOR #########################################
##################################################################################################################
@ -172,48 +172,48 @@ class SDP_base_POPC_RecBuf:
self.T, self.V_BW,
self.Con] = PAR
Cw = p0_Cw + p1_Cw*self.T + p2_Cw*self.T**2 + p3_Cw*self.T**3
xtris = ctris / Cw # mole fraction of free TRIS in bulk
xEDTA = cEDTA / Cw # mole fraction of free EDTA in bulk
Cw = CONST_p0_Cw + CONST_p1_Cw*self.T + CONST_p2_Cw*self.T**2 + CONST_p3_Cw*self.T**3
xtris = CONST_ctris / Cw # mole fraction of free TRIS in bulk
xEDTA = CONST_cEDTA / Cw # mole fraction of free EDTA in bulk
# Volumes
self.V_L = lipid_volume(self.T)
V_HW = water_volume(self.T)
V_HC = self.V_L - ( (1-x_PG) * V_HL_PC + x_PG * V_HL_PG )
V_HC = self.V_L - ( (1-CONST_x_PG) * CONST_V_HL_PC + CONST_x_PG * CONST_V_HL_PG )
# Quasi-molecular volumes
V_CH2 = V_HC / ( n_CH2 + n_CH*self.r12 + n_CH3*self.r32 ) # Volume of CH2 groups
V_CH2 = V_HC / ( CONST_n_CH2 + CONST_n_CH*self.r12 + CONST_n_CH3*self.r32 ) # Volume of CH2 groups
V_CH = V_CH2 * self.r12 # Volume of CH groups
V_CH3 = V_CH2 * self.r32 # Volume of CH3 groups
self.V_CG = V_HL_PC * self.r_CG # Volume of CG group
self.V_PCN = V_HL_PC * self.r_PCN # Volume of PCN group
self.V_Chol = V_HL_PC * (1-self.r_PCN-self.r_CG) # Volume of CholCH3 group
self.V_CG = CONST_V_HL_PC * self.r_CG # Volume of CG group
self.V_PCN = CONST_V_HL_PC * self.r_PCN # Volume of PCN group
self.V_Chol = CONST_V_HL_PC * (1-self.r_PCN-self.r_CG) # Volume of CholCH3 group
V_PG1 = V_HL_PG * 0.16 # Kucerka 2012
V_PG2 = V_HL_PG * ( 1 - 0.51 - 0.16) # Kucerka 2012
V_PG1 = CONST_V_HL_PG * 0.16 # Kucerka 2012
V_PG2 = CONST_V_HL_PG * ( 1 - 0.51 - 0.16) # Kucerka 2012
# Calculation of mean D_C
self.D_C = V_HC / self.A_L
# X-ray scattering lengths (nm)
rho_sol = ( b_HW + xtris*b_tris + xEDTA*b_EDTA ) / V_HW
drho_Chol = ( (1-x_PG)*b_Chol/self.V_Chol + x_PG*b_PG2/V_PG2 ) - rho_sol
drho_PCN = ( (1-x_PG)*b_PCN/self.V_PCN + x_PG*b_PG1/V_PG1 ) - rho_sol
drho_CG = b_CG / self.V_CG - rho_sol
drho_TR = b_tris/ V_tris - rho_sol
drho_CH = b_CH / V_CH - rho_sol
drho_CH2 = b_CH2 / V_CH2 - rho_sol
drho_CH3 = b_CH3 / V_CH3 - rho_sol
drho_HW = b_HW / self.V_BW - rho_sol
rho_sol = ( CONST_b_HW + xtris*CONST_b_tris + xEDTA*CONST_b_EDTA ) / V_HW
drho_Chol = ( (1-CONST_x_PG)*CONST_b_Chol/self.V_Chol + CONST_x_PG*CONST_b_PG2/V_PG2 ) - rho_sol
drho_PCN = ( (1-CONST_x_PG)*CONST_b_PCN/self.V_PCN + CONST_x_PG*CONST_b_PG1/V_PG1 ) - rho_sol
drho_CG = CONST_b_CG / self.V_CG - rho_sol
drho_TR = CONST_b_tris/ CONST_V_tris - rho_sol
drho_CH = CONST_b_CH / V_CH - rho_sol
drho_CH2 = CONST_b_CH2 / V_CH2 - rho_sol
drho_CH3 = CONST_b_CH3 / V_CH3 - rho_sol
drho_HW = CONST_b_HW / self.V_BW - rho_sol
# c-prefactors
c_Chol = ( (1-x_PG)*self.V_Chol + x_PG*V_PG2 ) / self.A_L
c_PCN = ( (1-x_PG)*self.V_PCN + x_PG*V_PG1 ) / self.A_L
c_Chol = ( (1-CONST_x_PG)*self.V_Chol + CONST_x_PG*V_PG2 ) / self.A_L
c_PCN = ( (1-CONST_x_PG)*self.V_PCN + CONST_x_PG*V_PG1 ) / self.A_L
c_CG = self.V_CG / self.A_L
c_TR = V_tris*self.n_TR / self.A_L
c_CH = V_CH * n_CH / self.A_L
c_CH3 = V_CH3 * n_CH3 / self.A_L
c_TR = CONST_V_tris*self.n_TR / self.A_L
c_CH = V_CH * CONST_n_CH / self.A_L
c_CH3 = V_CH3 * CONST_n_CH3 / self.A_L
# calculating scattering amplitude
self.Am=np.zeros(q.shape[0],dtype=float)
@ -225,7 +225,7 @@ class SDP_base_POPC_RecBuf:
self.Am += 2 * (drho_CH3 - drho_CH2) * c_CH3 * FTreal_gauss(self.q, 0, self.s_CH3)
# Adding hydration-water envelope
self.Am += 4 * drho_HW * ( self.d_CG + self.d_PCN + self.d_Chol + d_shl) * FTreal_erf(self.q, (self.D_C+(self.d_CG+self.d_PCN+self.d_Chol+d_shl)/2.), (self.d_CG+self.d_PCN+self.d_Chol+d_shl), self.s_CH2)
self.Am += 4 * drho_HW * ( self.d_CG + self.d_PCN + self.d_Chol + CONST_d_shl) * FTreal_erf(self.q, (self.D_C+(self.d_CG+self.d_PCN+self.d_Chol+CONST_d_shl)/2.), (self.d_CG+self.d_PCN+self.d_Chol+CONST_d_shl), self.s_CH2)
# Adding CG, PCN and CholCH3 groups
self.Am += 2 * (drho_TR - drho_HW) * c_TR * FTreal_gauss(self.q, (self.D_C+self.d_TR/2.), self.s_TR)
self.Am += 2 * (drho_CG - drho_HW) * c_CG * FTreal_gauss(self.q, (self.D_C+self.d_CG/2.), self.s_CG)
@ -250,8 +250,8 @@ class SDP_base_POPC_RecBuf:
CG = Gauss(z_array, self.V_CG, self.D_C+self.d_CG/2., self.s_CG, self.A_L)
PCN = Gauss(z_array, self.V_PCN, self.D_C+self.d_CG+self.d_PCN/2., self.s_PCN, self.A_L)
Chol = Gauss(z_array, self.V_Chol, self.D_C+self.d_CG+self.d_PCN+self.d_Chol/2., self.s_Chol, self.A_L)
TRIS = Gauss(z_array, self.n_TR*V_tris, self.D_C+self.d_TR/2., self.s_TR, self.A_L)
BW = Slab(z_array, self.D_C+(self.d_CG+self.d_PCN+self.d_Chol+d_shl)/2., self.d_CG+self.d_PCN+self.d_Chol+d_shl, self.s_CH2) - CG - PCN - Chol - TRIS
TRIS = Gauss(z_array, self.n_TR*CONST_V_tris, self.D_C+self.d_TR/2., self.s_TR, self.A_L)
BW = Slab(z_array, self.D_C+(self.d_CG+self.d_PCN+self.d_Chol+CONST_d_shl)/2., self.d_CG+self.d_PCN+self.d_Chol+CONST_d_shl, self.s_CH2) - CG - PCN - Chol - TRIS
for i in(BW) :
if i <-0.001 : self.check+= 1
@ -275,40 +275,40 @@ class SDP_POPC_RecBuf:
self.T, self.V_BW,
self.Con] = PAR
Cw = p0_Cw + p1_Cw*self.T + p2_Cw*self.T**2 + p3_Cw*self.T**3
xtris = ctris / Cw # mole fraction of free TRIS in bulk
xEDTA = cEDTA / Cw # mole fraction of free EDTA in bulk
Cw = CONST_p0_Cw + CONST_p1_Cw*self.T + CONST_p2_Cw*self.T**2 + CONST_p3_Cw*self.T**3
xtris = CONST_ctris / Cw # mole fraction of free TRIS in bulk
xEDTA = CONST_cEDTA / Cw # mole fraction of free EDTA in bulk
# Volumes
self.V_L = lipid_volume(self.T)
V_HW = water_volume(self.T)
V_HC = self.V_L - ( (1-x_PG) * V_HL_PC + x_PG * V_HL_PG )
V_HC = self.V_L - ( (1-CONST_x_PG) * CONST_V_HL_PC + CONST_x_PG * CONST_V_HL_PG )
# Calculation of mean D_C
self.D_C = V_HC / self.A_L
# Quasi-molecular volumes
V_CH2 = V_HC / ( n_CH2 + n_CH*self.r12 + n_CH3*self.r32 ) # Volume of CH2 groups
V_CH2 = V_HC / ( CONST_n_CH2 + CONST_n_CH*self.r12 + CONST_n_CH3*self.r32 ) # Volume of CH2 groups
V_CH = V_CH2 * self.r12 # Volume of CH groups
V_CH3 = V_CH2 * self.r32 # Volume of CH3 groups
self.V_CG = V_HL_PC * self.r_CG # Volume of CG group
self.V_PCN = V_HL_PC * self.r_PCN # Volume of PCN group
self.V_Chol = V_HL_PC * (1-self.r_PCN-self.r_CG) # Volume of CholCH3 group
self.V_CG = CONST_V_HL_PC * self.r_CG # Volume of CG group
self.V_PCN = CONST_V_HL_PC * self.r_PCN # Volume of PCN group
self.V_Chol = CONST_V_HL_PC * (1-self.r_PCN-self.r_CG) # Volume of CholCH3 group
V_PG1 = V_HL_PG * 0.16 # Kucerka 2012
V_PG2 = V_HL_PG * ( 1 - 0.51 - 0.16) # Kucerka 2012
V_PG1 = CONST_V_HL_PG * 0.16 # Kucerka 2012
V_PG2 = CONST_V_HL_PG * ( 1 - 0.51 - 0.16) # Kucerka 2012
############### X-ray scattering lengths (nm)
rho_sol = ( b_HW + xtris*b_tris + xEDTA*b_EDTA ) / V_HW
drho_Chol = ( (1-x_PG)*b_Chol/self.V_Chol + x_PG*b_PG2/V_PG2 ) - rho_sol
drho_PCN = ( (1-x_PG)*b_PCN/self.V_PCN + x_PG*b_PG1/V_PG1 ) - rho_sol
drho_CG = b_CG / self.V_CG - rho_sol
drho_TR = b_tris/ V_tris - rho_sol
drho_CH = b_CH / V_CH - rho_sol
drho_CH2 = b_CH2 / V_CH2 - rho_sol
drho_CH3 = b_CH3 / V_CH3 - rho_sol
drho_HW = b_HW / self.V_BW - rho_sol
rho_sol = ( CONST_b_HW + xtris*CONST_b_tris + xEDTA*CONST_b_EDTA ) / V_HW
drho_Chol = ( (1-CONST_x_PG)*CONST_b_Chol/self.V_Chol + CONST_x_PG*CONST_b_PG2/V_PG2 ) - rho_sol
drho_PCN = ( (1-CONST_x_PG)*CONST_b_PCN/self.V_PCN + CONST_x_PG*CONST_b_PG1/V_PG1 ) - rho_sol
drho_CG = CONST_b_CG / self.V_CG - rho_sol
drho_TR = CONST_b_tris/ CONST_V_tris - rho_sol
drho_CH = CONST_b_CH / V_CH - rho_sol
drho_CH2 = CONST_b_CH2 / V_CH2 - rho_sol
drho_CH3 = CONST_b_CH3 / V_CH3 - rho_sol
drho_HW = CONST_b_HW / self.V_BW - rho_sol
############### D_C polydispersity
N = 21
@ -321,14 +321,14 @@ class SDP_POPC_RecBuf:
c_CH3 = np.zeros(HC_array.shape[0],dtype=float)
############### c-prefactors
c_Chol = ( (1-x_PG)*self.V_Chol + x_PG*V_PG2 ) / self.A_L
c_PCN = ( (1-x_PG)*self.V_PCN + x_PG*V_PG1 ) / self.A_L
c_Chol = ( (1-CONST_x_PG)*self.V_Chol + CONST_x_PG*V_PG2 ) / self.A_L
c_PCN = ( (1-CONST_x_PG)*self.V_PCN + CONST_x_PG*V_PG1 ) / self.A_L
c_CG = self.V_CG / self.A_L
c_TR = V_tris*self.n_TR / self.A_L
c_TR = CONST_V_tris*self.n_TR / self.A_L
for hc in range(HC_array.shape[0]):
c_CH[hc] = V_CH * n_CH / (V_HC / HC_array[hc] )
c_CH3[hc] = V_CH3 * n_CH3 / (V_HC / HC_array[hc] )
c_CH[hc] = V_CH * CONST_n_CH / (V_HC / HC_array[hc] )
c_CH3[hc] = V_CH3 * CONST_n_CH3 / (V_HC / HC_array[hc] )
for hc in range(HC_array.shape[0]):
@ -339,7 +339,7 @@ class SDP_POPC_RecBuf:
self.Am[hc] += 2 * (drho_CH3 - drho_CH2) * c_CH3[hc] * FTreal_gauss(self.q, 0, self.s_CH3)
# Adding hydration-water envelope
self.Am[hc] += 4 * drho_HW * ( self.d_CG + self.d_PCN + self.d_Chol + d_shl) * FTreal_erf(self.q, (HC_array[hc]+(self.d_CG+self.d_PCN+self.d_Chol+d_shl)/2.), (self.d_CG+self.d_PCN+self.d_Chol+d_shl), self.s_CH2)
self.Am[hc] += 4 * drho_HW * ( self.d_CG + self.d_PCN + self.d_Chol + CONST_d_shl) * FTreal_erf(self.q, (HC_array[hc]+(self.d_CG+self.d_PCN+self.d_Chol+CONST_d_shl)/2.), (self.d_CG+self.d_PCN+self.d_Chol+CONST_d_shl), self.s_CH2)
# Adding CG, PCN and CholCH3 groups
self.Am[hc] += 2 * (drho_TR - drho_HW) * c_TR * FTreal_gauss(self.q, (HC_array[hc]+self.d_TR/2.), self.s_TR)
self.Am[hc] += 2 * (drho_CG - drho_HW) * c_CG * FTreal_gauss(self.q, (HC_array[hc]+self.d_CG/2.), self.s_CG)
@ -369,8 +369,8 @@ class SDP_POPC_RecBuf:
CG = Gauss(z_array, self.V_CG, self.D_C+self.d_CG/2., self.s_CG, self.A_L)
PCN = Gauss(z_array, self.V_PCN, self.D_C+self.d_CG+self.d_PCN/2., self.s_PCN, self.A_L)
Chol = Gauss(z_array, self.V_Chol, self.D_C+self.d_CG+self.d_PCN+self.d_Chol/2., self.s_Chol, self.A_L)
TRIS = Gauss(z_array, self.n_TR*V_tris, self.D_C+self.d_TR/2., self.s_TR, self.A_L)
BW = Slab(z_array, self.D_C+(self.d_CG+self.d_PCN+self.d_Chol+d_shl)/2., self.d_CG+self.d_PCN+self.d_Chol+d_shl, self.s_CH2) - CG - PCN - Chol - TRIS
TRIS = Gauss(z_array, self.n_TR*CONST_V_tris, self.D_C+self.d_TR/2., self.s_TR, self.A_L)
BW = Slab(z_array, self.D_C+(self.d_CG+self.d_PCN+self.d_Chol+CONST_d_shl)/2., self.d_CG+self.d_PCN+self.d_Chol+CONST_d_shl, self.s_CH2) - CG - PCN - Chol - TRIS
for i in(BW) :
if i <-0.001 : self.check+= 1
@ -380,9 +380,4 @@ class SDP_POPC_RecBuf:
##################################################################################################################
##################################################################################################################
# vim ts=4,sts=4,sw=4