Skip to content

Commit 9f27164

Browse files
committed
add explanation for powerlawfit strategy
1 parent 600cecd commit 9f27164

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/compute_powerlaw_fit_from_hic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def do_powerlaw_fit(HiC):
109109
# Juicebox output is in sparse matrix format. This is an attempt to get a "mean" hic_contact for each distance bin since we don't have the total # of bins available.
110110
HiC_summary = HiC.groupby('dist_for_fit').agg({'hic_contact' : 'sum'})
111111
HiC_summary['hic_contact'] = HiC_summary.hic_contact / HiC_summary.hic_contact.sum() #technically this normalization should be over the entire genome (not just to maxWindow). Will only affect intercept though..
112-
res = stats.linregress(np.log(HiC_summary['dist_for_fit']), np.log(HiC_summary['hic_contact']))
112+
res = stats.linregress(np.log(HiC_summary.index),np.log(HiC_summary['hic_contact']))
113113

114114
hic_mean_var = HiC.groupby('dist_for_fit').agg({'hic_contact' : ['mean','var']})
115115
hic_mean_var.columns = ['mean', 'var']

0 commit comments

Comments
 (0)