# Format Conversion Conditional Logic

> Use when you have generated a lipid spectral library (with lipid identities, adducts, m/z values, and fragmentation patterns) and need to export it for downstream mass spectrometry analysis on either an Orbitrap (via Excalibur DDA) or via Skyline's transition-based workflow.

- Skill: `holobiomicslab/format-conversion-conditional-logic-2` (Agent Skill)
- Install (CLI): `npx skillmds@latest add holobiomicslab/format-conversion-conditional-logic-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/holobiomicslab/format-conversion-conditional-logic-2/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- License: CC-BY-4.0
- Author: HolobiomicsLab (https://skillmd.com/u/holobiomicslab)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/holobiomicslab/format-conversion-conditional-logic-2

---


# Conditional Format Conversion for Mass Spectrometry Data

> **License: restricted** — no clear open-source license detected for the underlying tool; verify licensing before commercial use or redistribution. <!-- asb-license-banner -->
## Summary

This skill conditionally serializes spectral library data from an in-memory representation into one of two distinct CSV schemas—Excalibur precursor lists for DDA on orbitrap or Skyline transition lists—based on user-selected format. It bridges the gap between a unified spectral library generation pipeline and instrument-specific data requirements.

## When to use

You have generated a lipid spectral library (with lipid identities, adducts, m/z values, and fragmentation patterns) and need to export it for downstream mass spectrometry analysis on either an Orbitrap (via Excalibur DDA) or via Skyline's transition-based workflow. Use this skill when the same library must support multiple instrument/software workflows without re-running library generation.

## When NOT to use

- Library data is already in MSP (NIST spectral library) format and must remain there; use MSP export instead of conditional CSV conversion.
- You need to export to a third instrument platform not supported by Excalibur or Skyline (e.g. SWATH-MS or ion mobility devices); extend the conditional logic first.
- Input spectral library has not yet been generated or lacks fragmentation patterns and m/z annotations; complete library generation before attempting format conversion.

## Inputs

- In-memory lipid spectral library (lipid identities, adducts, precursor m/z, charge states, retention times, fragmentation patterns)
- User-selected format parameter (Excalibur or Skyline)

## Outputs

- CSV file in Excalibur-compatible precursor list schema (precursor m/z, charge state, retention time, etc.)
- CSV file in Skyline-compatible transition list schema (precursor m/z, product ion m/z, transition metadata, etc.)

## How to apply

Prompt the user to select a target format (Excalibur or Skyline) as an input parameter. Load the in-memory spectral library representation containing precursor m/z, charge states, retention times, and fragmentation patterns. For Excalibur format: extract precursor m/z, charge state, and retention time; serialize with Excalibur-required column headers and row structure. For Skyline format: extract precursor m/z, product ion m/z values, and transition-specific metadata; serialize with Skyline-required headers and transition list structure. Write the formatted CSV to file with a naming convention reflecting the selected format. The rationale is that each instrument expects a distinct tabular schema; conditional logic at serialization time avoids maintaining parallel library generation paths.

## Related tools

- **Excalibur** (Target instrument software for DDA analysis on orbitrap; defines precursor list CSV schema (precursor m/z, charge state, retention time) consumed by this format.)
- **Skyline** (Target software for targeted proteomics/lipidomics; consumes transition list CSV schema (precursor m/z, product ion m/z, transition metadata) generated by this conditional format converter.)
- **LSG** (Upstream spectral library generator that produces the in-memory lipid library representation (lipid identities, adducts, m/z, fragmentation patterns) fed into this format conversion skill.) — https://github.com/98104781/LSG/releases/tag/v1.3.0

## Evaluation signals

- CSV file contains all required columns for the selected format: Excalibur (precursor m/z, charge state, retention time) or Skyline (precursor m/z, product ion m/z, transition metadata).
- All rows in the output CSV correspond to entries in the source spectral library; no precursor m/z, charge state, or fragment ion values are missing or corrupted.
- CSV header row matches the instrument-specific schema (Excalibur or Skyline); a tool-agnostic CSV importer should fail on the wrong schema.
- File naming convention reflects the selected format (e.g. '_excalibur.csv' or '_skyline.csv').
- Spot-check: open output CSV in target software (Excalibur or Skyline) without parse errors; precursor/transition counts match library size.

## Limitations

- The README does not specify the exact column headers or row structure required by Excalibur and Skyline; implementation must be validated against official schema documentation for each tool.
- Conditional logic is binary (Excalibur vs. Skyline); adding support for a third format requires code modification and re-release.
- Fragmentation patterns are lossy in CSV format (transition lists flatten spectral peaks); full spectrum information is only preserved in MSP export.
- Retention time data may be absent or approximate in early library versions; Skyline transition lists may not include reliable iRT or RT calibration.

## Evidence

- [other] User-selected format determines CSV schema: "Accept user format selection (Excalibur or Skyline) as input parameter."
- [other] Excalibur format structure: "For Excalibur format: extract precursor m/z, charge state, and retention time; serialize as CSV with Excalibur-required column headers and row structure."
- [other] Skyline format structure: "For Skyline format: extract precursor m/z, product ion m/z values, and transition-specific metadata; serialize as CSV with Skyline-required column headers and transition list structure."
- [readme] CSV export as alternative to MSP: "Spectral libraries can be exported with the file extension '.MSP' selected. Otherwise, an Excalibur compatible precursor list (for DDA analysis via orbitrap) or Skylike compatible transition list may"
- [readme] Instrument-specific use case: "Excalibur compatible precursor list (for DDA analysis via orbitrap)"

