Skip to content

Commit f072723

Browse files
committed
Clarify path conventions and skip-denoise workflow in stage docs
1 parent 8f904c5 commit f072723

4 files changed

Lines changed: 52 additions & 24 deletions

File tree

docs/docs/getting-started.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,29 @@ project_directory/
3232
│ ├── micrograph1.mrc
3333
│ ├── micrograph2.mrc
3434
│ └── ...
35-
├── denoised/ # Created by denoise stage
36-
│ ├── micrograph1.mrc
37-
│ ├── micrograph2.mrc
35+
├── denoised/ # Created by denoise stage (default: .png)
36+
│ ├── micrograph1.png
37+
│ ├── micrograph2.png
3838
│ └── ...
3939
├── exp/ # Created by detect stage
4040
│ ├── labels/ # Detection coordinates (YOLO format)
4141
│ │ ├── micrograph1.txt
4242
│ │ ├── micrograph2.txt
4343
│ │ └── ...
44-
│ ├── micrograph1.png # Micrographs with detections drawn
45-
│ ├── micrograph2.
44+
│ ├── micrograph1.png # Micrographs with detections drawn
45+
│ ├── micrograph2.png
4646
│ └── ...
4747
└── partinet_particles.star # CryoSPARC-style STAR file (created by star stage)
4848
```
4949

5050
**Pipeline Flow:**
5151
1. **Input**`motion_corrected/` (your micrographs)
52-
2. **Stage 1**`denoised/` (cleaned micrographs)
52+
2. **Stage 1**`denoised/` (cleaned micrographs, PNG by default)
5353
3. **Stage 2**`exp*/` (detections + visualizations)
5454
4. **Stage 3**`*.star` (final particle coordinates)
5555

56+
See [Detect — skip denoise](stages/detect.md#skip-denoise-raw-mrc) if picking directly on raw MRC without denoising.
57+
5658
## Stage 1: Denoise
5759

5860
The first stage removes noise from your micrographs and improves signal-to-noise ratios:
@@ -61,8 +63,8 @@ The first stage removes noise from your micrographs and improves signal-to-noise
6163

6264
```shell title="Local Installation"
6365
partinet denoise \
64-
--source /data/my_project/motion_corrected \
65-
--project /data/my_project
66+
--source /data/partinet_picking/motion_corrected \
67+
--project /data/partinet_picking
6668
```
6769

6870
</div>
@@ -108,9 +110,9 @@ The final stage converts detections to STAR format and applies confidence filter
108110

109111
```shell title="Local Installation"
110112
partinet star \
111-
--labels /data/my_project/exp/labels \
112-
--images /data/my_project/denoised \
113-
--output /data/my_project/partinet_particles.star \
113+
--labels /data/partinet_picking/exp/labels \
114+
--images /data/partinet_picking/denoised \
115+
--output /data/partinet_picking/partinet_particles.star \
114116
--conf 0.1
115117
```
116118

@@ -126,7 +128,7 @@ partinet star \
126128
After running all three stages, you'll have:
127129

128130
1. **Denoised micrographs** (`denoised/`) - Cleaned input for particle detection
129-
2. **Detection visualizations** (`exp/*.mrc`) - Micrographs with particle boxes drawn
131+
2. **Detection visualizations** (`exp/*.png`) - Micrographs with particle boxes drawn
130132
3. **Detection coordinates** (`exp/labels/*.txt`) - Raw detection data
131133
4. **STAR file** (`*.star`) - Final particle coordinates ready for downstream processing
132134

docs/docs/stages/denoise.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ Denoising can vastly improve particle picking by helping to increase signal to n
1212

1313
### Required Parameters
1414

15-
| Parameter | Description | Example |
16-
|-----------|-------------|---------|
17-
| `--source` | Directory containing motion-corrected micrographs in MRC format | `/data/partinet_picking/motion_corrected` |
18-
| `--project` | Parent project directory where all outputs will be saved | `/data/partinet_picking` |
15+
| Parameter | Role | Example |
16+
|-----------|------|---------|
17+
| `--source` | Input folder for this stage (motion-corrected `.mrc` files) | `/data/partinet_picking/motion_corrected` |
18+
| `--project` | Dataset root where outputs and logs are written | `/data/partinet_picking` |
19+
20+
Denoised micrographs are always written to `<project>/denoised/`. The `--source` directory is never modified.
1921

2022
### Optional Parameters
2123

@@ -166,7 +168,7 @@ partinet denoise \
166168

167169

168170
### Different Output Formats
169-
By default PartiNet outputs denoised images in `png` format. This is necessary for compatibility with the detection architecture. `png` is a lossless compression, however micrographs are normalised from 32 bit depth `mrc` files to 8 bit `png`. `jpg` is also available (as a legacy format) but is not recommended for use due to lossy compression.
171+
By default PartiNet outputs denoised images in `png` format. This is the recommended format for the Detect stage. `png` is lossless; micrographs are normalised from 32-bit MRC to 8-bit PNG. `jpg` is available but not recommended due to lossy compression.
170172

171173
```shell
172174
# JPEG format (smaller file size, lossy compression)

docs/docs/stages/detect.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,30 @@ partinet detect \
105105

106106
### Supported Formats
107107

108-
- **PNG files** (`.png`)
109-
- **JPEG files** (`.jpg`, `.jpeg`)
108+
**Standard workflow (recommended):**
109+
110+
- **PNG files** (`.png`) from the Denoise stage — use with `denoised_micrographs.pt`
111+
112+
**Skip-denoise workflow:**
113+
114+
- **MRC files** (`.mrc`) motion-corrected micrographs — use with `raw_micrographs.pt`
115+
- Raw MRC inputs are per-micrograph min–max normalised to 8-bit before inference (not the same as EMAN2 or CryoSegNet display)
116+
117+
### Skip denoise (raw MRC)
118+
119+
If you want to pick directly on motion-corrected micrographs without denoising:
120+
121+
```shell
122+
partinet detect \
123+
--weight /path/to/raw_micrographs.pt \
124+
--source /data/partinet_picking/motion_corrected \
125+
--project /data/partinet_picking \
126+
--device 0
127+
```
128+
129+
Use `raw_micrographs.pt` only with raw MRC inputs. For denoised PNG, use `denoised_micrographs.pt`.
130+
131+
When generating a STAR file after skip-denoise, set `--images` to the **same folder** used as detect `--source` (e.g. `motion_corrected/`, not `denoised/`).
110132

111133
### Directory Structure
112134

@@ -133,16 +155,16 @@ partinet_picking/
133155
│ ├── micrograph2.mrc
134156
│ └── ...
135157
├── denoised/ # 🧹 Created by denoise stage
136-
│ ├── micrograph1.mrc
137-
│ ├── micrograph2.mrc
158+
│ ├── micrograph1.png
159+
│ ├── micrograph2.png
138160
│ └── ...
139161
├── exp/ # 🎯 Created by detect stage
140162
│ ├── labels/ # 📋 Detection coordinates
141163
│ │ ├── micrograph1.txt
142164
│ │ ├── micrograph2.txt
143165
│ │ └── ...
144-
│ ├── micrograph1.mrc # 🖼️ Micrographs with detections drawn
145-
│ ├── micrograph2.mrc
166+
│ ├── micrograph1.png # 🖼️ Micrographs with detections drawn
167+
│ ├── micrograph2.png
146168
│ └── ...
147169
└── partinet_detect.log
148170
```

docs/docs/stages/star.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@ docker run --gpus all -v /data:/data \
4040
| Parameter | Type | Required | Description |
4141
|-----------|------|----------|-------------|
4242
| `--labels` | Path | Yes | Directory containing the particle coordinate files (`.txt` format) from the detection stage |
43-
| `--images` | Path | Yes | Directory containing the denoised micrographs corresponding to the labels |
43+
| `--images` | Path | Yes | Directory containing micrographs used during Detect — usually `<project>/denoised/`; if you skipped denoise, use the same folder as detect `--source` |
4444
| `--output` | Path | Yes | Output path for the generated STAR file |
4545
| `--conf` | Float | Yes | Confidence threshold for filtering particle coordinates (0.0-1.0) |
4646

4747
## Input Requirements
4848

49+
**Important:** `--images` must match the folder passed to `partinet detect --source`. After the standard pipeline that is `<project>/denoised/`; after skip-denoise on raw MRC it is `<project>/motion_corrected/` (or wherever your `.mrc` files live).
50+
4951
At this stage of the pipeline, your directory structure should look like:
5052
```
5153
partinet_picking/

0 commit comments

Comments
 (0)