|
1 | | -# PartiNet |
2 | | -PartiNet is a particle-picking pipeline for cryo-EM micrographs. It provides denoising, adaptive detection, and STAR file generation for downstream processing. |
| 1 | +# PartiNet 🔬 |
3 | 2 |
|
4 | | -# Links |
5 | | -- Documentation: https://mihinp.github.io/partinet_documentation/ |
6 | | -- Model weights (Hugging Face): https://huggingface.co/MihinP/PartiNet |
| 3 | +PartiNet is a three-stage pipeline for automated particle picking in cryo-EM micrographs, combining advanced denoising with state-of-the-art deep learning detection. |
7 | 4 |
|
8 | | -# Getting started (quick) |
9 | | -1. Clone the repository |
10 | 5 |
|
11 | | -```powershell |
| 6 | +## Features |
| 7 | + |
| 8 | +- 🧹 Advanced denoising for improved signal-to-noise ratio |
| 9 | +- 🎯 Deep learning-based particle detection |
| 10 | +- ⚡ Multi-GPU support for faster processing |
| 11 | +- 🔄 Seamless integration with RELION workflows |
| 12 | +- 📊 Confidence-based particle filtering |
| 13 | +- 🖼️ Visual detection validation |
| 14 | + |
| 15 | +## Prerequisites |
| 16 | + |
| 17 | +Before starting, ensure you have: |
| 18 | +- Motion-corrected micrographs |
| 19 | +- GPU access (recommended) |
| 20 | +- PartiNet installation (see Installation section) |
| 21 | + |
| 22 | +## Installation |
| 23 | + |
| 24 | +```bash |
12 | 25 | git clone git@github.com:WEHI-ResearchComputing/PartiNet.git |
13 | 26 | cd PartiNet |
14 | 27 | ``` |
15 | 28 |
|
16 | | -2. Create a Python virtual environment (recommended) |
| 29 | +Alternatively, use our containers: |
| 30 | + |
| 31 | +```bash |
| 32 | +# Docker |
| 33 | +docker run ghcr.io/wehi-researchcomputing/partinet:latest |
17 | 34 |
|
18 | | -```powershell |
19 | | -python -m venv .venv |
20 | | -.\.venv\Scripts\Activate.ps1 |
21 | | -pip install -U pip |
| 35 | +# Singularity/Apptainer |
| 36 | +singularity run oras://ghcr.io/wehi-researchcomputing/partinet:latest |
22 | 37 | ``` |
23 | 38 |
|
24 | | -3. Install requirements |
| 39 | +## Directory Structure |
25 | 40 |
|
26 | | -```powershell |
27 | | -pip install -r requirements.txt |
28 | | -# or editable install for development |
29 | | -pip install -e . |
30 | 41 | ``` |
31 | | - |
32 | | -4. Download model weights (see Hugging Face README) |
33 | | - |
34 | | -```powershell |
35 | | -# If you have git-lfs and access via HTTPS/SSH |
36 | | -git lfs install |
37 | | -git clone https://huggingface.co/MihinP/PartiNet |
38 | | -# or use the huggingface_hub python client |
39 | | -python -m pip install huggingface_hub |
40 | | -python - <<'PY' |
41 | | -from huggingface_hub import hf_hub_download |
42 | | -hf_hub_download(repo_id="MihinP/PartiNet", filename="best.pt", repo_type="model") |
43 | | -PY |
| 42 | +project_directory/ |
| 43 | +├── motion_corrected/ # 📁 Input micrographs |
| 44 | +├── denoised/ # 🧹 Denoised outputs |
| 45 | +├── exp/ # 🎯 Detection results |
| 46 | +│ ├── labels/ # 📋 Coordinates |
| 47 | +│ └── ... # 🖼️ Visualizations |
| 48 | +└── partinet_particles.star # ⭐ Final output |
44 | 49 | ``` |
45 | 50 |
|
46 | | -# Quick usage examples |
| 51 | +## Pipeline Stages |
47 | 52 |
|
48 | | -- Denoise images |
49 | | - |
50 | | -```powershell |
51 | | -partinet denoise --source /data/raw_micrographs --project /data/partinet_project |
| 53 | +### 1. Denoise |
| 54 | +```bash |
| 55 | +partinet denoise \ |
| 56 | + --source /data/my_project/motion_corrected \ |
| 57 | + --project /data/my_project |
52 | 58 | ``` |
53 | 59 |
|
54 | | -- Detect particles |
| 60 | +### 2. Detect |
| 61 | +```bash |
| 62 | +partinet detect \ |
| 63 | + --weight /path/to/model_weights.pt \ |
| 64 | + --source /data/partinet_picking/denoised \ |
| 65 | + --device 0,1,2,3 \ |
| 66 | + --project /data/partinet_picking |
| 67 | +``` |
55 | 68 |
|
56 | | -```powershell |
57 | | -partinet detect --weight /path/to/best.pt --source /data/partinet_project/denoised --project /data/partinet_project |
| 69 | +### 3. Generate STAR File |
| 70 | +```bash |
| 71 | +partinet star \ |
| 72 | + --labels /data/my_project/exp/labels \ |
| 73 | + --images /data/my_project/denoised \ |
| 74 | + --output /data/my_project/partinet_particles.star \ |
| 75 | + --conf 0.1 |
58 | 76 | ``` |
59 | 77 |
|
60 | | -- Generate STAR files |
| 78 | +## Key Parameters |
61 | 79 |
|
62 | | -```powershell |
63 | | -partinet star --project /data/partinet_project --output /data/partinet_project/exp/particles.star |
64 | | -``` |
| 80 | +### Detection |
| 81 | +- `--backbone-detector`: Choice of neural network architecture |
| 82 | +- `--weight`: Path to model weights |
| 83 | +- `--conf-thres`: Detection confidence threshold |
| 84 | +- `--iou-thres`: Overlap filtering threshold |
| 85 | +- `--device`: GPU device selection |
65 | 86 |
|
66 | | -# Containerized usage |
| 87 | +### STAR Generation |
| 88 | +- `--conf`: Confidence threshold for particle filtering |
| 89 | +- `--output`: Path for final STAR file |
67 | 90 |
|
68 | | -- Docker |
| 91 | +## Output Files |
69 | 92 |
|
70 | | -```powershell |
71 | | -docker run --gpus all -v /data:/data ghcr.io/wehi-researchcomputing/partinet:main partinet detect --weight /path/to/best.pt --source /data/denoised --project /data/partinet_project |
72 | | -``` |
| 93 | +1. **Denoised Micrographs** (`denoised/*.mrc`) |
| 94 | + - Cleaned micrographs with improved SNR |
| 95 | + |
| 96 | +2. **Detection Results** (`exp/`) |
| 97 | + - `labels/*.txt`: Particle coordinates |
| 98 | + - `*.png`: Visualization overlays |
| 99 | + |
| 100 | +3. **STAR File** (`partinet_particles.star`) |
| 101 | + - Ready for RELION processing |
73 | 102 |
|
74 | | -- Apptainer / Singularity |
| 103 | +## Advanced Usage |
75 | 104 |
|
76 | | -```powershell |
77 | | -apptainer exec --nv --no-home -B /data oras://ghcr.io/wehi-researchcomputing/partinet:main-singularity partinet detect --weight /path/to/best.pt --source /data/denoised --project /data/partinet_project |
| 105 | +For detailed information about specific commands: |
| 106 | + |
| 107 | +```bash |
| 108 | +partinet --help |
| 109 | +partinet <command> --help |
78 | 110 | ``` |
79 | 111 |
|
80 | | -# Development notes |
81 | | -- Tests and CI: see `.github/workflows/` for CI pipelines. |
82 | | -- Contributing: open issues and PRs on the main repo. Use the documentation site for user-facing docs and developer notes. |
| 112 | +Available commands: |
| 113 | +- `denoise`: Clean input micrographs |
| 114 | +- `detect`: Identify particles |
| 115 | +- `star`: Generate STAR files |
| 116 | +- `train`: Train custom models (step1/step2) |
| 117 | +- `test`: Evaluate model performance |
| 118 | + |
| 119 | +## Troubleshooting |
| 120 | + |
| 121 | +- **GPU Issues** |
| 122 | + - Verify GPU availability: `nvidia-smi` |
| 123 | + - Check CUDA installation |
| 124 | + - Ensure proper device selection |
| 125 | + |
| 126 | +- **Path Issues** |
| 127 | + - Verify directory permissions |
| 128 | + - Check mount points in container setups |
| 129 | + - Ensure absolute paths are used |
| 130 | + |
| 131 | +## Contributing |
| 132 | + |
| 133 | +We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details. |
| 134 | + |
| 135 | +## License |
| 136 | + |
| 137 | +This project is licensed under the terms of the LICENSE file included in the repository. |
| 138 | + |
| 139 | +## Citation |
| 140 | + |
| 141 | +If you use PartiNet in your research, please cite: |
| 142 | +``` |
| 143 | +Citation information will be added upon publication |
| 144 | +``` |
83 | 145 |
|
| 146 | +## Support |
84 | 147 |
|
85 | | -# Support |
86 | | -- For questions or issues, open an issue in the main repo: https://github.com/WEHI-ResearchComputing/PartiNet/issues |
| 148 | +For issues and questions: |
| 149 | +- Open an [Issue](https://github.com/WEHI-ResearchComputing/PartiNet/issues) |
| 150 | +- Check existing [Discussions](https://github.com/WEHI-ResearchComputing/PartiNet/discussions) |
0 commit comments