pyLoopSage 1.1.6__tar.gz → 1.1.7__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.1.6/pyLoopSage.egg-info → pyloopsage-1.1.7}/PKG-INFO +40 -33
- {pyloopsage-1.1.6 → pyloopsage-1.1.7}/README.md +39 -32
- {pyloopsage-1.1.6 → pyloopsage-1.1.7}/loopsage/__init__.py +1 -1
- {pyloopsage-1.1.6 → pyloopsage-1.1.7}/loopsage/args_definition.py +1 -0
- {pyloopsage-1.1.6 → pyloopsage-1.1.7}/loopsage/preproc.py +6 -6
- {pyloopsage-1.1.6 → pyloopsage-1.1.7}/loopsage/run.py +2 -1
- {pyloopsage-1.1.6 → pyloopsage-1.1.7}/loopsage/stochastic_simulation.py +7 -7
- pyloopsage-1.1.7/loopsage/utils.py +1197 -0
- {pyloopsage-1.1.6 → pyloopsage-1.1.7/pyLoopSage.egg-info}/PKG-INFO +40 -33
- {pyloopsage-1.1.6 → pyloopsage-1.1.7}/setup.py +1 -1
- pyloopsage-1.1.6/loopsage/utils.py +0 -561
- {pyloopsage-1.1.6 → pyloopsage-1.1.7}/LICENSE +0 -0
- {pyloopsage-1.1.6 → pyloopsage-1.1.7}/MANIFEST.in +0 -0
- {pyloopsage-1.1.6 → pyloopsage-1.1.7}/loopsage/forcefields/classic_sm_ff.xml +0 -0
- {pyloopsage-1.1.6 → pyloopsage-1.1.7}/loopsage/initial_structures.py +0 -0
- {pyloopsage-1.1.6 → pyloopsage-1.1.7}/loopsage/knots.py +0 -0
- {pyloopsage-1.1.6 → pyloopsage-1.1.7}/loopsage/logger.py +0 -0
- {pyloopsage-1.1.6 → pyloopsage-1.1.7}/loopsage/md.py +0 -0
- {pyloopsage-1.1.6 → pyloopsage-1.1.7}/loopsage/plots.py +0 -0
- {pyloopsage-1.1.6 → pyloopsage-1.1.7}/loopsage/vizualization_tools.py +0 -0
- {pyloopsage-1.1.6 → pyloopsage-1.1.7}/pyLoopSage.egg-info/SOURCES.txt +0 -0
- {pyloopsage-1.1.6 → pyloopsage-1.1.7}/pyLoopSage.egg-info/dependency_links.txt +0 -0
- {pyloopsage-1.1.6 → pyloopsage-1.1.7}/pyLoopSage.egg-info/entry_points.txt +0 -0
- {pyloopsage-1.1.6 → pyloopsage-1.1.7}/pyLoopSage.egg-info/requires.txt +0 -0
- {pyloopsage-1.1.6 → pyloopsage-1.1.7}/pyLoopSage.egg-info/top_level.txt +0 -0
- {pyloopsage-1.1.6 → pyloopsage-1.1.7}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyLoopSage
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.7
|
|
4
4
|
Summary: An energy-based stochastic model of loop extrusion in chromatin.
|
|
5
5
|
Home-page: https://github.com/SFGLab/pyLoopSage
|
|
6
6
|
Author: Sebastian Korsak
|
|
@@ -48,7 +48,7 @@ Dynamic: summary
|
|
|
48
48
|
# pyLoopSage
|
|
49
49
|
Updated version of the stochastic loop extrusion model: LoopSage with capability to run incredibly fast, parallelized across CPU cores. This package is even more user-friendly and it can be installed via PyPI.
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+

|
|
52
52
|
|
|
53
53
|
## New features
|
|
54
54
|
|
|
@@ -82,7 +82,7 @@ $K(m_{i},n_{i};m_{j},n_{j})$ which takes the value 1 when $m_{i} < m_{j} < n_{i}
|
|
|
82
82
|
|
|
83
83
|
These $L(\cdot), R(\cdot)$ functions are two functions that define the binding potential and they are orientation specific - so they are different for left and right position of cohesin (because CTCF motifs are orientation specific), therefore when we have a gap in these functions, it means presence of CTCF. These two functions are derived from data with CTCF binning and by running the script for probabilistic orientation. Moreover, by $N_{(\cdot)}$ we symbolize the normalization constants for each factor,
|
|
84
84
|
|
|
85
|
-
$$c_{\text{fold}}=-\dfrac{N_{\text{beads}}f}{N_{\text{lef}}\log(N_{\text{beads}}/N_{\text{lef}})},\quad c_{\text{bind}}=-\dfrac{
|
|
85
|
+
$$c_{\text{fold}}=-\dfrac{N_{\text{beads}}f}{N_{\text{lef}}\log(N_{\text{beads}}/N_{\text{lef}})},\quad c_{\text{bind}}=-\dfrac{2N_{\text{beads}}b}{N_{CTCF}},\quad c_{\text{cross}}=\kappa \times 10^4.$$
|
|
86
86
|
|
|
87
87
|
The parameters are defined in such a way that when $f=b=\kappa=1$, the three terms of the stochastic energy are balanced. To clarrify, this parametrization is slightly different than this of the original paper. We multiply with $N_{\text{beads}}$, so as to keep the input parameters $f,b,\kappa$ simpler close to 1. Therefore, a value $f=0.1$ leads to unfolded structures, and a value $f=2$ it leads to very fast propagating long loops.
|
|
88
88
|
|
|
@@ -341,40 +341,47 @@ An example, illustrated with Chimera software, simulated trajectory of structure
|
|
|
341
341
|
### Long-table of LoopSage arguments
|
|
342
342
|
|
|
343
343
|
#### General Settings
|
|
344
|
-
| Argument
|
|
345
|
-
|
|
346
|
-
| PLATFORM
|
|
347
|
-
| DEVICE
|
|
348
|
-
| OUT_PATH
|
|
349
|
-
| SAVE_MDT
|
|
344
|
+
| Argument | Description | Type | Default |
|
|
345
|
+
|---|---|---|---|
|
|
346
|
+
| PLATFORM | Simulation platform: CPU, CUDA, or OpenCL | str | CPU |
|
|
347
|
+
| DEVICE | CUDA/OpenCL device index (from 0) | str | None |
|
|
348
|
+
| OUT_PATH | Output folder path | str | ../results |
|
|
349
|
+
| SAVE_MDT | Save simulation metadata | bool | True |
|
|
350
350
|
|
|
351
351
|
#### Input Data
|
|
352
|
-
| Argument
|
|
353
|
-
|
|
354
|
-
| INTERACTION_FILE
|
|
355
|
-
| LEF_TRACK_FILE
|
|
356
|
-
| BW_FILES
|
|
357
|
-
|
|
|
358
|
-
|
|
|
359
|
-
|
|
|
360
|
-
|
|
|
352
|
+
| Argument | Description | Type | Default |
|
|
353
|
+
|---|---|---|---|
|
|
354
|
+
| INTERACTION_FILE | Loop/peak file (.bedpe, .bed, or .narrowPeak). Required. | str | None |
|
|
355
|
+
| LEF_TRACK_FILE | bigWig track biasing LEF loading toward enriched regions | str | None |
|
|
356
|
+
| BW_FILES | bigWig file(s) acting as extrusion barriers | list | None |
|
|
357
|
+
| SMOOTHING_INPUT | Smooth noisy/sparse loop-peak signal before use | bool | False |
|
|
358
|
+
| COMP_BW_FILE | bigWig track for A/B compartment bias | str | None |
|
|
359
|
+
| COMP_BED_FILE | BED file for A/B compartment bias (alt. to COMP_BW_FILE) | str | None |
|
|
360
|
+
| DATA_LOSS_MODE | 0 = 1D binding potentials (L/R); 1 = 2D loss interpolated from input loops | int | 0 |
|
|
361
|
+
| CONTRASTIVE_BINDING | If True, penalizes loop-free regions so extrusion is confined within TADs; if False, extrusion is uniform everywhere | bool | False |
|
|
362
|
+
| REGION_START | Region start coordinate | int | None |
|
|
363
|
+
| REGION_END | Region end coordinate | int | None |
|
|
364
|
+
| CHROM | Chromosome of the modeled region | str | None |
|
|
365
|
+
| GENOME | Reference genome for chromosome sizes (e.g. hg38) | str | hg38 |
|
|
366
|
+
| FLOAT_LIST | Extra custom numeric settings | list | None |
|
|
367
|
+
| STRING_LIST | Extra custom text settings | list | None |
|
|
361
368
|
|
|
362
369
|
#### Stochastic Simulation Parameters
|
|
363
|
-
| Argument
|
|
364
|
-
|
|
365
|
-
| N_BEADS
|
|
366
|
-
| N_STEPS
|
|
367
|
-
| MC_STEP
|
|
368
|
-
| BURNIN
|
|
369
|
-
| T_INIT
|
|
370
|
-
| T_FINAL
|
|
371
|
-
| METHOD
|
|
372
|
-
| LEF_RW
|
|
373
|
-
| LEF_DRIFT
|
|
374
|
-
| N_LEF
|
|
375
|
-
| N_LEF2
|
|
376
|
-
| CROSS_LOOP
|
|
377
|
-
| BETWEEN_FAMILIES_PENALTY |
|
|
370
|
+
| Argument | Description | Type | Default |
|
|
371
|
+
|---|---|---|---|
|
|
372
|
+
| N_BEADS | Number of simulation beads | int | None |
|
|
373
|
+
| N_STEPS | Monte Carlo steps | int | 40000 |
|
|
374
|
+
| MC_STEP | Sampling frequency (reduces autocorrelation) | int | 200 |
|
|
375
|
+
| BURNIN | Steps discarded before equilibrium | int | 1000 |
|
|
376
|
+
| T_INIT | Initial temperature | float | 2.0 |
|
|
377
|
+
| T_FINAL | Final temperature | float | 1.0 |
|
|
378
|
+
| METHOD | 'Metropolis' or 'Annealing' | str | 'Annealing' |
|
|
379
|
+
| LEF_RW | Cohesins slide as random walk (vs. one direction) | bool | True |
|
|
380
|
+
| LEF_DRIFT | LEFs bounce back off each other | bool | False |
|
|
381
|
+
| N_LEF | Number of loop extrusion factors | int | None |
|
|
382
|
+
| N_LEF2 | Number of second-family LEFs | int | 0 |
|
|
383
|
+
| CROSS_LOOP | Penalize mi<mj<ni<nj crossings (vs. only mj=ni); pair with LEF_DRIFT if False | bool | True |
|
|
384
|
+
| BETWEEN_FAMILIES_PENALTY | Penalize crossings between LEF families | bool | True |
|
|
378
385
|
|
|
379
386
|
#### Energy Coefficients
|
|
380
387
|
| Argument Name | Description | Type | Default Value |
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# pyLoopSage
|
|
2
2
|
Updated version of the stochastic loop extrusion model: LoopSage with capability to run incredibly fast, parallelized across CPU cores. This package is even more user-friendly and it can be installed via PyPI.
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+

|
|
5
5
|
|
|
6
6
|
## New features
|
|
7
7
|
|
|
@@ -35,7 +35,7 @@ $K(m_{i},n_{i};m_{j},n_{j})$ which takes the value 1 when $m_{i} < m_{j} < n_{i}
|
|
|
35
35
|
|
|
36
36
|
These $L(\cdot), R(\cdot)$ functions are two functions that define the binding potential and they are orientation specific - so they are different for left and right position of cohesin (because CTCF motifs are orientation specific), therefore when we have a gap in these functions, it means presence of CTCF. These two functions are derived from data with CTCF binning and by running the script for probabilistic orientation. Moreover, by $N_{(\cdot)}$ we symbolize the normalization constants for each factor,
|
|
37
37
|
|
|
38
|
-
$$c_{\text{fold}}=-\dfrac{N_{\text{beads}}f}{N_{\text{lef}}\log(N_{\text{beads}}/N_{\text{lef}})},\quad c_{\text{bind}}=-\dfrac{
|
|
38
|
+
$$c_{\text{fold}}=-\dfrac{N_{\text{beads}}f}{N_{\text{lef}}\log(N_{\text{beads}}/N_{\text{lef}})},\quad c_{\text{bind}}=-\dfrac{2N_{\text{beads}}b}{N_{CTCF}},\quad c_{\text{cross}}=\kappa \times 10^4.$$
|
|
39
39
|
|
|
40
40
|
The parameters are defined in such a way that when $f=b=\kappa=1$, the three terms of the stochastic energy are balanced. To clarrify, this parametrization is slightly different than this of the original paper. We multiply with $N_{\text{beads}}$, so as to keep the input parameters $f,b,\kappa$ simpler close to 1. Therefore, a value $f=0.1$ leads to unfolded structures, and a value $f=2$ it leads to very fast propagating long loops.
|
|
41
41
|
|
|
@@ -294,40 +294,47 @@ An example, illustrated with Chimera software, simulated trajectory of structure
|
|
|
294
294
|
### Long-table of LoopSage arguments
|
|
295
295
|
|
|
296
296
|
#### General Settings
|
|
297
|
-
| Argument
|
|
298
|
-
|
|
299
|
-
| PLATFORM
|
|
300
|
-
| DEVICE
|
|
301
|
-
| OUT_PATH
|
|
302
|
-
| SAVE_MDT
|
|
297
|
+
| Argument | Description | Type | Default |
|
|
298
|
+
|---|---|---|---|
|
|
299
|
+
| PLATFORM | Simulation platform: CPU, CUDA, or OpenCL | str | CPU |
|
|
300
|
+
| DEVICE | CUDA/OpenCL device index (from 0) | str | None |
|
|
301
|
+
| OUT_PATH | Output folder path | str | ../results |
|
|
302
|
+
| SAVE_MDT | Save simulation metadata | bool | True |
|
|
303
303
|
|
|
304
304
|
#### Input Data
|
|
305
|
-
| Argument
|
|
306
|
-
|
|
307
|
-
| INTERACTION_FILE
|
|
308
|
-
| LEF_TRACK_FILE
|
|
309
|
-
| BW_FILES
|
|
310
|
-
|
|
|
311
|
-
|
|
|
312
|
-
|
|
|
313
|
-
|
|
|
305
|
+
| Argument | Description | Type | Default |
|
|
306
|
+
|---|---|---|---|
|
|
307
|
+
| INTERACTION_FILE | Loop/peak file (.bedpe, .bed, or .narrowPeak). Required. | str | None |
|
|
308
|
+
| LEF_TRACK_FILE | bigWig track biasing LEF loading toward enriched regions | str | None |
|
|
309
|
+
| BW_FILES | bigWig file(s) acting as extrusion barriers | list | None |
|
|
310
|
+
| SMOOTHING_INPUT | Smooth noisy/sparse loop-peak signal before use | bool | False |
|
|
311
|
+
| COMP_BW_FILE | bigWig track for A/B compartment bias | str | None |
|
|
312
|
+
| COMP_BED_FILE | BED file for A/B compartment bias (alt. to COMP_BW_FILE) | str | None |
|
|
313
|
+
| DATA_LOSS_MODE | 0 = 1D binding potentials (L/R); 1 = 2D loss interpolated from input loops | int | 0 |
|
|
314
|
+
| CONTRASTIVE_BINDING | If True, penalizes loop-free regions so extrusion is confined within TADs; if False, extrusion is uniform everywhere | bool | False |
|
|
315
|
+
| REGION_START | Region start coordinate | int | None |
|
|
316
|
+
| REGION_END | Region end coordinate | int | None |
|
|
317
|
+
| CHROM | Chromosome of the modeled region | str | None |
|
|
318
|
+
| GENOME | Reference genome for chromosome sizes (e.g. hg38) | str | hg38 |
|
|
319
|
+
| FLOAT_LIST | Extra custom numeric settings | list | None |
|
|
320
|
+
| STRING_LIST | Extra custom text settings | list | None |
|
|
314
321
|
|
|
315
322
|
#### Stochastic Simulation Parameters
|
|
316
|
-
| Argument
|
|
317
|
-
|
|
318
|
-
| N_BEADS
|
|
319
|
-
| N_STEPS
|
|
320
|
-
| MC_STEP
|
|
321
|
-
| BURNIN
|
|
322
|
-
| T_INIT
|
|
323
|
-
| T_FINAL
|
|
324
|
-
| METHOD
|
|
325
|
-
| LEF_RW
|
|
326
|
-
| LEF_DRIFT
|
|
327
|
-
| N_LEF
|
|
328
|
-
| N_LEF2
|
|
329
|
-
| CROSS_LOOP
|
|
330
|
-
| BETWEEN_FAMILIES_PENALTY |
|
|
323
|
+
| Argument | Description | Type | Default |
|
|
324
|
+
|---|---|---|---|
|
|
325
|
+
| N_BEADS | Number of simulation beads | int | None |
|
|
326
|
+
| N_STEPS | Monte Carlo steps | int | 40000 |
|
|
327
|
+
| MC_STEP | Sampling frequency (reduces autocorrelation) | int | 200 |
|
|
328
|
+
| BURNIN | Steps discarded before equilibrium | int | 1000 |
|
|
329
|
+
| T_INIT | Initial temperature | float | 2.0 |
|
|
330
|
+
| T_FINAL | Final temperature | float | 1.0 |
|
|
331
|
+
| METHOD | 'Metropolis' or 'Annealing' | str | 'Annealing' |
|
|
332
|
+
| LEF_RW | Cohesins slide as random walk (vs. one direction) | bool | True |
|
|
333
|
+
| LEF_DRIFT | LEFs bounce back off each other | bool | False |
|
|
334
|
+
| N_LEF | Number of loop extrusion factors | int | None |
|
|
335
|
+
| N_LEF2 | Number of second-family LEFs | int | 0 |
|
|
336
|
+
| CROSS_LOOP | Penalize mi<mj<ni<nj crossings (vs. only mj=ni); pair with LEF_DRIFT if False | bool | True |
|
|
337
|
+
| BETWEEN_FAMILIES_PENALTY | Penalize crossings between LEF families | bool | True |
|
|
331
338
|
|
|
332
339
|
#### Energy Coefficients
|
|
333
340
|
| Argument Name | Description | Type | Default Value |
|
|
@@ -172,6 +172,7 @@ args = ListOfArgs([
|
|
|
172
172
|
Arg('INTERACTION_FILE', help="A .bedpe, .bed, or .narrowPeak file path with loops. It is required.", type=str, default='', val=''),
|
|
173
173
|
Arg('LEF_TRACK_FILE', help="An optional track file for cohesin or condensin in bw format. If this file is specified LEF preferentially binds were the signal is enriched.", type=str, default='', val=''),
|
|
174
174
|
Arg('BW_FILES', help="List of bigWig file paths for feature extraction.", type=list, nargs='+', default=[], val=[]),
|
|
175
|
+
Arg('SMOOTHING_INPUT',help="Determines if the input signal from peaks or anchros, will be smoothed.", type=bool, default='False', val='False'),
|
|
175
176
|
Arg('COMP_BW_FILE', help="A bw file for compartmentalization. ", type=str, default='', val=''),
|
|
176
177
|
Arg('COMP_BED_FILE', help="A bed file for compartmentalization. ", type=str, default='', val=''),
|
|
177
178
|
Arg('OUT_PATH', help="Output folder name.", type=str, default='../results', val='../results'),
|
|
@@ -46,7 +46,7 @@ def binding_vectors_from_bedpe(
|
|
|
46
46
|
diagonal_interactions=True,
|
|
47
47
|
alpha=1.0,
|
|
48
48
|
smooth=False,
|
|
49
|
-
smooth_sigma=
|
|
49
|
+
smooth_sigma=1.0,
|
|
50
50
|
contrastive=True
|
|
51
51
|
):
|
|
52
52
|
'''
|
|
@@ -369,7 +369,7 @@ def binding_vectors_from_bedpe(
|
|
|
369
369
|
|
|
370
370
|
plt.close()
|
|
371
371
|
|
|
372
|
-
return
|
|
372
|
+
return L, R, J, np.sqrt(len(loop_lengths))*J_loss, statistics
|
|
373
373
|
|
|
374
374
|
def _prepare_region(chrom, region):
|
|
375
375
|
"""Shared region-resolution logic (identical to binding_vectors_from_bedpe)."""
|
|
@@ -400,7 +400,7 @@ def _binding_vectors_from_single_region(
|
|
|
400
400
|
diagonal_interactions=True,
|
|
401
401
|
alpha=1.0,
|
|
402
402
|
smooth=False,
|
|
403
|
-
smooth_sigma=
|
|
403
|
+
smooth_sigma=1.0,
|
|
404
404
|
contrastive=True,
|
|
405
405
|
source_label="peaks"
|
|
406
406
|
):
|
|
@@ -508,7 +508,7 @@ def _binding_vectors_from_single_region(
|
|
|
508
508
|
plt.savefig(os.path.join(plot_dir, f"LR_profiles_{source_label}.pdf"), dpi=600, format="pdf")
|
|
509
509
|
plt.close()
|
|
510
510
|
|
|
511
|
-
return
|
|
511
|
+
return L, R, J, J_loss, statistics
|
|
512
512
|
|
|
513
513
|
def binding_vectors_from_bed(
|
|
514
514
|
bed_file, N_beads, chrom, region=None, out_path=None,
|
|
@@ -517,7 +517,7 @@ def binding_vectors_from_bed(
|
|
|
517
517
|
diagonal_interactions=True,
|
|
518
518
|
alpha=1.0,
|
|
519
519
|
smooth=False,
|
|
520
|
-
smooth_sigma=
|
|
520
|
+
smooth_sigma=1.0,
|
|
521
521
|
contrastive=True
|
|
522
522
|
):
|
|
523
523
|
'''
|
|
@@ -588,7 +588,7 @@ def binding_vectors_from_narrowpeak(
|
|
|
588
588
|
diagonal_interactions=True,
|
|
589
589
|
alpha=1.0,
|
|
590
590
|
smooth=False,
|
|
591
|
-
smooth_sigma=
|
|
591
|
+
smooth_sigma=1.0,
|
|
592
592
|
contrastive=True
|
|
593
593
|
):
|
|
594
594
|
'''
|
|
@@ -177,7 +177,8 @@ def main():
|
|
|
177
177
|
lef_density_file=args.LEF_TRACK_FILE,
|
|
178
178
|
comp_file=comp_file,
|
|
179
179
|
data_loss_mode=args.DATA_LOSS_MODE,
|
|
180
|
-
contrastive_binding=args.CONTRASTIVE_BINDING
|
|
180
|
+
contrastive_binding=args.CONTRASTIVE_BINDING,
|
|
181
|
+
smooth=args.SMOOTHING_INPUT
|
|
181
182
|
)
|
|
182
183
|
|
|
183
184
|
Es, Ms, Ns, Bs, Ks, Fs, ufs, spins = sim.run_energy_minimization(
|
|
@@ -657,7 +657,8 @@ class StochasticSimulation:
|
|
|
657
657
|
lef_density_file=None,
|
|
658
658
|
comp_file=None,
|
|
659
659
|
data_loss_mode=0,
|
|
660
|
-
contrastive_binding=True
|
|
660
|
+
contrastive_binding=True,
|
|
661
|
+
smooth = False
|
|
661
662
|
):
|
|
662
663
|
"""
|
|
663
664
|
Chromatin stochastic simulation initializer.
|
|
@@ -724,7 +725,7 @@ class StochasticSimulation:
|
|
|
724
725
|
|
|
725
726
|
# Print basic setup
|
|
726
727
|
log.info(f"Number of beads: {self.N_beads}")
|
|
727
|
-
self.preprocessing(contrastive_binding)
|
|
728
|
+
self.preprocessing(contrastive_binding,smooth)
|
|
728
729
|
|
|
729
730
|
# LEF initialization
|
|
730
731
|
self.N_lef = (
|
|
@@ -789,7 +790,7 @@ class StochasticSimulation:
|
|
|
789
790
|
BWs (np.ndarray): binding weight matrices.
|
|
790
791
|
between_families_penalty (bool): whether to apply penalty for interactions between families.
|
|
791
792
|
'''
|
|
792
|
-
fold_norm, fold_norm2, bind_norm, k_norm = -self.N_beads*f/((self.N_lef+self.N_lef2)*np.log(self.N_beads/(self.N_lef+self.N_lef2))), -self.N_beads*f2/((self.N_lef+self.N_lef2)*np.log(self.N_beads/(self.N_lef+self.N_lef2))), -self.N_beads*b/
|
|
793
|
+
fold_norm, fold_norm2, bind_norm, k_norm = -self.N_beads*f/((self.N_lef+self.N_lef2)*np.log(self.N_beads/(self.N_lef+self.N_lef2))), -self.N_beads*f2/((self.N_lef+self.N_lef2)*np.log(self.N_beads/(self.N_lef+self.N_lef2))), -2*self.N_beads*b/self.N_CTCF, kappa*1e4
|
|
793
794
|
epi_norm = epi_coeff
|
|
794
795
|
self.N_steps, self.MC_step = N_steps, MC_step
|
|
795
796
|
r = np.full(self.N_bws, -self.N_beads / 10) if not r and self.N_bws > 0 else (None if not r else r)
|
|
@@ -869,7 +870,7 @@ class StochasticSimulation:
|
|
|
869
870
|
|
|
870
871
|
return self.Es, self.Ms, self.Ns, self.Bs, self.Ks, self.Fs, self.ufs, self.epi_states
|
|
871
872
|
|
|
872
|
-
def preprocessing(self, contrastive_binding):
|
|
873
|
+
def preprocessing(self, contrastive_binding, smooth):
|
|
873
874
|
"""
|
|
874
875
|
Preprocessing pipeline using updated BEDPE/BED/narrowPeak + BigWig exporters.
|
|
875
876
|
|
|
@@ -892,7 +893,7 @@ class StochasticSimulation:
|
|
|
892
893
|
viz=True,
|
|
893
894
|
diagonal_interactions=True,
|
|
894
895
|
alpha=1.0,
|
|
895
|
-
smooth=
|
|
896
|
+
smooth=smooth,
|
|
896
897
|
smooth_sigma=self.N_beads / 100,
|
|
897
898
|
contrastive=contrastive_binding
|
|
898
899
|
)
|
|
@@ -1038,8 +1039,7 @@ class StochasticSimulation:
|
|
|
1038
1039
|
if not do_compartments: self.epi_states=None
|
|
1039
1040
|
md = MD_LE(self.Ms,self.Ns,self.epi_states,self.N_beads,self.path,platform,angle_ff_strength,le_distance,le_ff_strength,ev_ff_strength,ev_ff_power,tolerance)
|
|
1040
1041
|
sim_heat = md.run_pipeline(plots=save_plots,sim_step=sim_step,friction=friction,integrator_step=integrator_step,temperature=temperature,ff_path=ff_path,p_ev=p_ev,init_struct=init_struct,continuous_topoisomerase=continuous_topoisomerase)
|
|
1041
|
-
|
|
1042
|
-
corr_exp_heat(sim_heat,self.interaction_file,self.region,self.chrom,self.N_beads,self.path)
|
|
1042
|
+
corr_exp_heat(sim_heat,self.interaction_file,self.region,self.chrom,self.N_beads,self.path)
|
|
1043
1043
|
|
|
1044
1044
|
def main():
|
|
1045
1045
|
# Definition of Monte Carlo parameters
|