Skip to content

Commit

Permalink
Merge pull request #381 from MannLabs/alpharaw-ms-data-base
Browse files Browse the repository at this point in the history
alpharaw hdf reader
  • Loading branch information
GeorgWa authored Nov 22, 2024
2 parents 691af65 + 0ddf758 commit bd9d185
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
8 changes: 8 additions & 0 deletions alphadia/data/alpharaw_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import numba as nb
import numpy as np
import pandas as pd
from alpharaw import ms_data_base as alpharaw_ms_data_base
from alpharaw import mzml as alpharaw_mzml
from alpharaw import sciex as alpharaw_sciex
from alpharaw import thermo as alpharaw_thermo
Expand Down Expand Up @@ -327,6 +328,13 @@ def jitclass(self):
)


class AlphaRawBase(AlphaRaw, alpharaw_ms_data_base.MSData_Base):
def __init__(self, raw_file_path: str, process_count: int = 10, **kwargs):
super().__init__(process_count=process_count)
self.load_hdf(raw_file_path)
self.process_alpharaw(**kwargs)


class MzML(AlphaRaw, alpharaw_mzml.MzMLReader):
def __init__(self, raw_file_path: str, process_count: int = 10, **kwargs):
super().__init__(process_count=process_count)
Expand Down
9 changes: 8 additions & 1 deletion alphadia/workflow/managers/raw_file_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,20 @@ def get_dia_data_object(
shutil.copyfile(dia_data_path, tmp_dia_data_path)
dia_data_path = tmp_dia_data_path

if file_extension.lower() == ".d" or file_extension.lower() == ".hdf":
if file_extension.lower() == ".d":
raw_data_type = "bruker"
dia_data = bruker.TimsTOFTranspose(
dia_data_path,
mmap_detector_events=self._config["general"]["mmap_detector_events"],
)

elif file_extension.lower() == ".hdf":
raw_data_type = "alpharaw"
dia_data = alpharaw_wrapper.AlphaRawBase(
dia_data_path,
process_count=self._config["general"]["thread_count"],
)

elif file_extension.lower() == ".raw":
raw_data_type = "thermo"

Expand Down

0 comments on commit bd9d185

Please sign in to comment.