Library Upload imports local spectral library files into the platform database. The process has two steps: first, verify the file structure and whether the file has already been uploaded; second, check the spectral fields and their mapping to database fields. The Load to DB button only becomes available when both steps pass; if either condition is not met, the file cannot be uploaded or loaded.

1. Step 1: selecting a file and verifying its structure

Click Select Files to choose a local file. The page supports db, mzXML, mzML, and msp files (the backend also accepts cdf). A single file may be up to 500 MB, and up to 10 files can be selected at once. Files are uploaded in 5 MB chunks, and the MD5 is calculated and checked with the server before transfer to determine whether the file has already been uploaded.

Library Upload page: selecting a local spectral library file
Figure 1 · Selecting a file: Select Files opens the local file dialog, where RECETOX_Exposome_GC-EI-MS_v2.msp is chosen. Once queued, the table shows the row number, file name, file size, Upload Status, Match Keys, Load Status, and action buttons.

After a file is queued, the server parses its structure:

FormatStructure verification
dbAll tables in the database are read. Both SpectrumTable and CompoundTable must exist and contain more than 0 records; otherwise the file cannot be loaded.
mspThe header lines in "field: value" form and the peak lists are parsed, the Item Count (number of compounds and spectra in the file) is calculated, and a mappable field list is generated.
mzXML / mzMLThe mass spec run information is parsed to read the polarity and adduct, which are used to normalise the ion mode.

2. Duplicate check: File Exists blocks the upload

Before Upload starts, the system queries the user's upload records by file MD5. If the same file has already been uploaded and the file size on disk matches, it is treated as a duplicate:

Upload Status shows File Exists and the upload button is disabled
Figure 2 · Duplicate file blocked: RECETOX_Exposome_GC-EI-MS_v2.msp (1.19M) shows a red File Exists in Upload Status, meaning the file is already present and will not be transferred again. The Upload button is removed, and Check Keys and Load to DB are both unavailable.
Cases where upload is not allowed: ① the same MD5 already exists and the file on disk is intact; ② the file format is not supported; ③ a single file exceeds 500 MB or more than 10 files are selected; ④ the file structure does not meet the requirements above (for example, a db file without SpectrumTable or CompoundTable). In these cases, delete the row and select the correct file again, or use the already uploaded file directly in Library Manage.

3. Step 2: checking spectral fields (Check Keys)

Once the file has been uploaded, click Check Keys to open the field-checking dialog. The top of the dialog shows the result (pass / no pass), the file name, and the Item Count; the table lists each file field, its value type, an example value, and the corresponding database field.

File Keys Checking dialog
Figure 3 · Field checking: File Keys Checking reports pass. For RECETOX_Exposome_GC-EI-MS_v2.msp the Item Count is Compound 410 and Spectrum 434, and fields such as Name, Scannumber, Retentiontime, Precursormz, Ionmode, Formula, and Inchikey are mapped to database fields of the same name. Match Keys shows File Keys Loaded.
ColumnDescription
FilesThe original field name detected in the file.
Value TypeString, Integer, or Float. A change is saved to the file's field configuration immediately.
Value ExampleAn example value from the file, used to confirm that the field contains the expected data.
Database KeysThe database field to map to. A change is written back to the server immediately and persists after a page refresh.

Requirements differ by format. If a required field is missing, the dialog shows no pass and Load to DB stays disabled:

FormatRequired fieldsResult
mspName, Precursormz, and Formula must all be present, plus at least one of Inchikey, Smiles, Collisionenergy, or Ionmode (four fields in total).Fewer than 4 fields: no pass.
db (SpectrumTable)SpectrumId, CompoundId, PrecursorMass, blobMass, and blobIntensity must all be present.Fewer than 5 fields: no pass.
db (CompoundTable)CASId, PubChemId, Formula, Name, and CompoundId must all be present.Fewer than 5 fields: no pass.
mzXML / mzMLNo field-count threshold, but the polarity and adduct must be confirmed; the adduct can be checked or edited in the dialog.Proceed once the structure parses successfully.
Note: A db file requires both SpectrumTable and CompoundTable to pass; if only one of them passes, the dialog still reports no pass. If a field is missing, add it to the source file, or manually map an existing field to the correct Database Key in the dialog and continue only after the check passes.

4. Loading into the database

Once the check passes, Load to DB becomes available. Clicking it starts a background import thread, and the page polls the progress every 2 seconds and shows a percentage. On completion it reports Load finished! Imported: N; duplicates skipped: M. The imported spectra can then be reviewed in Library Manage.

Status columnTypical values and meaning
Upload Statuschecking…, calculate md5, uploading N%, File Exists (duplicate file; upload not allowed).
Match Keyswaiting.., File Keys Loaded (field list read; ready for checking).
Load Statuswaiting., loading N%, Load finished! Imported: N; duplicates skipped: M.
During loading: clicking Load to DB without checking fields returns "Please check file keys (field mapping) before loading to DB"; clicking again while the same file is loading returns "This file is already being loaded."; a completed file returns have finished; and if polling exceeds 10 minutes the page reports a timeout, in which case check the result in Library Manage.

Related pages: Library Manage (review and edit imported spectra) · Points & Registration Rules (registration rewards and unlock rules) · Group Manage (sharing and permissions)