How brunetch123/k2-annotator works
K2 Annotator processes GC-MS data into Level 2 compound annotations, with optional hazard assessment and surrogate recovery reporting. Users can start in the GUI or CLI; the full GUI workflow can convert raw files and run MZmine before matching, while preprocessed feature tables enter at matching. The graph preserves parsing, calibration, normalization, scoring, reporting, provenance and documented external services. Some subsystem links are documented by the README; unsampled implementation details are not inferred.
Main entry points: cli.py Command Line · matching_engine.py Matching Engine · gcms_pipeline.py GC-MS Pipeline · structure_helper.py Structure & Hazard
Components 25
User Entry
- Workflow GUI
scripts/k2_gui.py - GUI Screens
scripts/k2_screens.py - Command Line
scripts/cli.py
Data Preparation
- GC-MS Pipeline
scripts/gcms_pipeline.py - MSConvert
- MZmine
Identification
- Feature Parser
scripts/src/universal_parser.py - RI Calibration
scripts/src/ri_calibration.py - MSP Reader
scripts/src/msp_reader.py - Library Parser
scripts/src/library_parser.py - IS Normalizer
scripts/src/is_normalizer.py - Matching Engine
scripts/src/matching_engine.py - Spectral Scoring
scripts/src/spectral_math.py - RHR Mass Filter
scripts/src/rhrmf.py
Assessment
- Recovery Analysis
scripts/src/surrogate_analyzer.py - Structure & Hazard
scripts/src/structure_helper.py - EPA CompTox Client
scripts/src/ctx_client.py - HTTP Session
scripts/src/http_session.py
Results
- Report Generator
scripts/src/reporter.py - Summary Tables
scripts/src/summary_tables.py - Recovery Reports
scripts/src/surrogate_reporter.py - Run Provenance
scripts/src/run_manifest.py
Other components
- Analyst
- EPA CompTox
- PubChem
Connections 28
- Analyst → Workflow GUI: starts workflow
README.md - Analyst → Command Line: runs matching
README.md - Workflow GUI → GUI Screens: presents screens
scripts/k2_gui.py - GUI Screens → GC-MS Pipeline: starts pipeline
scripts/k2_screens.py - GC-MS Pipeline → MSConvert: converts raw files
README.md - GC-MS Pipeline → MZmine: runs feature detection
README.md - GC-MS Pipeline → Command Line: invokes matching
scripts/gcms_pipeline.py - Command Line → Matching Engine: runs matching
scripts/cli.py - Matching Engine → Feature Parser: parses features
scripts/src/matching_engine.py - Matching Engine → Library Parser: loads library
scripts/src/matching_engine.py - Feature Parser → RI Calibration: calibrates RI
scripts/src/universal_parser.py - Library Parser → MSP Reader: reads MSP
scripts/src/library_parser.py - Matching Engine → IS Normalizer: normalizes abundances
scripts/src/matching_engine.py - Matching Engine → Spectral Scoring: scores spectra
scripts/src/matching_engine.py - Matching Engine → RHR Mass Filter: filters matches
scripts/src/matching_engine.py - RHR Mass Filter → Spectral Scoring: uses mass math
scripts/src/rhrmf.py - Command Line → Recovery Analysis: analyzes recovery
scripts/cli.py - Recovery Analysis → Library Parser: loads standards
scripts/src/surrogate_analyzer.py - Command Line → Structure & Hazard: requests hazard data
- Structure & Hazard → EPA CompTox Client: queries toxicity
scripts/src/structure_helper.py - Structure & Hazard → HTTP Session: sends HTTP requests
scripts/src/structure_helper.py - EPA CompTox Client → EPA CompTox: looks up hazards
README.md - HTTP Session → PubChem: fetches structures
- Command Line → Report Generator: generates reports
scripts/cli.py - Report Generator → Summary Tables: builds summaries
scripts/src/reporter.py - Report Generator → Recovery Reports: adds recovery reports
scripts/src/reporter.py - Command Line → Run Provenance: records provenance
scripts/cli.py - Recovery Reports → Recovery Analysis: formats results
scripts/src/surrogate_reporter.py