Readers
High-level entry points for opening timsTOF .d acquisitions.
tdfpy.get_acquisition_type
get_acquisition_type(
analysis_dir: str,
) -> Literal["DDA", "DIA", "PRM", "Unknown"]
Determine the acquisition type (DDA or DIA) of a .d folder by examining the MsMsType values in the Frames table.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
analysis_dir
|
str
|
Path to the .d folder |
required |
Returns:
| Type | Description |
|---|---|
Literal['DDA', 'DIA', 'PRM', 'Unknown']
|
"DDA" if DDA acquisition detected |
Literal['DDA', 'DIA', 'PRM', 'Unknown']
|
"DIA" if DIA acquisition detected |
Literal['DDA', 'DIA', 'PRM', 'Unknown']
|
"PRM" if PRM acquisition detected |
Literal['DDA', 'DIA', 'PRM', 'Unknown']
|
"Unknown" if type cannot be determined |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If analysis.tdf does not exist |
Source code in src/tdfpy/reader.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |
tdfpy.DDA
DDA(analysis_dir: str)
Bases: _DFolder
Open a DDA (Data-Dependent Acquisition) .d folder.
Use as a context manager to ensure the TimsData connection is closed when done.
Exposes MS1 frames via ms1 and precursors via precursors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
analysis_dir
|
str
|
Path to the |
required |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the |
Example
with DDA("/path/to/data.d") as dda:
for frame in dda.ms1:
print(frame.frame_id, frame.time)
Source code in src/tdfpy/reader.py
180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | |
ms1
property
ms1: Ms1FrameLookup[DDAMs1Frame]
Lookup for MS1 frames. Supports indexing by frame ID and .query().
precursors
property
precursors: PrecursorLookup
Lookup for all precursors. Supports indexing by precursor ID and .query().
close
close() -> None
Close the TimsData connection.
Source code in src/tdfpy/reader.py
141 142 143 144 145 | |
tdfpy.DIA
DIA(analysis_dir: str)
Bases: _DFolder
Open a DIA (Data-Independent Acquisition) .d folder.
Use as a context manager to ensure the TimsData connection is closed when done.
Exposes MS1 frames via ms1, individual windows via windows, and window groups
via window_groups.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
analysis_dir
|
str
|
Path to the |
required |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the |
Example
with DIA("/path/to/data.d") as dia:
for group in dia.window_groups:
for window in group.windows:
print(window.isolation_mz)
Source code in src/tdfpy/reader.py
338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 | |
ms1
property
ms1: Ms1FrameLookup[DIAMs1Frame]
Lookup for MS1 frames. Supports indexing by frame ID and .query().
windows
property
windows: DiaWindowLookup
Lookup for all DIA windows. Supports indexing by window index and .query().
window_groups
property
window_groups: Generator[DiaWindowGroup, None, None]
Iterate over all DiaWindowGroup objects across all window groups.
close
close() -> None
Close the TimsData connection.
Source code in src/tdfpy/reader.py
141 142 143 144 145 | |
tdfpy.PRM
PRM(analysis_dir: str)
Bases: _DFolder
PRM (Parallel Reaction Monitoring) acquisition mode.
Note
Not yet implemented. Raises NotImplementedError on instantiation.
Source code in src/tdfpy/reader.py
482 483 | |
close
close() -> None
Close the TimsData connection.
Source code in src/tdfpy/reader.py
141 142 143 144 145 | |