In [1]:
from pytadbit import load_chromosome
In [2]:
crm = load_chromosome('results/crm18.tdb')
In [3]:
hindiii, mboi = crm.experiments
In [4]:
hindiii
Out[4]:
Load raw data matrices, and normalized matrices
In [5]:
hindiii.load_hic_data('results/HindIII/04_normalizing/100000_raw/chr18.mat')
hindiii.load_norm_data('results/HindIII/04_normalizing/100000_norm/chr18.mat')
mboi.load_hic_data('results/MboI/04_normalizing/100000_raw/chr18.mat')
mboi.load_norm_data('results/MboI/04_normalizing/100000_norm/chr18.mat')
Check that the data is there:
In [6]:
crm.visualize([('HindIII', 'MboI')], normalized=True, paint_tads=True)
Decide which region to model.
In [7]:
crm.visualize([('MboI', 'HindIII')], normalized=True, paint_tads=True,
focus=(670, 770))
We are going to optimize these parameters for both experiments:
In [ ]:
opt_hindiii = hindiii.optimal_imp_parameters(
start=685, end=750,
n_models=40, n_keep=20, n_cpus=8,
upfreq_range=(0, 0.6, 0.3),
lowfreq_range=(-0.9, 0, 0.3),
maxdist_range=(1000, 2000, 500),
dcutoff_range=[1.5, 2, 2.5])
In [ ]:
opt_hindiii.plot_2d(show_best=5)
Refine optimization in a small region:
In [22]:
opt_hindiii.run_grid_search(upfreq_range=(0, 0.3, 0.3), lowfreq_range=(-0.6, -0.3, 0.3),
maxdist_range=[1750],
dcutoff_range=[1.5, 2],
n_cpus=8)
In [11]:
opt_hindiii.plot_2d(show_best=5)
In [12]:
opt_hindiii.run_grid_search(upfreq_range=(0, 0.3, 0.3), lowfreq_range=(-0.3, 0, 0.1),
maxdist_range=[2000, 2250],
dcutoff_range=[1.5, 2],
n_cpus=8)
In [13]:
opt_hindiii.plot_2d(show_best=5)
In [14]:
opt_hindiii.run_grid_search(upfreq_range=(0, 0.3, 0.1), lowfreq_range=(-0.3, 0, 0.1),
n_cpus=8,
maxdist_range=[2000, 2250],
dcutoff_range=[1.5, 2])
In [15]:
opt_hindiii.plot_2d(show_best=5)
In [16]:
opt_hindiii.get_best_parameters_dict()
Out[16]:
For the other replicate, we can reduce the space of search:
In [17]:
opt_mboi = mboi.optimal_imp_parameters(start=685, end=750, n_models=40, n_keep=20, n_cpus=8,
upfreq_range=(0, 0.6, 0.3),
lowfreq_range=(-0.9, -0.3, 0.3),
maxdist_range=(1500, 2000, 500),
dcutoff_range=[1.5, 2])
In [18]:
opt_mboi.plot_2d(show_best=5)
In [19]:
opt_mboi.get_best_parameters_dict()
Out[19]:
In [ ]: