Database Management¶
Overview¶
The Database Management tab builds custom NPZ libraries from a CSV of SMILES strings for use in Molecular Analysis → Load Other Database. Main capabilities:
- Display built-in database sizes (Plant, Human, Microbial, All, etc.).
- Background database generation via
VirDBGenerator(NMR shift prediction and packaging). - Model file check for
nmr_model.ptbefore allowing creation. - Progress bar and status log during long runs.
Built-in libraries (Database/*.npz) are shipped with the application and are not recreated on this tab.
Interface Layout¶
Single-column layout (no right results split):
| Section | Content |
|---|---|
| Database Statistics | Bullet list of NP counts per built-in library |
| Create New Database | SMILES CSV path, output .npz path, Create Database button |
| Progress & Status | Model status label, progress bar, read-only log (QTextEdit) |
Workflow¶
① Verify model status¶
- On tab open, Model Status shows:
- ✓ Available —
VirMolAnalyte/VirDBcreator/NMRprediction/model/nmr_model.ptfound - ✗ Missing — Create Database disabled
Packaged installs must include this file under the same relative path.
② Prepare input CSV¶
- CSV with at least one column of SMILES strings (one compound per row).
- Invalid SMILES are skipped by the generator (see log).
③ Set input and output paths¶
| Field | Description |
|---|---|
| SMILES File | Browse to input .csv |
| Output Path | Target .npz; if empty, default is GUI_result_files/generated_virDB.npz |
Use the browse icons to select paths.
④ Generate database¶
- Click Create Database.
DatabaseCreationThreadrunsVirDBGeneratorfrom the project root working directory.- Watch Progress and Status Log (may take a long time for large CSVs).
- On success, log shows absolute output path and notes the file can be loaded for identification.
⑤ Use the new library¶
- Open Molecular Analysis.
- Browse Other Database → select your
.npz. - Load Other Database → Start Analysis.
⑥ Output file structure¶
GUI_result_files/
generated_virDB.npz # Default output if path not specified
# Or user-selected path, e.g.
Database/my_lab.npz
Internal NPZ structure follows VirDBGenerator / DataPrepare conventions (same family as built-in Plant.npz).
FAQ¶
- Create Database disabled
Install or restore nmr_model.pt under VirMolAnalyte/VirDBcreator/NMRprediction/model/.
- Generation failed in log
Check SMILES validity, disk space, and write permissions on the output folder.
- Load Other Database fails on Molecular Analysis
NPZ must be produced by this tool (or compatible VirDBGenerator output), not an arbitrary archive.
- Built-in vs custom library
Built-in files live in Database/; custom files can live anywhere if you browse to them.
- Working directory messages in log
The thread temporarily chdirs to the app root; this is normal and restored after the job.
Relation to Other Modules¶
- Molecular Analysis: Load Other Database consumes NPZ files created here.
- Fragment Analysis: Uses screening hits from any loaded library; no direct tab link.
- AI Assistant: Indirect — better hits improve LLM context.
- Other Tool: Independent.