hic3defdr.plotting.distance_bias module

hic3defdr.plotting.distance_bias.plot_distance_bias(ob, bins, bin_labels=None, idx='disp', threshold=0.05, colors=None, labels=None, xlabel='distance range', legend_label='group', **kwargs)[source]

Plots a bar plot illustrating the degree to which p-values are biased among different distance scales.

This method visualizes distance bias by computing a specified percentile of all p-values called in an analysis, and then computing the proportion of pixels with p-values below this percentile in each distance bin.

Parameters:
  • ob (hic3defdr.HiC3DeFDR object or list of hic3defdr.HiC3DeFDR objects) – The analyis or analyses to inspect for distance bias.
  • bins (list of tuple of int) – Each tuple represents a distance bin as a (min, max) pair, where min and max are distances in bin units and the ranges are inclusive. If either min or max is None, the distance bin will be considered unbounded on that end.
  • bin_labels (list of str) – Pass a list of labels to describe the distance bins.
  • idx ({'disp', 'loop'}) – Pass ‘disp’ to use p-values for all points for which dispersion was estimated. Pass ‘loop’ to only use p-values for points which are in loops.
  • threshold (float) – The percentile to use for the comparison.
  • colors (str or list of str, optional) – If ob is a single object, pass a single color to color the bars in the barplot. If ob is a list of objects, pass a list of colors. Pass None to use automatic colors.
  • labels (list of str, optional) – If ob is a list of objects, you must pass a list of strings to label the objects. Otherwise, this kwarg does nothing.
  • xlabel (str) – The label for the x-axis.
  • legend_label (str) – If ob is a list of objects, the label to use for the legend title. Otherwise, this kwarg does nothing.
  • kwargs (kwargs) – Typical plotter kwargs.
Returns:

The axis plotted on.

Return type:

pyplot axis