opentims++
|
Public Member Functions | |
TimsDataHandle (const std::string &tims_data_dir) | |
Open TimsTOF dataset. More... | |
~TimsDataHandle () | |
Close and deallocate the TimsTOF data handle (destructor). | |
TimsFrame & | get_frame (uint32_t frame_no) |
Access a single frame by its ID. | |
const std::unordered_map< uint32_t, TimsFrame > & | get_frame_descs () |
Access a dictionary containing all the frames from this dataset, keyed by ID. | |
size_t | no_peaks_total () const |
Returns the total number of MS peaks in this handle. | |
size_t | no_peaks_in_frames (const uint32_t indexes[], size_t no_indexes) |
Count the peaks in a subset of frames. More... | |
size_t | no_peaks_in_frames (const std::vector< uint32_t > &indexes) |
Count the peaks in a subset of frames. More... | |
size_t | no_peaks_in_slice (uint32_t start, uint32_t end, uint32_t step) |
Count the peaks in a subset of frames, selected by a slice. More... | |
uint32_t | min_frame_id () const |
Access the lowest id of a valid frame from this dataset. | |
uint32_t | max_frame_id () const |
Access the highest id of a valid frame from this dataset. | |
bool | has_frame (uint32_t frame_id) const |
Check whether a frame with provided ID exists in the dataset. | |
void | extract_frames (const uint32_t *indexes, size_t no_indexes, uint32_t *result) |
This function is deprecated, and left deliberately undocumented; do not use. | |
void | extract_frames (const std::vector< uint32_t > &indexes, uint32_t *result) |
This function is deprecated, and left deliberately undocumented; do not use. | |
void | extract_frames_slice (uint32_t start, uint32_t end, uint32_t step, uint32_t *result) |
This function is deprecated, and left deliberately undocumented; do not use. | |
void | extract_frames (const uint32_t *indexes, size_t no_indexes, uint32_t *frame_ids, uint32_t *scan_ids, uint32_t *tofs, uint32_t *intensities, double *mzs, double *inv_ion_mobilities, double *retention_times) |
This function is deprecated, and left deliberately undocumented; do not use. | |
void | extract_frames (const std::vector< uint32_t > &indexes, uint32_t *frame_ids, uint32_t *scan_ids, uint32_t *tofs, uint32_t *intensities, double *mzs, double *inv_ion_mobilities, double *retention_times) |
Extract a subset of frames, selected by indexes, filling provided buffers with MS peak data. More... | |
void | extract_frames_slice (uint32_t start, uint32_t end, uint32_t step, uint32_t *frame_ids, uint32_t *scan_ids, uint32_t *tofs, uint32_t *intensities, double *mzs, double *inv_ion_mobilities, double *retention_times) |
Extract a subset of frames, selected by a slice, filling provided buffers with MS peak data. More... | |
void | allocate_buffers () |
void | ensure_buffers_allocated () |
void | free_buffers () |
size_t | max_peaks_in_frame () |
Return the maximal number of peaks in the biggest frame in this dataset. | |
size_t | expose_frame (size_t frame_id) |
Expermental API - use discouraged. | |
const std::unique_ptr< uint32_t[]> & | scan_ids_buffer () |
Expermental API - use discouraged. | |
const std::unique_ptr< uint32_t[]> & | tofs_buffer () |
Expermental API - use discouraged. | |
const std::unique_ptr< uint32_t[]> & | intensities_buffer () |
Expermental API - use discouraged. | |
Friends | |
class | BrukerTof2MzConverter |
class | BrukerScan2InvIonMobilityConverter |
class | TimsFrame |
int | tims_sql_callback (void *out, int cols, char **row, char **colnames) |
TimsDataHandle::TimsDataHandle | ( | const std::string & | tims_data_dir | ) |
Open TimsTOF dataset.
Open a TimsTOF dataset (read-only access supported). Return a handle using which Tims data may be retrieved.
Path | to the dataset (typically a *.d directory, containing a analysis.tdf and analysis.tdf_bin files). |
|
inline |
Extract a subset of frames, selected by indexes, filling provided buffers with MS peak data.
The data is saved to the passed buffers - if some of this data is unnecessary, then nullptr may be passed as the corresponding pointer. The buffers are passed and returned by columns. Each row corresponds to one MS peak. Each buffer must be able to hold at least no_peaks_in_frames(indexes) values.
indexes | Set of indexes of frames for which data is to be obtained. |
frame_ids | The IDs of frames containing the associated peaks. |
scan_ids | IDs of the scan a peak comes from. |
tofs | Times of Flight of peaks. |
intensities | Signal intensities of peaks. |
mzs | M/Z ratios of peaks. |
inv_ion_mobilities | Inverse ion mobilities (in seconds). |
retention_times | Retention times (in seconds). |
void TimsDataHandle::extract_frames_slice | ( | uint32_t | start, |
uint32_t | end, | ||
uint32_t | step, | ||
uint32_t * | frame_ids, | ||
uint32_t * | scan_ids, | ||
uint32_t * | tofs, | ||
uint32_t * | intensities, | ||
double * | mzs, | ||
double * | inv_ion_mobilities, | ||
double * | retention_times | ||
) |
Extract a subset of frames, selected by a slice, filling provided buffers with MS peak data.
The data is saved to the passed buffers - if some of this data is unnecessary, then nullptr may be passed as the corresponding pointer. The buffers are passed and returned by columns. Each row corresponds to one MS peak. Each buffer must be able to hold at least no_peaks_in_slice(start, stop, end) values.
IDs of the returned frames come from start:stop:step slice.
indexes | Start of the slice. |
end | End of the slice. |
step | Step of the slice. |
frame_ids | The IDs of frames containing the associated peaks. |
scan_ids | IDs of the scan a peak comes from. |
tofs | Times of Flight of peaks. |
intensities | Signal intensities of peaks. |
mzs | M/Z ratios of peaks. |
inv_ion_mobilities | Inverse ion mobilities (in seconds). |
retention_times | Retention times (in seconds). |
|
inline |
Count the peaks in a subset of frames.
Returns the total number of peaks in the frames with given indexes.
indexes | Indexes of frames to count |
size_t TimsDataHandle::no_peaks_in_frames | ( | const uint32_t | indexes[], |
size_t | no_indexes | ||
) |
Count the peaks in a subset of frames.
Returns the total number of peaks in the frames with given indexes.
indexes | Indexes of frames to count |
no_indexes | Number of indexes (and length of the indexes[] table). |
size_t TimsDataHandle::no_peaks_in_slice | ( | uint32_t | start, |
uint32_t | end, | ||
uint32_t | step | ||
) |
Count the peaks in a subset of frames, selected by a slice.
Returns the total number of peaks in frames with IDs contained in the start:stop:end slice