TrEE-TIMC / circhic

A python library to display HiC data on a circular strip and to integrate genomic data
https://tree-timc.github.io/circhic/
Other
1 stars 2 forks source link

When outer_gdis is 0, plot_hic plots nothing #39

Closed NelleV closed 4 years ago

NelleV commented 4 years ago
from circhic import CircHiCFigure
from circhic import datasets

# Load the data, compute the cumulative raw counts.
data = datasets.load_bsubtilis()
counts = data["counts"]
lengths = data["lengths"]

circhicfig = CircHiCFigure(lengths)
circhicfig.plot_hic(counts, outer_gdis=0, outer_radius=0.75)
ijunier commented 4 years ago

Resolution: at lines 91 and 266 in utils.py, add:

if r_mid < 1:

such that

iS= (R >= r_mid)
Half_s[iR & iS] = ((2+(R[iR & iS] - r_mid)/(1 - r_mid)*(s_out*N/Lg-2))/2).astype(int)

becomes:

if r_mid < 1:
    iS= (R >= r_mid)
    Half_s[iR & iS] = ((2+(R[iR & iS] - r_mid)/(1 - r_mid)*(s_out*N/Lg-2))/2).astype(int)