Skip to content

pleskunov/dia-analyzer

Repository files navigation

dia-analyzer

DIA Analyzer is a lightweight C library for identifying scientific instrument data files using header signature matching.

The library reads only the first portion of a file (default: 8 KB) and matches known instrument-specific signatures to determine the file format.

Features

  • Portable C99 implementation
  • Thread-safe
  • No heap allocations
  • Low-level file I/O (open / read / close)
  • Fast signature matching
  • Easy to extend with additional instrument formats
  • Simple C API

Supported file formats

Instrument Extension
PerkinElmer Lambda 1050 .asc
Agilent Cary 7000 UMA .csv
Ocean Optics SpectraSuite .txt
Avantes .txt
Speedflo .csv

Detection algorithm

  1. Read the first 8192 bytes of the file.
  2. Extract the file extension.
  3. If extensions match, compare the header against corresponding signatures.
  4. Return the detected file type descriptor.

The analyzer identifies file formats solely from their header signatures and does not parse or validate any data.

API

int32_t analyze_file(const char *path);

Architecture

include/
    analyzer.h      Public API

src/
    analyzer.c      
    io.c            Low-level file I/O
    util.c          String and buffer utilities
    signatures.c    Known file signatures
    detect.c        Detection engine

tests/
    data/

python-bindings/
    dia-analyzer/
        bindings.py Python bindings.

Contributors

Languages