pygecko.gc_tools package

Subpackages

Submodules

pygecko.gc_tools.analyte module

class pygecko.gc_tools.analyte.Analyte(rt: float | int, name: str | None = None, smiles: str | None = None)

Bases: object

Analyte class for storing information about analytes.

rt

Retention time of analyte.

Type:

float

name

Name of analyte.

Type:

str

smiles

SMILES string of analyte.

Type:

str

mol

RDKit molecule object of analyte.

Type:

Mol

mol
mz: None | int
name: str
rt: float | int
smiles: str

pygecko.gc_tools.utilities module

class pygecko.gc_tools.utilities.Utilities

Bases: object

static check_interval(value: float, midpoint: float, tolerance: float) bool

Takes in a value, midpoint, and tolerance and returns True if the value is within the interval defined by the midpoint and tolerance.

static convert_time_to_scan(time_value: float | Sequence[float], scan_rate: float) list[int]

Takes in single time or sequence of two times in minutes, returns the closest scan index or a sequence of two indices.

static find_empty_ranges(chromatogram: ndarray, *, threshold: float = 0.0, min_duration: float = 0.0) list[tuple[float, float]]

Find contiguous time ranges where the signal is “empty” (<= threshold or NaN).

Parameters:
  • time_axis (np.ndarray) – 1D array of times (same length as signal), monotonically increasing.

  • signal (np.ndarray) – 1D array of signal values.

  • threshold (float) – Values <= threshold are considered empty. Default 0.0.

  • min_duration (float) – Minimum duration (in time units of time_axis) to report a gap. Default 0.0.

Returns:

List of (start_time, end_time) for empty ranges.

Return type:

list[tuple[float, float]]

Module contents