Skip to content

Commit 8c0a805

Browse files
docs: document squiggy-session.json across all docs
Add documentation for the generate_squiggy_session rule and script to CLAUDE.md, outputs guide, scripts reference, and rules reference. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 95ddb3f commit 8c0a805

File tree

4 files changed

+120
-1
lines changed

4 files changed

+120
-1
lines changed

CLAUDE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ workflow/
8080
│ ├── aatrnaseq-modifications.smk # Modification calling: coverage, modkit outputs (4 rules)
8181
│ └── warpdemux.smk # WarpDemuX demultiplexing (conditionally loaded)
8282
├── scripts/ # Python scripts called by rules
83+
│ └── generate_squiggy_session.py # Generate Squiggy/Positron session JSON
8384
└── envs/
8485
└── aatrnaseqpipe-env.yml # Conda environment (legacy)
8586
```
@@ -125,6 +126,9 @@ After classification, generates (split across three rule files):
125126
- Modkit modification pileups
126127
- Modkit per-read modification calls
127128

129+
**common.smk:**
130+
- Squiggy session JSON (`squiggy-session.json`) for loading outputs in Positron IDE
131+
128132
## Configuration
129133

130134
### Main Config Files
@@ -265,3 +269,6 @@ Key outputs per sample:
265269
- `summary/tables/{sample}/{sample}.charging.cpm.tsv.gz` - CPM-normalized charging counts
266270
- `summary/tables/{sample}/{sample}.charging_prob.tsv.gz` - Per-read charging probabilities
267271
- `bam/final/{sample}/{sample}.bam` - Final BAM with CL/CM (charging) and PT (adapter positions) tags
272+
273+
Pipeline-level outputs:
274+
- `squiggy-session.json` - Squiggy session file for loading samples in Positron

docs/user-guide/outputs.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ This guide documents all output files produced by the pipeline.
1313
│ ├── tables/ # Tabular summaries
1414
│ └── modkit/ # Modification calling
1515
├── demux/ # Demultiplexing outputs (if enabled)
16-
└── logs/ # Rule execution logs
16+
├── logs/ # Rule execution logs
17+
└── squiggy-session.json # Squiggy session file for Positron
1718
```
1819

1920
## Data Flow and Outputs
@@ -208,6 +209,41 @@ Individual modification calls per read.
208209

209210
Comprehensive modification information including all modkit fields.
210211

212+
## Squiggy Session File
213+
214+
`squiggy-session.json`
215+
216+
A JSON session file generated at the root of the output directory for loading pipeline outputs in the [Squiggy](https://github.com/rnabioco/squiggy) extension for Positron IDE.
217+
218+
**Contents:**
219+
220+
- Relative paths to POD5, BAM, and reference FASTA files for each sample
221+
- MD5 checksums and file metadata for integrity verification
222+
- Default plot options (eventalign mode, z-normalization)
223+
224+
**JSON structure:**
225+
226+
```json
227+
{
228+
"version": "1.0.0",
229+
"timestamp": "...",
230+
"sessionName": "aa-tRNA-seq: ...",
231+
"samples": {
232+
"sample1": {
233+
"pod5Paths": ["pod5/sample1/sample1.pod5"],
234+
"bamPath": "bam/final/sample1/sample1.bam",
235+
"fastaPath": "../path/to/reference.fa"
236+
}
237+
},
238+
"plotOptions": { ... },
239+
"fileChecksums": { ... }
240+
}
241+
```
242+
243+
**Usage:**
244+
245+
Open the `squiggy-session.json` file in Positron to load all samples with their associated POD5, BAM, and reference files.
246+
211247
## Intermediate Files
212248

213249
These files are produced but typically not used directly:

docs/workflow/rules-reference.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,37 @@ modkit extract full \
485485

486486
---
487487

488+
## Utility Rules
489+
490+
### generate_squiggy_session
491+
492+
Generate a Squiggy session JSON file for loading pipeline outputs in Positron IDE.
493+
494+
**File:** `workflow/rules/common.smk`
495+
496+
| Property | Value |
497+
|----------|-------|
498+
| Input | All final BAMs, all merged POD5s, reference FASTA |
499+
| Output | `squiggy-session.json` (at output root) |
500+
| GPU | No |
501+
502+
**Command:**
503+
```bash
504+
python generate_squiggy_session.py \
505+
--samples {sample_names} \
506+
--output-dir {output_dir} \
507+
--fasta {fasta} \
508+
--output {output.session}
509+
```
510+
511+
**Notes:**
512+
513+
- Generates relative paths to POD5, BAM, and FASTA files for each sample
514+
- Computes MD5 checksums for file integrity verification
515+
- Includes default plot options for the Squiggy viewer (eventalign mode, z-normalization)
516+
517+
---
518+
488519
## Demultiplexing Rules
489520

490521
See [Demultiplexing](demultiplexing.md) for detailed documentation.
@@ -531,4 +562,6 @@ flowchart LR
531562
add_adapter_tags --> bam_to_coverage
532563
add_adapter_tags --> modkit_pileup
533564
get_cca_trna --> get_cca_trna_cpm
565+
add_adapter_tags --> generate_squiggy_session
566+
merge_pods --> generate_squiggy_session
534567
```

docs/workflow/scripts-reference.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Documentation for Python scripts in `workflow/scripts/`.
1414
| `get_align_stats.py` | Summarize alignment statistics |
1515
| `extract_signal_metrics.py` | Extract Remora signal metrics |
1616
| `filter_reads.py` | Filter BAM by quality criteria |
17+
| `generate_squiggy_session.py` | Generate Squiggy session JSON for Positron |
1718

1819
---
1920

@@ -382,6 +383,48 @@ Tracks filtering reasons with methods:
382383

383384
---
384385

386+
## generate_squiggy_session.py
387+
388+
Generate a Squiggy session JSON file for loading pipeline outputs in Positron IDE.
389+
390+
### Usage
391+
392+
```bash
393+
python generate_squiggy_session.py \
394+
--samples sample1 sample2 \
395+
--output-dir /path/to/output \
396+
--fasta /path/to/reference.fa \
397+
--output squiggy-session.json \
398+
[--session-name "My session"] \
399+
[--no-checksums]
400+
```
401+
402+
### Arguments
403+
404+
| Argument | Description |
405+
|----------|-------------|
406+
| `--samples` | Sample names to include (space-separated) |
407+
| `--output-dir` | Pipeline output directory (paths are relative to this) |
408+
| `--fasta` | Path to reference FASTA file |
409+
| `--output` | Output JSON file path |
410+
| `--session-name` | Optional session name (defaults to `aa-tRNA-seq: {directory}`) |
411+
| `--no-checksums` | Skip computing MD5 checksums (faster but no integrity verification) |
412+
413+
### Output Format
414+
415+
JSON with the following structure:
416+
417+
| Key | Description |
418+
|-----|-------------|
419+
| `version` | Schema version (`1.0.0`) |
420+
| `timestamp` | ISO 8601 generation time |
421+
| `sessionName` | Display name for the session |
422+
| `samples` | Per-sample `pod5Paths`, `bamPath`, `fastaPath` (relative paths) |
423+
| `plotOptions` | Default plot settings (eventalign mode, z-normalization) |
424+
| `fileChecksums` | MD5, size, and last-modified per file (unless `--no-checksums`) |
425+
426+
---
427+
385428
## Common Patterns
386429

387430
### Reading BAM Files

0 commit comments

Comments
 (0)