Skip to content

Examples

Ready-to-run example scripts demonstrating common VLab4Mic workflows. Before running, make sure you have installed VLab4Mic.

Run any script with:

python path/to/script.py

Available Scripts

Category Description Script
Image virtual sample Create a virtual sample and simulate its imaging acquisition script
Parameter sweep Set up and run a parameter sweep analysis script
Real vs Simulation Create a simulated image based on a real experimental image script
Custom structure Image a virtual sample using a custom local PDB/CIF file script

Article Figure Scripts

Scripts used to generate the figures in the VLab4Mic publication. Each script is self-contained and demonstrates a specific feature or validation scenario.

Figure Description Script
Fig. 1 HIV capsid (3J3Y) imaged across all modalities script
Fig. 2 NPC (7R5K) panel with SMLM and quantification script
Fig. 3 (A–C) Parameter sweep panels for structural comparison script
Fig. 3 (D–E) Parameter sweep with labelling efficiency script
Fig. 4 Clathrin-coated structure (CCS) imaging script
Fig. S — AlphaFold Using a locally downloaded AlphaFold model as input structure script
Fig. S — Depth of field Effect of depth-of-field parameter on simulated images script
Fig. S — Image positioning Using a reference image to position epitopes in the virtual sample script
Fig. S — Labelling efficiency & hindrance Labelling efficiency and steric hindrance effects script
Fig. S — SMLM localisation (CCS) Localisation table simulation for clathrin-coated structures script
Fig. S — Multicolour Two-colour imaging of the same structure with different probes script
Fig. S — Multiple structures Imaging multiple different structures in the same field of view script
Fig. S — NPC quantification NPC ring quantification simulation script
Fig. S — Primary & secondary Indirect labelling with primary and secondary antibody models script
Fig. S — Probe examples Gallery of all probe templates across different structures script
Fig. S — Site-specific labelling Site-specific probe conjugation on a defined residue script
Fig. S — Structural integrity Structural integrity parameter effects on NPC and capsid script
Fig. S — Structure normals Structure normal directions and probe positioning script
Fig. S — Structure parsing Structure parsing, asymmetric units, and multiple targets script

Image Virtual Sample

Demonstrates the core image_vsample function. In this example, 10 Nuclear Pore Complexes (NPC, model 7R5K) are labelled at the C-terminal of Nup96 and imaged across multiple modalities.

Key things shown: - Selecting a structural model from PDB - Using a pre-configured probe template - Simulating acquisition across Widefield, Confocal, STED, and SMLM

View script on GitHub →


Parameter Sweep

Demonstrates run_parameter_sweep. In this example, labelling efficiency and structural integrity are swept across 3 values each (9 combinations total), and each output is compared against a reference image via Pearson correlation.

Key things shown: - Configuring sweep parameters as lists or ranges - Running repeated simulations - Generating heatmap analysis outputs

View script on GitHub →


Real vs Simulation

Shows how to base a simulated image on the parameters estimated from a real experimental acquisition — useful for validation and benchmarking.

View script on GitHub →


Custom Structure

Shows how to load and use a local PDB or CIF file as the structural model, instead of downloading from the PDB database.

View script on GitHub →