-
Notifications
You must be signed in to change notification settings - Fork 1
Raw data access
After you successfully build the proteolizard binary, you are ready to connect to a timsTOF TDF-file. This is done by creating a handle to the raw-datset which we can use to fetch parts of the raw-data required. We can also have a look at metadata such as frame types (MS-I vs MS-II), quadrupole settings during PASEF etc.
import pandas as pd
import numpy as np
from proteolizarddata.data import PyTimsDataHandleDDA
handle = PyTimsDataHandle('path/to/dataset.d')
print(handle.meta_data)
Id | Time | Polarity | ScanMode | MsMsType | TimsId | MaxIntensity | SummedIntensities | NumScans | NumPeaks | MzCalibration | T1 | T2 | TimsCalibration | PropertyGroup | AccumulationTime | RampTime | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 1 | 0.554466 | + | 8 | 0 | 0 | 2312 | 12276207 | 918 | 211960 | 1 | 25.6798 | 25.3503 | 1 | 1 | 99.953 | 99.953 |
1 | 2 | 0.807918 | + | 8 | 8 | 520192 | 646 | 51427 | 918 | 715 | 1 | 25.6798 | 25.3501 | 1 | 1 | 99.953 | 99.953 |
2 | 3 | 0.912566 | + | 8 | 8 | 524288 | 574 | 61312 | 918 | 830 | 1 | 25.6798 | 25.3501 | 1 | 1 | 99.953 | 99.953 |
The simplest form of raw-data fetching is to get a single TimsFrame by its Id, which represents a collection of ion-mobility separated mass spectra at a single retention time:
frame = handle.get_frame(1)
print(frame)
Wich will return a TimsFrame:
TimsFrame(id: 1, num data-points: 211960, sum intensity: 12270522)
You can also query all frames in a given retention time range (caution, rt-start/rt-end values should be given in seconds):
slice = slic = handle.get_slice_rt_range(120, 180)
Wich will return a TimsSlice:
TimsSlice(frame start: 1130, frame end: 1691)