libgunshotmatch_mpl.chromatogram¶
Common chromatogram drawing functionality.
Classes:
|
Customised |
Functions:
|
Add a repeat name label to the top left of the given axes. |
|
Annotate largest peaks with compound names. |
|
Draw chromatogram for each repeat in the project. |
|
Draw a combined "chromatogram" for the project. |
|
Draw an arrow above the peak at the given retention time. |
|
Draw a vertical line to the apex of the peak at the given retention time. |
|
Set matplotlib axes to use scientific notation (with math text and one decimal place). |
|
Set matplotlib axes to use scientific notation (with math text). |
- class OneDPScalarFormatter(useOffset=None, useMathText=None, useLocale=None)[source]¶
Bases:
ScalarFormatterCustomised
ScalarFormatterto always show one decimal place.New in version 0.2.0.
- add_repeat_name(axes, repeat_name)[source]¶
Add a repeat name label to the top left of the given axes.
- annotate_peaks(project, figure, ax, *, top_n_peaks=None, minimum_area=0)[source]¶
Annotate largest peaks with compound names.
- Parameters
New in version 0.4.0.
- draw_chromatograms(project, figure, axes)[source]¶
Draw chromatogram for each repeat in the project.
- draw_combined_chromatogram(project, figure, ax, *, top_n_peaks=None, minimum_area=0, use_median=False, use_peak_height=False, use_range=False, show_points=False, colourmap=None)[source]¶
Draw a combined “chromatogram” for the project.
A bar chart for peak area/height styled as a chromatogram, with time on the x-axis.
- Parameters
project (
Project)figure (
Figure)ax (
Axes)top_n_peaks (
Optional[int]) – Show only the n largest peaks. DefaultNone.minimum_area (
float) – Show only peaks larger than the given area (or peak height, as applicable). Default0.use_median (
bool) – Show the median and inter-quartile range, rather than the mean and standard deviation. DefaultFalse.use_peak_height (
bool) – Show the peak height and not the peak area. DefaultFalse.use_range (
bool) – Show the minimum and maximum values in error bar rather than stdev or IQR. DefaultFalse.show_points (
bool) – Show individual retention time / peak area scatter points. DefaultFalse.colourmap (
Union[Colormap,Callable[[float],Tuple[int,int,int,int]],None]) – Optional colourmap function for the bars. By default sequential bars are given colours from the default colour cycle. Ifcolourmapis provided this function calculates the bar colour from the retention time. The function must return a tuple of RGBA values when given a float between 0 and 1. DefaultNone.
New in version 0.2.0.
Changed in version 0.4.0: Added the
use_median,use_peak_heightandshow_pointskeyword arguments.Changed in version 0.5.0:Moved to the
combined_chromatogrammodule.Y-axis label now reflects
use_mediananduse_peak_heightoptions.
Changed in version 0.7.0: Added
use_rangekeyword-only argument.
- draw_peak_arrows(figure, axes, rt, intensity, colour=None)[source]¶
Draw an arrow above the peak at the given retention time.
- draw_peak_vlines(axes, rt, intensity, colour='red')[source]¶
Draw a vertical line to the apex of the peak at the given retention time.