emzed.utils¶
NeighbourSearch
¶
Grid-based neighbor lookup for small tolerance windows in numeric data.
find_matches(index, row)
¶
Yield indices of rows that match row within the configured tolerances.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
index of the query row, which is excluded from the result. |
required | |
row
|
row vector to compare against the stored data. |
required |
compute_spectra_alignments(spectra, mz_tolerance)
¶
takes a list of spectra and groups peaks given mz_tolerance. it returns a list of lists. every inner list specifies the alignment of one input spectrum to its follower in the list. One assignment is a list of tuples, where the first entry is a peak index from the first list, the second entry is the index of a peak from the second spectrum.
For example:
if you run this method with a list or tuple of three spectra (s0, s1, s2) the
return values will be [align_0_to_1, align_1_to_2]
an alignment is a list [(i0, j0), (i1, j1), ...]
so that s0.peaks[i0, :] is assigned to s1.peaks[j0, :] and so on.
mock_emzed_gui()
¶
Temporarily inject a dummy emzed_gui module for tests.
temp_file_path()
¶
Yield a temporary file path and clean up the file and directory afterwards.