@@ -551,7 +551,7 @@ def filter_by_zscore(hic_ma, lower_threshold, upper_threshold, perchr=False):
551
551
to avoid introducing bias due to different chromosome numbers
552
552
553
553
"""
554
- print ("filtering by z-score" )
554
+ log . info ("filtering by z-score" )
555
555
to_remove = []
556
556
if perchr :
557
557
for chrname in list (hic_ma .interval_trees ):
@@ -662,22 +662,15 @@ def main(args=None):
662
662
restore_masked_bins = False )
663
663
664
664
assert matrix_shape == ma .matrix .shape
665
- for idx in outlier_regions :
666
- print (idx , ma .cut_intervals [idx ])
667
665
668
666
if args .filteredBed :
669
667
with open (args .filteredBed , 'w' ) as f :
670
668
for outlier_region in set (outlier_regions ):
671
669
interval = ma .cut_intervals [outlier_region ]
672
- f .write ('{}\t {}\t {}\t .\t {}\t .\n ' .format (interval [0 ],
673
- str (interval [1 ]),
674
- str (interval [2 ]),
675
- interval [3 ]))
670
+ f .write ('\t ' .join (str (x ) for x in interval ) + '\n ' )
676
671
# mask filtered regions
677
672
ma .maskBins (outlier_regions )
678
673
total_filtered_out = set (outlier_regions )
679
- print (outlier_regions , "Bins that are MAD outliers ({:.2f}%) "
680
- "out of {}" .format (pct_outlier , ma .matrix .shape [0 ]))
681
674
682
675
if args .sequencedCountCutoff and 0 < args .sequencedCountCutoff < 1 :
683
676
chrom , _ , _ , coverage = zip (* ma .cut_intervals )
0 commit comments