# OpenMS-MetaProSIP Agent Notes This file provides context and instructions for coding agents working on OpenMS-MetaProSIP. It follows the [AGENTS.md](https://agents.md) standard. ## What this repository is - The TOPP tool **MetaProSIP** (`src/topp/MetaProSIP.cpp`, namespace `OpenMS`), moved out of [OpenMS/OpenMS](https://github.com/OpenMS/OpenMS) with its history, its TOPP tests and test data (`src/tests/topp`). It registers itself in `share/OpenMS/TOOLS/MetaProSIP.tsv`. - It is built against an **installed OpenMS of the same version** (`find_package(OpenMS EXACT CONFIG COMPONENTS CLI)` in `cmake/find_openms.cmake`): the OpenMS SDK or an OpenMS built from source and installed. That OpenMS must not contain MetaProSIP itself. - It is installed **into the OpenMS prefix** (same `bin/`, `share/OpenMS`): libOpenMS resolves the shared data and the tool registry relative to the executable. - The conventions (layout, CMake, CI, packaging) follow [OpenMS-TOPP-GUI](https://github.com/OpenMS/OpenMS-TOPP-GUI), the first add-on of this kind. - MetaProSIP writes and runs its R scripts (quality report plots) itself; they are kept inline in the C++ on purpose: separate script files under `share/` would have to be found next to the core's `share/OpenMS`, which libOpenMS picks from the core's compiled-in paths. ## Critical Constraints **NEVER do these things:** - Change the OpenMS core from here: a change of OpenMS API, tool registry or install layout needs a PR in OpenMS/OpenMS first (and a release of this add-on can only use what the OpenMS release of the same version has). - Install or package anything the OpenMS core ships (its libraries, TOPP tools, share data). - Commit secrets, credentials, or `.env` files - Skip tests when making code changes **Before opening a pull request, always build the changes locally and run the relevant tests.** ## Quick Commands ```bash # Configure against an installed OpenMS (or the SDK) cmake -S . -B ../OpenMS-MetaProSIP-build -G Ninja -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_PREFIX_PATH="" \ -DOPENMS_TOPP_BIN_DIR="/bin" # for FuzzyDiff # Build everything (includes tests) cmake --build ../OpenMS-MetaProSIP-build -j$(nproc) # Run tests with verbose output ctest --test-dir ../OpenMS-MetaProSIP-build -R MetaProSIP -V # Documentation (doxygen): ../OpenMS-MetaProSIP-build/doc/html-metaprosip/index.html cmake --build ../OpenMS-MetaProSIP-build --target doc ``` ## Repository Layout ``` OpenMS-MetaProSIP/ ├── src/ │ ├── topp/ # MetaProSIP.cpp, executables.cmake (tool declarations) │ └── tests/topp/ # TOPP tests and their data, FuzzyDiff.ini, registry/INI checks ├── doc/ # doxygen setup, main page, ToolDocumenter (generated .cli/.html) ├── cmake/ # find_openms, tool macros (a copy of the core's, see below), │ # install and package macros ├── tools/ci/ # dependency scripts for CI and users └── .github/ # CI: openms-core action (provides the OpenMS core), build, workflows ``` ## Gotchas - **The tool registry**: TOPPBase refuses tools ToolHandler does not list. Running MetaProSIP from the build tree needs `OPENMS_TOOL_REGISTRY_PATH=/share/OpenMS/TOOLS`; the tests set it. - **FuzzyDiff** comes from the core (`OPENMS_TOPP_BIN_DIR`). The SDK has none: the output comparisons are left out with a configure message, not failed. - **Copied CMake**: `cmake/topp_tool_macros.cmake` is a copy of the core's until the core exports it (OpenMS/OpenMS#11035); the class-test framework is not exported either (OpenMS/OpenMS#11034). - **CI core**: until a nightly without MetaProSIP exists, CI builds the core from source (`.github/actions/openms-core`, default mode `source`; `OPENMS_CORE_DEFAULT_REF` in `.github/workflows/test.yml`). ## Guidelines - When CI tests fail, always investigate the root cause first before patching reference files or test expectations. Never bulk-replace expected values or regenerate test outputs as a first approach. - Prefer existing APIs of OpenMS over new helpers. - Keep PR descriptions up to date with the current state of the PR.