Skip to content

Commit

Permalink
add alpharaw base format
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgWa committed Nov 21, 2024
1 parent 27edc96 commit 20a9817
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
9 changes: 9 additions & 0 deletions alphadia/data/alpharaw.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# third party imports
import numpy as np
import pandas as pd
from alpharaw import ms_data_base as alpharawms_data_base
from alpharaw import mzml as alpharawmzml

# TODO fix: "import resolves to its containing file"
Expand Down Expand Up @@ -338,6 +339,14 @@ def jitclass(self):
)


class AlphaRawBase(AlphaRaw, alpharawms_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)
log_stats(self.rt_values, self.cycle)


class MzML(AlphaRaw, alpharawmzml.MzMLReader):
def __init__(self, raw_file_path: str, process_count: int = 10, **kwargs):
super().__init__(process_count=process_count)
Expand Down
8 changes: 7 additions & 1 deletion alphadia/workflow/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,19 @@ 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":
self.reporter.log_metric("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":
self.reporter.log_metric("raw_data_type", "alpharaw")
dia_data = alpharaw.AlphaRawBase(
dia_data_path,
)

elif file_extension.lower() == ".raw":
self.reporter.log_metric("raw_data_type", "thermo")
# check if cv selection exists
Expand Down

0 comments on commit 20a9817

Please sign in to comment.