opentims++
Public Member Functions | Public Attributes | Friends | List of all members
TimsFrame Class Reference

Public Member Functions

void print () const
 Prints out to stdout a short summary of this frame.
 
size_t data_size_bytes () const
 Return the size of back buffer needed to store raw TIMS data.
 
void decompress (char *decompression_buffer=nullptr, ZSTD_DCtx *decomp_ctx=nullptr)
 Precalculates and memorizes all the information contained within this frame. More...
 
void close ()
 Releases the storage taken by decompress() method, without destroying the frame. Will be called in destructor.
 
void save_to_buffs (uint32_t *frame_ids, uint32_t *scan_ids, uint32_t *tofs, uint32_t *intensities, double *mzs, double *inv_ion_mobilities, double *retention_times, ZSTD_DCtx *decomp_ctx=nullptr)
 Retrieve the MS peak data held by the frame. More...
 
void save_to_matrix_buffer (uint32_t *buf, ZSTD_DCtx *decomp_ctx=nullptr)
 This function is deprecated and intentionally undocumented; do not use.
 

Public Attributes

const uint32_t id
 ID of the frame.
 
const uint32_t num_scans
 Number of scans this frame contains.
 
const uint32_t num_peaks
 Number of peaks this frame contains (summed across all scans)
 
const uint32_t msms_type
 The MS/MS type of this frame.
 

Friends

class TimsDataHandle
 
int tims_sql_callback (void *out, int cols, char **row, char **colnames)
 

Member Function Documentation

◆ decompress()

void TimsFrame::decompress ( char *  decompression_buffer = nullptr,
ZSTD_DCtx *  decomp_ctx = nullptr 
)

Precalculates and memorizes all the information contained within this frame.

This method extracts all the data associated with the frame and stores it in memory. Without it, the data (mz values, intensities, etc.) will be re-calculated every time they are accessed. After this method is called, they will be just retrieved from RAM.

This is a purely performance-enchancing method - it is recommended to call it if repeated access to the frame is necessary, before the access, and to call close() afterward.

Parameters
decompression_bufferoptional, a pre-allocated buffer which will be used for the decompression. If null, a pre-allocated buffer from parent TimsDataFrame will be used, making this method non-thread-safe. If TimsFrame is to be used in multithreaded context, a thread-local buffer must be passed here (or a mutex must be used). The buffer must be at least data_size_bytes() large.
decomp_ctxoptonal, a decompression buffer to be used by the method. If null, a ctx from parent handle will be used, possibly making this non-thread-safe. To ensure thread safety a thread-local context must be passed here.

◆ save_to_buffs()

void TimsFrame::save_to_buffs ( uint32_t *  frame_ids,
uint32_t *  scan_ids,
uint32_t *  tofs,
uint32_t *  intensities,
double *  mzs,
double *  inv_ion_mobilities,
double *  retention_times,
ZSTD_DCtx *  decomp_ctx = nullptr 
)

Retrieve the MS peak data held by the frame.

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 albe to hold at least this->num_peaks values.

Parameters
frame_idsThe repeated ID of this frame.
scan_idsIDs of the scan a peak comes from.
tofsTimes of Flight of peaks.
intensitiesSignal intensities of peaks.
mzsM/Z ratios of peaks.
inv_ion_mobilitiesInverse ion mobilities (in seconds).
retention_timesRetention times (in seconds).

The documentation for this class was generated from the following file: