Smoothing matrix with gaussian filter¶
CoolBox support smoothing the Hi-C contact matrix with gaussian filter.
[1]:
import coolbox
from coolbox.api import *
[2]:
coolbox.__version__
[2]:
'0.3.0'
[3]:
test_hic = "../../../tests/test_data/dothic_chr9_4000000_6000000.hic"
test_interval = "chr9:4000000-6000000"
[4]:
with Feature(depth_ratio=0.5, color="RdYlBu_r"):
raw = DotHiC(test_hic) + Title("Not smooth")
with Feature(norm='log', transform=False):
smo0 = DotHiC(test_hic, gaussian_sigma=0.5) + MinValue(1e-1) + Title("Smooth\nsigma=0.5")
smo1 = DotHiC(test_hic, gaussian_sigma=1) + MinValue(1e-1) + Title("Smooth\nsigma=1.0")
frame = XAxis() + raw + smo0 + smo1
frame.plot(test_interval)
[4]:
CLI code¶
[5]:
%%bash
test_hic="../../../tests/test_data/dothic_chr9_4000000_6000000.hic"
coolbox add XAxis - \
start_with Color "RdYlBu_r" - \
start_with Feature --depth_ratio="0.5" - \
add DotHiC $test_hic - add Title "Not smooth" - \
add DotHiC $test_hic --gaussian_sigma "0.5" --min_value "1e-1" - \
add Title 'Smooth sigma=0.5' - \
add DotHiC $test_hic --gaussian_sigma "1.0" --min_value "1e-1" - \
add Title 'Smooth sigma=1.0' - \
end_with - \
end_with - \
goto "chr9:4000000-6000000" - \
plot /tmp/test_coolbox_smooth.png