libgunshotmatch_mpl.combined_chromatogram
¶
Combined “chromatogram” drawing functionality.
A bar chart for peak area/height styled as a chromatogram, with time on the x-axis.
New in version 0.5.0.
Classes:
|
Data for a peak in a combined “chromatogram”. |
Functions:
|
Draw a combined “chromatogram” for the project. |
|
Return data on a peak for a combined “chromatogram”. |
|
Returns data for a combined “chromatogram” for the project. |
|
Returns the appropriate label for the y-axis. |
-
namedtuple
CCPeak
(area_or_height, area_or_height_list, rt, rt_list, errorbar)[source]¶ Bases:
NamedTuple
Data for a peak in a combined “chromatogram”.
-
draw_combined_chromatogram
(project, figure, ax, *, top_n_peaks=None, minimum_area=0, use_median=False, use_peak_height=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
.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. Ifcolourmap
is 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_height
andshow_points
keyword arguments.Changed in version 0.5.0:Moved to the
combined_chromatogram
module.Y-axis label now reflects
use_median
anduse_peak_height
options.
-
get_cc_peak
(peak, use_median=False, use_peak_height=False)[source]¶ Return data on a peak for a combined “chromatogram”.
-
get_combined_chromatogram_data
(project, *, top_n_peaks=None, threshold=0, use_median=False, use_peak_height=False)[source]¶ Returns data for a combined “chromatogram” for the project.
- Parameters
project (
Project
)top_n_peaks (
Optional
[int
]) – Show only the n largest peaks. DefaultNone
.threshold (
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
.show_points – Show individual retention time / peak area scatter points.
- Return type