QR code generation and embedding
Summary
Generate QR codes that encode Universal Spectrum Identifiers (USIs) pointing to metabolomics spectrum data, enabling third-party embedding of machine-readable references into publications and supplementary materials. This skill bridges static publication media with interactive spectrum visualization by encoding resolver URLs that dereference to specific spectra across metabolomics repositories.
When to use
Use this skill when you need to publish metabolomics spectra in static media (PDF, print, supplementary tables) and want readers or automated systems to access the corresponding interactive spectrum visualization without manual lookup. Specifically when you have resolved USI identifiers from supported sources (GNPS, MassBank, MetaboLights, Metabolomics Workbench, ProteoXchange, MS2LDA) and need to embed machine-readable spectrum references that link directly to the resolver endpoint.
When NOT to use
- Input USI is unresolved or malformed (does not conform to mzspec/mzdata syntax for a supported source)
- Target audience lacks QR code scanning capability or the publication medium cannot embed raster/vector images
- The spectrum data source is not supported by the resolver (outside GNPS, MassBank, MetaboLights, Metabolomics Workbench, ProteoXchange, MS2LDA)
Inputs
- Universal Spectrum Identifier (USI) string (fully qualified, e.g., mzspec:SOURCE:dataset:index:scan_number)
- Base resolver endpoint URL (e.g., https://metabolomics-usi.ucsd.edu/spectrum/)
- Target format preference (PNG or SVG)
Outputs
- QR code image file (PNG or SVG format)
- Embeddable QR code suitable for publication or supplementary material
- Encoded resolver URL within the QR code
How to apply
Accept a fully qualified USI string as input (e.g., 'mzspec:GNPS:GNPS-LIBRARY:accession:CCMSLIB00005436077' or 'mzspec:MASSBANK::accession:SM858102'). Construct the resolver URL by appending the USI to the base MetabolomicsSpectrumResolver endpoint (e.g., 'https://metabolomics-usi.ucsd.edu/spectrum/?usi=[USI]'). Pass this resolver URL to a QR code generation library (e.g., pyqrcode or qrcode Python packages) to encode the full URL as a 2D barcode. Generate the QR code output in a publication-compatible format (PNG or SVG). Embed the resulting QR code image as a figure, table cell, or supplementary element alongside the spectrum metadata or caption. Verify that scanning the QR code or copying the embedded resolver URL successfully redirects to the interactive spectrum viewer.
Related tools
- MetabolomicsSpectrumResolver (Resolves USI identifiers to spectrum data and provides the base resolver endpoint that QR codes encode) — https://github.com/mwang87/MetabolomicsSpectrumResolver
- QR Code Generation Library (Encodes the resolver URL as a 2D barcode in PNG or SVG format)
- GNPS Molecular Networking (Source repository for clustered spectra USI references)
- MassBank (Source repository for library spectra USI references)
- MetaboLights (Source repository for dataset spectra USI references)
- Metabolomics Workbench (Source repository for dataset spectra USI references)
Examples
https://metabolomics-usi.ucsd.edu/qrcode/?usi=mzspec:GNPS:GNPS-LIBRARY:accession:CCMSLIB00005436077
Evaluation signals
- QR code image is valid and scannable by standard QR readers
- Scanning the QR code or manually extracting and visiting the encoded URL successfully resolves to the MetabolomicsSpectrumResolver endpoint with the correct USI parameter
- The resolver endpoint returns a valid spectrum visualization or metadata for the encoded USI
- QR code output format matches the requested type (PNG or SVG) and is embeddable in the target publication/medium
- The encoded USI string is preserved exactly (no truncation, corruption, or character encoding errors) in the QR code URL
Limitations
- USI identifiers are based on draft USI and draft Metabolomics USI standards and are subject to change; currently designated as 'mzdraft' instead of 'mzspec' in some contexts
- QR code generation and embedding success depends on compatibility of the target publication format with image embedding (e.g., some legacy PDF or plain text formats may not support QR visualization)
- End-user access to the interactive spectrum visualization requires network connectivity and access to the MetabolomicsSpectrumResolver service; offline readers cannot follow the embedded link
Evidence
- [other] The tool achieves 3rd-party embedding of QR codes as one of its core objectives, allowing external systems to embed QR codes that reference USI identifiers from supported metabolomics data sources.: "The tool achieves 3rd-party embedding of QR codes as one of its core objectives, allowing external systems to embed QR codes that reference USI identifiers from supported metabolomics data sources."
- [other] Accept a USI string (dataset identifier, spectrum index, and optional library reference) as input. Construct the resolver URL by appending the USI to the base USI resolver endpoint. Generate a QR code image that encodes this resolver URL using a QR code library. Return the QR code as an embeddable image file (PNG or SVG format) suitable for third-party integration into publications.: "Accept a USI string (dataset identifier, spectrum index, and optional library reference) as input. Construct the resolver URL by appending the USI to the base USI resolver endpoint. Generate a QR"
- [intro] 3rd party embedding of QR code.: "3rd party embedding of QR code."
- [readme] These identifiers are based on draft USI and draft Metabolomics USI identifiers. Thus, they are subject to change, and so for the moment, they will be specified as
mzdraft instead of mzspec in the first block.: "These identifiers are based on draft USI and draft Metabolomics USI identifiers. Thus, they are subject to change, and so for the moment, they will be specified as mzdraft instead of mzspec in"
1---2name: qr-code-generation-and-embedding3description: Use when you need to publish metabolomics spectra in static media (PDF, print, supplementary tables) and want readers or automated systems to access the corresponding interactive spectrum visualization without manual lookup.4license: CC-BY-4.05---67# QR code generation and embedding89## Summary1011Generate QR codes that encode Universal Spectrum Identifiers (USIs) pointing to metabolomics spectrum data, enabling third-party embedding of machine-readable references into publications and supplementary materials. This skill bridges static publication media with interactive spectrum visualization by encoding resolver URLs that dereference to specific spectra across metabolomics repositories.1213## When to use1415Use this skill when you need to publish metabolomics spectra in static media (PDF, print, supplementary tables) and want readers or automated systems to access the corresponding interactive spectrum visualization without manual lookup. Specifically when you have resolved USI identifiers from supported sources (GNPS, MassBank, MetaboLights, Metabolomics Workbench, ProteoXchange, MS2LDA) and need to embed machine-readable spectrum references that link directly to the resolver endpoint.1617## When NOT to use1819- Input USI is unresolved or malformed (does not conform to mzspec/mzdata syntax for a supported source)20- Target audience lacks QR code scanning capability or the publication medium cannot embed raster/vector images21- The spectrum data source is not supported by the resolver (outside GNPS, MassBank, MetaboLights, Metabolomics Workbench, ProteoXchange, MS2LDA)2223## Inputs2425- Universal Spectrum Identifier (USI) string (fully qualified, e.g., mzspec:SOURCE:dataset:index:scan_number)26- Base resolver endpoint URL (e.g., https://metabolomics-usi.ucsd.edu/spectrum/)27- Target format preference (PNG or SVG)2829## Outputs3031- QR code image file (PNG or SVG format)32- Embeddable QR code suitable for publication or supplementary material33- Encoded resolver URL within the QR code3435## How to apply3637Accept a fully qualified USI string as input (e.g., 'mzspec:GNPS:GNPS-LIBRARY:accession:CCMSLIB00005436077' or 'mzspec:MASSBANK::accession:SM858102'). Construct the resolver URL by appending the USI to the base MetabolomicsSpectrumResolver endpoint (e.g., 'https://metabolomics-usi.ucsd.edu/spectrum/?usi=[USI]'). Pass this resolver URL to a QR code generation library (e.g., pyqrcode or qrcode Python packages) to encode the full URL as a 2D barcode. Generate the QR code output in a publication-compatible format (PNG or SVG). Embed the resulting QR code image as a figure, table cell, or supplementary element alongside the spectrum metadata or caption. Verify that scanning the QR code or copying the embedded resolver URL successfully redirects to the interactive spectrum viewer.3839## Related tools4041- **MetabolomicsSpectrumResolver** (Resolves USI identifiers to spectrum data and provides the base resolver endpoint that QR codes encode) — https://github.com/mwang87/MetabolomicsSpectrumResolver42- **QR Code Generation Library** (Encodes the resolver URL as a 2D barcode in PNG or SVG format)43- **GNPS Molecular Networking** (Source repository for clustered spectra USI references)44- **MassBank** (Source repository for library spectra USI references)45- **MetaboLights** (Source repository for dataset spectra USI references)46- **Metabolomics Workbench** (Source repository for dataset spectra USI references)4748## Examples4950```51https://metabolomics-usi.ucsd.edu/qrcode/?usi=mzspec:GNPS:GNPS-LIBRARY:accession:CCMSLIB0000543607752```5354## Evaluation signals5556- QR code image is valid and scannable by standard QR readers57- Scanning the QR code or manually extracting and visiting the encoded URL successfully resolves to the MetabolomicsSpectrumResolver endpoint with the correct USI parameter58- The resolver endpoint returns a valid spectrum visualization or metadata for the encoded USI59- QR code output format matches the requested type (PNG or SVG) and is embeddable in the target publication/medium60- The encoded USI string is preserved exactly (no truncation, corruption, or character encoding errors) in the QR code URL6162## Limitations6364- USI identifiers are based on draft USI and draft Metabolomics USI standards and are subject to change; currently designated as 'mzdraft' instead of 'mzspec' in some contexts65- QR code generation and embedding success depends on compatibility of the target publication format with image embedding (e.g., some legacy PDF or plain text formats may not support QR visualization)66- End-user access to the interactive spectrum visualization requires network connectivity and access to the MetabolomicsSpectrumResolver service; offline readers cannot follow the embedded link6768## Evidence6970- [other] The tool achieves 3rd-party embedding of QR codes as one of its core objectives, allowing external systems to embed QR codes that reference USI identifiers from supported metabolomics data sources.: "The tool achieves 3rd-party embedding of QR codes as one of its core objectives, allowing external systems to embed QR codes that reference USI identifiers from supported metabolomics data sources."71- [other] Accept a USI string (dataset identifier, spectrum index, and optional library reference) as input. Construct the resolver URL by appending the USI to the base USI resolver endpoint. Generate a QR code image that encodes this resolver URL using a QR code library. Return the QR code as an embeddable image file (PNG or SVG format) suitable for third-party integration into publications.: "Accept a USI string (dataset identifier, spectrum index, and optional library reference) as input. Construct the resolver URL by appending the USI to the base USI resolver endpoint. Generate a QR"72- [intro] 3rd party embedding of QR code.: "3rd party embedding of QR code."73- [readme] These identifiers are based on draft USI and draft Metabolomics USI identifiers. Thus, they are subject to change, and so for the moment, they will be specified as `mzdraft` instead of `mzspec` in the first block.: "These identifiers are based on draft USI and draft Metabolomics USI identifiers. Thus, they are subject to change, and so for the moment, they will be specified as `mzdraft` instead of `mzspec` in"