libgunshotmatch.utils¶
Utility functions.
Functions:
|
Create a new |
|
Returns the minimum and maximum retention times (in minutes) across the repeats. |
|
Returns |
|
Performs a Mass Spectrum similarity calculation two mass spectra. |
|
Truncate precision of retention time to 10 decimal places. |
-
create_alignment(peakpos, expr_code, similarity=0)[source]¶ Create a new
pyms.DPA.Alignment.Alignmentobject.- Parameters
- Return type
New in version 0.8.0.
-
get_rt_range(project)[source]¶ Returns the minimum and maximum retention times (in minutes) across the repeats.
New in version 0.7.0.
-
get_truncated_normal(mean, sd, low=0, upp=10, count=10, random_state=None)[source]¶ Returns
countvalues from a truncated normal distrubition.- Parameters
mean (
float) – The midpoint of the normal distribution.sd (
float) – The spread of the normal distribution (the standard deviation).low (
float) – The lower bound. Default0.upp (
float) – The upper bound. Default10.count (
int) – Default10.random_state (
Optional[int]) – Optional seed for the random number generator. DefaultNone.
- Return type
-
ms_comparison(top_ms, bottom_ms)[source]¶ Performs a Mass Spectrum similarity calculation two mass spectra.
- Parameters
top_ms (
MassSpectrum)bottom_ms (
MassSpectrum)
If either of
top_msorbottom_msisNonethenNoneis returned, otherwise a comparison score is returned.