Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Parameters
----------
amap : 2D array
Pileup.
ignore_central : int, optional
How many central bins to ignore. Has to be odd or 0. The default is 0.
Returns
-------
float
Insulation strength.
"""
for d in range(ignore_diags):
amap = numutils.fill_diag(amap, np.nan, d)
if d != 0:
amap = numutils.fill_diag(amap, np.nan, -d)
if ignore_central!=0 and ignore_central%2!=1:
raise ValueError(f'ignore_central has to be odd (or 0), got {ignore_central}')
i = (amap.shape[0] - ignore_central)//2
intra = np.nanmean(np.concatenate([amap[:i, :i].ravel(), amap[-i:, -i:].ravel()]))
inter = np.nanmean(np.concatenate([amap[:i, -i:].ravel(), amap[-i:, :i].ravel()]))
return intra/inter
----------
amap : 2D array
Pileup.
ignore_central : int, optional
How many central bins to ignore. Has to be odd or 0. The default is 0.
Returns
-------
float
Insulation strength.
"""
for d in range(ignore_diags):
amap = numutils.fill_diag(amap, np.nan, d)
if d != 0:
amap = numutils.fill_diag(amap, np.nan, -d)
if ignore_central!=0 and ignore_central%2!=1:
raise ValueError(f'ignore_central has to be odd (or 0), got {ignore_central}')
i = (amap.shape[0] - ignore_central)//2
intra = np.nanmean(np.concatenate([amap[:i, :i].ravel(), amap[-i:, -i:].ravel()]))
inter = np.nanmean(np.concatenate([amap[:i, -i:].ravel(), amap[-i:, :i].ravel()]))
return intra/inter