Module for visualizing spline surfaces fit to 5C counts data.
visualize_spline(counts_list, primermap, bias_factor, spline, grid_points=10, sample_rate=100, log=True, asymmetric=False)¶
Open an interactive pyplot window showing a visualization of a spline surface, overlayed over representative 5C counts data.
counts_list (List[Dict[str, np.ndarray]]) – A list of counts dicts to use as data points to be compared to the spline surface.
primermap (Dict[str, List[Dict[str, Any]]]) – The primermap corresponding to the counts dicts in
bias_factor (str) – The bias factor being plotted. This string must match metadata keys in
primermap. That is to say, if
['length']then we expect
primermap[region][i]['length']to be a number representing the length of the
ith fragment in the region specified by
spline (scipy.interpolate.BivariateSpline) – The spline object to visualize.
grid_points (int) – The number of grid points to use when constructing the wireframe of the surface represented by
sample_rate (int) – Only every
sample_rateth real-data point will be included in the visualization to reduce computational load.
log (bool) – Pass True to show counts on a log-scale axis.
asymmetric (bool) – Pass True to iterate only over the upper-triangular elements of the counts matrices, which can lead to asymmetric visualizations. By default, the algorithm iterates over all elements of the counts matrices, enforcing symmetry in thevisualizations but incurring some redundancy in the actual counts information.
The spline will be displayed in an interactive window via
plt.show(). If your default matplotlib backend is not interactive, this function will try to set your backend to TkAgg. If you prefer to use a different interactive backend, set the
MPLBACKENDenvironment variable before invoking Python.