metaseq.plotutils.calculate_limits

metaseq.plotutils.calculate_limits(array_dict, method='global', percentiles=None, limit=())[source]

Calculate limits for a group of arrays in a flexible manner.

Returns a dictionary of calculated (vmin, vmax), with the same keys as array_dict.

Useful for plotting heatmaps of multiple datasets, and the vmin/vmax values of the colormaps need to be matched across all (or a subset) of heatmaps.

Parameters:

array_dict : dict of np.arrays

method : {‘global’, ‘independent’, callable}

If method=”global”, then use the global min/max values across all arrays in array_dict. If method=”independent”, then each array will have its own min/max calcuated. If a callable, then it will be used to group the keys of array_dict, and each group will have its own group-wise min/max calculated.

percentiles : None or list

If not None, a list of (lower, upper) percentiles in the range [0,100].