plot-ampliconstats
Perl plotting helper for samtools ampliconstats. It consumes an ampliconstats table and writes a prefix-based set of gnuplot scripts, PNG figures, and an index.html gallery.
Quick Start
- Command:
plot-ampliconstats prefix [FILE] - Local executable:
/home/vimalinx/miniforge3/envs/bio/bin/plot-ampliconstats - Input contract: reads
samtools ampliconstats-style data fromFILEor stdin ifFILEis omitted
When To Use This Tool
- Visualizing amplicon statistics from samtools ampliconstats output
- Generating heatmaps and graphs for amplicon coverage analysis
- Producing prefix-named PNG panels and an HTML gallery for multi-sample reports
- Adjusting plot sizing, paging, orientation, thumbnail generation, and read-depth scaling
Common Patterns
# 1) Plot from an existing ampliconstats table
plot-ampliconstats run1 stats.txt
# 2) Stream directly from stdin
samtools ampliconstats ... | plot-ampliconstats run1
# 3) Tune layout and create thumbnails
plot-ampliconstats -orient v -page 48 -thumbnails -thumb-size 160 run1 stats.txt
Recommended Workflow
- Generate a valid ampliconstats table first, then choose a writable output prefix.
- Decide whether you want horizontal or vertical layouts and whether large cohorts need
-pagelimits. - Run the plotter and inspect both the
*.pngfigures and the generatedindex.html. - Re-run with adjusted
-size,-size2,-size3, or-depth-maxif the default panels are cramped or clipped.
Guardrails
plot-ampliconstats --helpworks, but--versionis not a real metadata flag: it printsUnknown option: versionbefore the usage text.- The script requires
gnuplot5.0 or later. In this environment a smoke test failed immediately withgnuplot: No such file or directory. - Prefix controls many output names, not just one file. Source inspection shows outputs such as
prefix-combined-depth.png,prefix-heat-reads-*.png,prefix-*.gp, andindex.html. - If
FILEis omitted the script reads stdin. That makes it stream-friendly, but also easy to hang if the upstream producer never terminates. - The script exposes an undocumented-but-real
--index-onlyswitch inGetOptions; do not rely on it without testing because it is not listed in the built-in usage text.