Usage
Usage¶
This library includes examples for generating single structures and running batch simulations. You can find them in the examples/ directory.
Generating Single Structures¶
To generate a single structure, you can run the corresponding script from the examples/ directory.
Microtubules¶
python examples/generate_microtubules.py
Mitochondria¶
python examples/generate_mitochondria.py
Nuclear Pore Complex (NPC)¶
# Generate a single NPC centered at the origin
python examples/generate_npc.py
# Generate multiple NPCs on a nuclear envelope
python examples/generate_npc_nucleus.py
The output, including the point cloud (CSV), rendered images (PNG/TIFF), and masks, will be saved in the outputs/ directory.
Batch Generation¶
For generating a large dataset, the batch_generate.py script allows running multiple simulations in parallel.
# Run 4 parallel simulations for microtubules
python examples/batch_generate.py microtubule -n 4 -w 4
# Run 8 parallel simulations for mitochondria
python examples/batch_generate.py mitochondria -n 8 -w 4
# Run 10 single NPC simulations with 4 workers
python examples/batch_generate.py npc -n 10 -w 4
# Run 5 nucleus (multiple NPCs) simulations with 4 workers
python examples/batch_generate.py nucleus -n 5 -w 4
You can specify the structure type (microtubule, mitochondria, npc, or nucleus), the total number of simulations (-n), and the number of parallel workers (-w). The results will be saved in subdirectories within outputs/batch_simulation/.
Structure Types¶
| Type | Description | Example Script |
|---|---|---|
microtubule |
Cylindrical filaments using B-splines | generate_microtubules.py |
mitochondria |
Tubular organelles using random walk | generate_mitochondria.py |
npc |
Single Nuclear Pore Complex | generate_npc.py |
nucleus |
Multiple NPCs on nuclear envelope | generate_npc_nucleus.py |