hic3defdr.plotting.grid module

hic3defdr.plotting.grid.plot_grid(i, j, w, row, col, raw, scaled, mu_hat_alt, mu_hat_null, qvalues, disp_idx, loop_idx, design, fdr, cluster_size, vmax=100, fdr_vmid=0.05, color_cycle=('blue', 'green', 'purple', 'yellow', 'cyan', 'red'), despine=False, **kwargs)[source]

Plots a combination visualization grid focusing on a specific pixel on a specific chromosome, combining heatmaps, cluster outlines, and stripplots.

Parameters:
  • j (i,) – The row and column index of the pixel to focus on.
  • w (int) – The size of the heatmap will be 2*w + 1 bins in each dimension.
  • col (row,) – The row and column indices corresponding to the rows of the raw and scaled matrices.
  • scaled (raw,) – The raw and scaled data for each pixel (rows) and each replicate (columns).
  • mu_hat_null (mu_hat_alt,) – The estimated mean parameter under the alternate and null model, respectively. First dimension is pixels for which dispersion was estimated, whose row and column coordinates in the complete square matrix are given by row[disp_idx] and col[disp_idx], respectively. Columns of mu_hat_alt correspond to conditions, while mu_hat_null has no second dimension.
  • qvalues (np.ndarray) – Vector of q-values called per pixel whose dispersion was estimated and which lies in a loop. The row and column coordinates in the complete square matrix are given by row[disp_idx][loop_idx] and col[disp_idx][loop_idx], respectively.
  • disp_idx (np.ndarray) – Boolean matrix indicating which pixels in zip(row, col) had their dispersion estimated.
  • loop_idx (np.ndarray) – Boolean matrix indicating which pixels in zip(row[disp_idx], col[disp_idx]) lie within loops.
  • design (pd.DataFrame) – Pass a DataFrame with boolean dtype whose rows correspond to replicates and whose columns correspond to conditions. Replicate and condition names will be inferred from the row and column labels, respectively.
  • fdr (float) – The FDR threshold to use when outlining clusters.
  • cluster_size (int) – The cluster size threshold to use when outlining clusters.
  • vmax (float) – The maximum of the colorscale to use when plotting normalized heatmaps.
  • fdr_vmid (float) – The FDR value at the middle of the colorscale used for plotting the q-value heatmap.
  • color_cycle (list of matplotlib colors) – The color cycle to use over conditions.
  • kwargs (kwargs) – Typical plotter kwargs.
Returns:

The first pyplot axis returned is injected by @plotter. The grid of pyplot axes is the second return value from the call to plt.subplots() that is used to create the grid. The function takes two args, an FDR and a cluster size, and redraws the cluster outlines using the new parameters.

Return type:

pyplot axis, grid of pyplot axes, function