pyLoopSage 1.0.7__tar.gz → 1.0.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyloopsage-1.0.7 → pyloopsage-1.0.9}/PKG-INFO +1 -1
- {pyloopsage-1.0.7 → pyloopsage-1.0.9}/loopsage/__init__.py +1 -1
- {pyloopsage-1.0.7 → pyloopsage-1.0.9}/loopsage/args_definition.py +9 -6
- {pyloopsage-1.0.7 → pyloopsage-1.0.9}/loopsage/em.py +4 -3
- {pyloopsage-1.0.7 → pyloopsage-1.0.9}/loopsage/md.py +4 -3
- {pyloopsage-1.0.7 → pyloopsage-1.0.9}/loopsage/run.py +3 -3
- {pyloopsage-1.0.7 → pyloopsage-1.0.9}/loopsage/stochastic_simulation.py +5 -5
- {pyloopsage-1.0.7 → pyloopsage-1.0.9}/pyLoopSage.egg-info/PKG-INFO +1 -1
- {pyloopsage-1.0.7 → pyloopsage-1.0.9}/setup.py +1 -1
- {pyloopsage-1.0.7 → pyloopsage-1.0.9}/LICENSE +0 -0
- {pyloopsage-1.0.7 → pyloopsage-1.0.9}/README.md +0 -0
- {pyloopsage-1.0.7 → pyloopsage-1.0.9}/loopsage/initial_structures.py +0 -0
- {pyloopsage-1.0.7 → pyloopsage-1.0.9}/loopsage/plots.py +0 -0
- {pyloopsage-1.0.7 → pyloopsage-1.0.9}/loopsage/preproc.py +0 -0
- {pyloopsage-1.0.7 → pyloopsage-1.0.9}/loopsage/utils.py +0 -0
- {pyloopsage-1.0.7 → pyloopsage-1.0.9}/loopsage/vizualization_tools.py +0 -0
- {pyloopsage-1.0.7 → pyloopsage-1.0.9}/pyLoopSage.egg-info/SOURCES.txt +0 -0
- {pyloopsage-1.0.7 → pyloopsage-1.0.9}/pyLoopSage.egg-info/dependency_links.txt +0 -0
- {pyloopsage-1.0.7 → pyloopsage-1.0.9}/pyLoopSage.egg-info/entry_points.txt +0 -0
- {pyloopsage-1.0.7 → pyloopsage-1.0.9}/pyLoopSage.egg-info/requires.txt +0 -0
- {pyloopsage-1.0.7 → pyloopsage-1.0.9}/pyLoopSage.egg-info/top_level.txt +0 -0
- {pyloopsage-1.0.7 → pyloopsage-1.0.9}/setup.cfg +0 -0
|
@@ -123,8 +123,8 @@ available_platforms = [mm.Platform.getPlatform(i).getName() for i in range(mm.Pl
|
|
|
123
123
|
|
|
124
124
|
args = ListOfArgs([
|
|
125
125
|
# Platform settings
|
|
126
|
-
Arg('PLATFORM', help=f"
|
|
127
|
-
Arg('DEVICE', help="
|
|
126
|
+
Arg('PLATFORM', help=f"Name of the platform. Available choices: {' '.join(available_platforms)}", type=str, default='CPU', val='CPU'),
|
|
127
|
+
Arg('DEVICE', help="Device index for CUDA or OpenCL (count from 0)", type=str, default='', val=''),
|
|
128
128
|
|
|
129
129
|
# Input data
|
|
130
130
|
Arg('N_BEADS', help="Number of Simulation Beads.", type=int, default='', val=''),
|
|
@@ -138,7 +138,7 @@ args = ListOfArgs([
|
|
|
138
138
|
Arg('LEF_RW', help="True in case that you would like to make cohesins slide as random walk, instead of sliding only in one direction.", type=bool, default='True', val='True'),
|
|
139
139
|
Arg('N_STEPS', help="Number of Monte Carlo steps.", type=int, default='', val=''),
|
|
140
140
|
Arg('N_LEF', help="Number of loop extrusion factors (condensins and cohesins).", type=int, default='', val=''),
|
|
141
|
-
Arg('MC_STEP', help="Monte Carlo frequency.", type=int, default='200', val='200'),
|
|
141
|
+
Arg('MC_STEP', help="Monte Carlo frequency. It should be hundreds of steps, except if you would like to include molecular dynamics (MD) and in this case it should be ideally 1.", type=int, default='200', val='200'),
|
|
142
142
|
Arg('BURNIN', help="Burnin-period (steps that are considered before equillibrium).", type=int, default='1000', val='1000'),
|
|
143
143
|
Arg('T_INIT', help="Initial Temperature of the Stochastic Model.", type=float, default='1.8', val='1.8'),
|
|
144
144
|
Arg('T_FINAL', help="Final Temperature of the Stochastic Model.", type=float, default='0.01', val='0.01'),
|
|
@@ -146,6 +146,8 @@ args = ListOfArgs([
|
|
|
146
146
|
Arg('FOLDING_COEFF', help="Folding coefficient.", type=float, default='1.0', val='1.0'),
|
|
147
147
|
Arg('CROSS_COEFF', help="LEF crossing coefficient.", type=float, default='1.0', val='1.0'),
|
|
148
148
|
Arg('BIND_COEFF', help="CTCF binding coefficient.", type=float, default='1.0', val='1.0'),
|
|
149
|
+
Arg('SAVE_PLOTS', help="It should be true in case that you would like to save diagnostic plots. In case that you use small MC_STEP or large N_STEPS is better to mark it as False.", type=bool, default='True', val='True'),
|
|
150
|
+
Arg('SAVE_MDT', help="In case that you would liketo save metadata of the stochastic simulation.", type=bool, default='True', val='True'),
|
|
149
151
|
|
|
150
152
|
# Molecular Dynamic Properties
|
|
151
153
|
Arg('INITIAL_STRUCTURE_TYPE', help="you can choose between: rw, confined_rw, self_avoiding_rw, helix, circle, spiral, sphere.", type=str, default='rw', val='rw'),
|
|
@@ -158,6 +160,7 @@ args = ListOfArgs([
|
|
|
158
160
|
Arg('EV_FF_STRENGTH', help="Excluded-volume strength.", type=float, default='10.0', val='10.0'),
|
|
159
161
|
Arg('FRICTION',help='Friction coefficient of the Langevin integrator.',type=float, default='0.1', val='0.1'),
|
|
160
162
|
Arg('TOLERANCE', help="Tolerance that works as stopping condition for energy minimization.", type=float, default='0.001', val='0.001'),
|
|
161
|
-
Arg('
|
|
162
|
-
Arg('
|
|
163
|
-
|
|
163
|
+
Arg('VIZ_HEATS', help="Visualize the output average heatmap.", type=bool, default='True', val='True'),
|
|
164
|
+
Arg('SIM_TEMP', help="The temperature of the 3D simulation (EM or MD).", type=Quantity, default='310 kelvin', val='310 kelvin'),
|
|
165
|
+
Arg('SIM_STEP', help="This is the amount of simulation steps that are perform each time that we change the loop forces. If this number is too high, the simulation is slow, if is too low it may not have enough time to adapt the structure to the new constraints.", type=int, default='10', val='10'),
|
|
166
|
+
])
|
|
@@ -68,17 +68,18 @@ class EM_LE:
|
|
|
68
68
|
print('Energy minimizations done :D\n')
|
|
69
69
|
|
|
70
70
|
self.avg_heat = sum_heat/counter
|
|
71
|
-
|
|
71
|
+
|
|
72
72
|
if plots:
|
|
73
73
|
figure(figsize=(10, 10))
|
|
74
74
|
plt.imshow(self.avg_heat,cmap="Reds",vmax=1)
|
|
75
75
|
plt.colorbar()
|
|
76
|
+
np.save(self.path+f'/other/avg_heatmap.npy',self.avg_heat)
|
|
76
77
|
plt.savefig(self.path+f'/plots/avg_heatmap.svg',format='svg',dpi=500)
|
|
77
78
|
plt.savefig(self.path+f'/plots/avg_heatmap.pdf',format='pdf',dpi=500)
|
|
78
79
|
# plt.colorbar()
|
|
79
80
|
plt.close()
|
|
80
81
|
|
|
81
|
-
|
|
82
|
+
return self.avg_heat
|
|
82
83
|
|
|
83
84
|
def add_forcefield(self,ms,ns):
|
|
84
85
|
'''
|
|
@@ -96,7 +97,7 @@ class EM_LE:
|
|
|
96
97
|
self.ev_force.addPerParticleParameter('sigma')
|
|
97
98
|
self.system.addForce(self.ev_force)
|
|
98
99
|
for i in range(self.system.getNumParticles()):
|
|
99
|
-
self.ev_force.addParticle([0.
|
|
100
|
+
self.ev_force.addParticle([0.05])
|
|
100
101
|
|
|
101
102
|
# Harmonic bond borce between succesive beads
|
|
102
103
|
self.bond_force = mm.HarmonicBondForce()
|
|
@@ -94,12 +94,13 @@ class MD_LE:
|
|
|
94
94
|
|
|
95
95
|
self.avg_heat = np.average(heats,axis=0)
|
|
96
96
|
self.std_heat = np.std(heats,axis=0)
|
|
97
|
-
|
|
98
|
-
np.save(self.path+f'/other/std_heatmap.npy',self.std_heat)
|
|
97
|
+
|
|
99
98
|
if plots:
|
|
99
|
+
np.save(self.path+f'/other/avg_heatmap.npy',self.avg_heat)
|
|
100
|
+
np.save(self.path+f'/other/std_heatmap.npy',self.std_heat)
|
|
100
101
|
self.plot_heat(self.avg_heat,f'/plots/avg_heatmap.svg')
|
|
101
102
|
self.plot_heat(self.std_heat,f'/plots/std_heatmap.svg')
|
|
102
|
-
|
|
103
|
+
return self.avg_heat
|
|
103
104
|
|
|
104
105
|
def change_loop(self,i):
|
|
105
106
|
force_idx = self.system.getNumForces()-1
|
|
@@ -70,11 +70,11 @@ def main():
|
|
|
70
70
|
|
|
71
71
|
# Run Simulation
|
|
72
72
|
sim = StochasticSimulation(region,chrom,bedpe_file,out_dir=output_name,N_beads=N_beads,N_lef=N_lef)
|
|
73
|
-
Es, Ms, Ns, Bs, Ks, Fs, ufs = sim.run_energy_minimization(N_steps,MC_step,burnin,T,T_min,mode=mode,viz=
|
|
73
|
+
Es, Ms, Ns, Bs, Ks, Fs, ufs = sim.run_energy_minimization(N_steps,MC_step,burnin,T,T_min,mode=mode,viz=args.SAVE_PLOTS,save=args.SAVE_MDT,lef_rw=args.LEF_RW)
|
|
74
74
|
if args.SIMULATION_TYPE=='EM':
|
|
75
|
-
sim.run_EM(args.PLATFORM,args.ANGLE_FF_STRENGTH,args.LE_FF_LENGTH,args.LE_FF_STRENGTH,args.EV_FF_STRENGTH,args.TOLERANCE,args.FRICTION,args.INTEGRATOR_STEP,args.SIM_TEMP)
|
|
75
|
+
sim.run_EM(args.PLATFORM,args.ANGLE_FF_STRENGTH,args.LE_FF_LENGTH,args.LE_FF_STRENGTH,args.EV_FF_STRENGTH,args.TOLERANCE,args.FRICTION,args.INTEGRATOR_STEP,args.SIM_TEMP,args.VIZ_HEATS)
|
|
76
76
|
elif args.SIMULATION_TYPE=='MD':
|
|
77
|
-
sim.run_MD(args.PLATFORM,args.ANGLE_FF_STRENGTH,args.LE_FF_LENGTH,args.LE_FF_STRENGTH,args.EV_FF_STRENGTH,args.TOLERANCE,args.FRICTION,args.INTEGRATOR_STEP,args.SIM_TEMP,args.SIM_STEP)
|
|
77
|
+
sim.run_MD(args.PLATFORM,args.ANGLE_FF_STRENGTH,args.LE_FF_LENGTH,args.LE_FF_STRENGTH,args.EV_FF_STRENGTH,args.TOLERANCE,args.FRICTION,args.INTEGRATOR_STEP,args.SIM_TEMP,args.SIM_STEP,args.VIZ_HEATS)
|
|
78
78
|
elif args.SIMULATION_TYPE==None:
|
|
79
79
|
print('\n3D simulation did not run because it was not specified. Please specify argument SIMULATION_TYPE as EM or MD.')
|
|
80
80
|
else:
|
|
@@ -272,14 +272,14 @@ class StochasticSimulation:
|
|
|
272
272
|
self.N_CTCF = np.max([np.count_nonzero(self.L),np.count_nonzero(self.R)])
|
|
273
273
|
print('Number of CTCF:',self.N_CTCF)
|
|
274
274
|
|
|
275
|
-
def run_EM(self,platform='CPU',angle_ff_strength=200,le_distance=0.0,le_ff_strength=300000.0,ev_ff_strength=10.0,tolerance=0.001,friction=0.1,integrator_step=5*mm.unit.femtosecond,temperature=310):
|
|
275
|
+
def run_EM(self,platform='CPU',angle_ff_strength=200,le_distance=0.0,le_ff_strength=300000.0,ev_ff_strength=10.0,tolerance=0.001,friction=0.1,integrator_step=5*mm.unit.femtosecond,temperature=310,save_plots=True):
|
|
276
276
|
em = EM_LE(self.Ms,self.Ns,self.N_beads,self.burnin,self.MC_step,self.path,platform,angle_ff_strength,le_distance,le_ff_strength,ev_ff_strength,tolerance)
|
|
277
|
-
sim_heat = em.run_pipeline(plots=
|
|
277
|
+
sim_heat = em.run_pipeline(plots=save_plots,friction=friction,integrator_step=integrator_step,temperature=temperature)
|
|
278
278
|
corr_exp_heat(sim_heat,self.bedpe_file,self.region,self.chrom,self.N_beads,self.path)
|
|
279
|
-
|
|
280
|
-
def run_MD(self,platform='CPU',angle_ff_strength=200,le_distance=0.0,le_ff_strength=300000.0,ev_ff_strength=10.0,tolerance=0.001,friction=0.1,integrator_step=5*mm.unit.femtosecond,temperature=310,sim_step=100):
|
|
279
|
+
|
|
280
|
+
def run_MD(self,platform='CPU',angle_ff_strength=200,le_distance=0.0,le_ff_strength=300000.0,ev_ff_strength=10.0,tolerance=0.001,friction=0.1,integrator_step=5*mm.unit.femtosecond,temperature=310,sim_step=100,save_plots=True):
|
|
281
281
|
md = MD_LE(self.Ms,self.Ns,self.N_beads,self.burnin,self.MC_step,self.path,platform,angle_ff_strength,le_distance,le_ff_strength,ev_ff_strength,tolerance)
|
|
282
|
-
sim_heat = md.run_pipeline(plots=
|
|
282
|
+
sim_heat = md.run_pipeline(plots=save_plots,sim_step=sim_step,friction=friction,integrator_step=integrator_step,temperature=temperature)
|
|
283
283
|
corr_exp_heat(sim_heat,self.bedpe_file,self.region,self.chrom,self.N_beads,self.path)
|
|
284
284
|
|
|
285
285
|
def main():
|
|
@@ -6,7 +6,7 @@ with open('README.md', 'r', encoding='utf-8') as f:
|
|
|
6
6
|
|
|
7
7
|
setup(
|
|
8
8
|
name='pyLoopSage', # Package name
|
|
9
|
-
version='1.0.
|
|
9
|
+
version='1.0.9', # Version of the software
|
|
10
10
|
description='An energy-based stochastic model of loop extrusion in chromatin.',
|
|
11
11
|
long_description=long_description,
|
|
12
12
|
long_description_content_type='text/markdown',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|