in-silico-spectrum-metadata-curation
License: noncommercial — confirm your use is a permitted (noncommercial) purpose before applying; commercial use requires a separate license (see metadata.tool_license).
Summary
Automatic assignment and validation of ionization adducts ([M+H]+ or [M-H]-) to in-silico mass spectra when adduct metadata is missing or inconsistent. This skill ensures that in-silico spectra conform to chemical ionization polarity conventions before standardization and downstream analysis.
When to use
When processing collections of in-silico mass spectra from OMSLs (Open Mass Spectra Libraries) where the adduct field is absent, null, or not explicitly specified in the source file; particularly when spectra are labeled with ionmode (positive or negative) but lack corresponding adduct annotations. FragHub applies this during the standardization pipeline when ingesting .json, .csv, .msp, or .mgf files containing computational spectra.
When NOT to use
- Spectra already contain an explicit, non-null adduct field—apply validation, not assignment.
- Spectra have ionmode metadata missing entirely—cannot infer adduct without polarity information.
- Experimental (measured) mass spectra, not in-silico—use instrument-reported adduct values instead.
Inputs
- in-silico mass spectra records with missing or null adduct fields
- ionmode metadata ('pos' or 'neg') for each spectrum
- spectrum metadata objects from .json, .csv, .msp, or .mgf source files
Outputs
- in-silico spectra with auto-assigned adducts ([M+H]+ or [M-H]-)
- standardized spectrum records ready for validation and downstream curation
- deletion log for spectra failing adduct-ionmode consistency checks
How to apply
Load in-silico spectrum records and identify those with missing or null adduct fields. Inspect the ionmode field for each spectrum to determine ionization polarity ('pos' or 'neg'). Apply conditional logic: if ionmode is 'pos', assign [M+H]+ adduct; if ionmode is 'neg', assign [M-H]- adduct. Validate that the assigned adduct is consistent with ionmode—reject any spectrum where a negative adduct appears in a positive ionmode spectrum, or vice versa. Write updated spectra records with auto-assigned adducts back to the output database or file. This ensures adduct-ionmode consistency before subsequent filtering and normalization steps.
Related tools
- Python (Scripting language for conditional adduct assignment logic and ionmode validation)
- FragHub (Mass spectrometry data standardization pipeline that implements automatic adduct assignment during in-silico spectrum curation) — https://github.com/eMetaboHUB/FragHub
- spectra-hash (Spectral identifier generation (SPLASH) used for duplicate detection to ensure curation consistency) — https://github.com/berlinguyinca/spectra-hash
Evaluation signals
- All in-silico spectra with previously missing adducts now have [M+H]+ or [M-H]- assigned and persisted in the output file.
- No spectrum remains with an adduct-ionmode inconsistency (e.g., [M-H]- in positive ionmode or [M+H]+ in negative ionmode).
- Spectra failing the adduct-ionmode check are logged with detailed reasons in a DELETION_REASONS subfolder.
- Auto-assigned adducts match the ionmode polarity: positive ionmode → [M+H]+; negative ionmode → [M-H]-.
- Output spectra conform to ISO/IEC 20802-2:2016 .json format (or equivalent for other output formats) with populated adduct field.
Limitations
- Requires ionmode metadata to be present and correctly labeled ('pos' or 'neg')—if ionmode is missing or malformed, adduct assignment cannot proceed.
- Assigns only [M+H]+ and [M-H]- adducts; does not handle other adduct types (e.g., [M+Na]+, [M+NH4]+) commonly seen in experimental spectra.
- Does not validate the chemical plausibility of the in-silico spectrum itself—only checks adduct-ionmode consistency. Spectra may still fail other validation filters (e.g., minimum peak count, entropy threshold, or missing SMILES/InChI).
- In-silico spectra lacking SMILES, InChI, AND InChIKey are removed during processing regardless of successful adduct assignment.
Evidence
- [other] FragHub implements automatic addition of [M+H]+ or [M-H]- adducts to in-silico spectra when the adduct field is absent, with selection based on ionmode consistency.: "FragHub implements automatic addition of [M+H]+ or [M-H]- adducts to in-silico spectra when the adduct field is absent, with selection based on ionmode consistency."
- [other] Apply conditional logic: if ionmode is 'pos', assign [M+H]+ adduct; if ionmode is 'neg', assign [M-H]- adduct.: "if ionmode is 'pos', assign [M+H]+ adduct; if ionmode is 'neg', assign [M-H]- adduct"
- [other] Validate that the assigned adduct is consistent with the ionmode (no negative adducts in positive ionmode, no positive adducts in negative ionmode).: "Validate that the assigned adduct is consistent with the ionmode (no negative adducts in positive ionmode, no positive adducts in negative ionmode)."
- [discussion] auto add [M+H]+ or [M-H]- in In-Silico if adduct is missing.: "auto add [M+H]+ or [M-H]- in In-Silico if adduct is missing."
- [discussion] deleting spectrum if neg adduct in pos spectrum, or pos adduct in neg spectrum: "deleting spectrum if neg adduct in pos spectrum, or pos adduct in neg spectrum"
- [readme] All spectra deemed inconsistent, i.e., those lacking SMILES and InChI, precursor m/z, and adduct information, are removed during the processing by FragHub.: "All spectra deemed inconsistent, i.e., those lacking SMILES and InChI, precursor m/z, and adduct information, are removed during the processing"
1---2name: in-silico-spectrum-metadata-curation3description: Use when when processing collections of in-silico mass spectra from OMSLs (Open Mass Spectra Libraries) where the adduct field is absent, null, or not explicitly specified in the source file;4license: CC-BY-4.05---67# in-silico-spectrum-metadata-curation89> **License: noncommercial** — confirm your use is a permitted (noncommercial) purpose before applying; commercial use requires a separate license (see `metadata.tool_license`). <!-- asb-license-banner -->10## Summary1112Automatic assignment and validation of ionization adducts ([M+H]+ or [M-H]-) to in-silico mass spectra when adduct metadata is missing or inconsistent. This skill ensures that in-silico spectra conform to chemical ionization polarity conventions before standardization and downstream analysis.1314## When to use1516When processing collections of in-silico mass spectra from OMSLs (Open Mass Spectra Libraries) where the adduct field is absent, null, or not explicitly specified in the source file; particularly when spectra are labeled with ionmode (positive or negative) but lack corresponding adduct annotations. FragHub applies this during the standardization pipeline when ingesting .json, .csv, .msp, or .mgf files containing computational spectra.1718## When NOT to use1920- Spectra already contain an explicit, non-null adduct field—apply validation, not assignment.21- Spectra have ionmode metadata missing entirely—cannot infer adduct without polarity information.22- Experimental (measured) mass spectra, not in-silico—use instrument-reported adduct values instead.2324## Inputs2526- in-silico mass spectra records with missing or null adduct fields27- ionmode metadata ('pos' or 'neg') for each spectrum28- spectrum metadata objects from .json, .csv, .msp, or .mgf source files2930## Outputs3132- in-silico spectra with auto-assigned adducts ([M+H]+ or [M-H]-)33- standardized spectrum records ready for validation and downstream curation34- deletion log for spectra failing adduct-ionmode consistency checks3536## How to apply3738Load in-silico spectrum records and identify those with missing or null adduct fields. Inspect the ionmode field for each spectrum to determine ionization polarity ('pos' or 'neg'). Apply conditional logic: if ionmode is 'pos', assign [M+H]+ adduct; if ionmode is 'neg', assign [M-H]- adduct. Validate that the assigned adduct is consistent with ionmode—reject any spectrum where a negative adduct appears in a positive ionmode spectrum, or vice versa. Write updated spectra records with auto-assigned adducts back to the output database or file. This ensures adduct-ionmode consistency before subsequent filtering and normalization steps.3940## Related tools4142- **Python** (Scripting language for conditional adduct assignment logic and ionmode validation)43- **FragHub** (Mass spectrometry data standardization pipeline that implements automatic adduct assignment during in-silico spectrum curation) — https://github.com/eMetaboHUB/FragHub44- **spectra-hash** (Spectral identifier generation (SPLASH) used for duplicate detection to ensure curation consistency) — https://github.com/berlinguyinca/spectra-hash4546## Evaluation signals4748- All in-silico spectra with previously missing adducts now have [M+H]+ or [M-H]- assigned and persisted in the output file.49- No spectrum remains with an adduct-ionmode inconsistency (e.g., [M-H]- in positive ionmode or [M+H]+ in negative ionmode).50- Spectra failing the adduct-ionmode check are logged with detailed reasons in a DELETION_REASONS subfolder.51- Auto-assigned adducts match the ionmode polarity: positive ionmode → [M+H]+; negative ionmode → [M-H]-.52- Output spectra conform to ISO/IEC 20802-2:2016 .json format (or equivalent for other output formats) with populated adduct field.5354## Limitations5556- Requires ionmode metadata to be present and correctly labeled ('pos' or 'neg')—if ionmode is missing or malformed, adduct assignment cannot proceed.57- Assigns only [M+H]+ and [M-H]- adducts; does not handle other adduct types (e.g., [M+Na]+, [M+NH4]+) commonly seen in experimental spectra.58- Does not validate the chemical plausibility of the in-silico spectrum itself—only checks adduct-ionmode consistency. Spectra may still fail other validation filters (e.g., minimum peak count, entropy threshold, or missing SMILES/InChI).59- In-silico spectra lacking SMILES, InChI, AND InChIKey are removed during processing regardless of successful adduct assignment.6061## Evidence6263- [other] FragHub implements automatic addition of [M+H]+ or [M-H]- adducts to in-silico spectra when the adduct field is absent, with selection based on ionmode consistency.: "FragHub implements automatic addition of [M+H]+ or [M-H]- adducts to in-silico spectra when the adduct field is absent, with selection based on ionmode consistency."64- [other] Apply conditional logic: if ionmode is 'pos', assign [M+H]+ adduct; if ionmode is 'neg', assign [M-H]- adduct.: "if ionmode is 'pos', assign [M+H]+ adduct; if ionmode is 'neg', assign [M-H]- adduct"65- [other] Validate that the assigned adduct is consistent with the ionmode (no negative adducts in positive ionmode, no positive adducts in negative ionmode).: "Validate that the assigned adduct is consistent with the ionmode (no negative adducts in positive ionmode, no positive adducts in negative ionmode)."66- [discussion] auto add [M+H]+ or [M-H]- in In-Silico if adduct is missing.: "auto add [M+H]+ or [M-H]- in In-Silico if adduct is missing."67- [discussion] deleting spectrum if neg adduct in pos spectrum, or pos adduct in neg spectrum: "deleting spectrum if neg adduct in pos spectrum, or pos adduct in neg spectrum"68- [readme] All spectra deemed inconsistent, i.e., those lacking SMILES and InChI, precursor m/z, and adduct information, are removed during the processing by FragHub.: "All spectra deemed inconsistent, i.e., those lacking SMILES and InChI, precursor m/z, and adduct information, are removed during the processing"