Fast, flexible, and reproducible workflows for assembling Sanger sequencing data into contigs in R. A free and open-source alternative to Geneious, CodonCode Aligner, and Phred-Phrap-Consed.
~1.7× faster SangerAlignment(...) thanks to a C++ peak-detection inner loop, parallel per-read construction (BiocParallel), and lazy 3-frame amino-acid translation that only runs when you ask for it.
Interactive Plotly + WebGL chromatograms via the new chromatogram_plotly() — smooth scrolling and zoom on Sanger traces with tens of thousands of points.
Global trimming dashboard via the new globalTrimApp(sa) — adjust M1 / M2 trimming parameters across an entire SangerAlignment with a live consensus preview.
# Open the global trim dashboard — sliders for M1 / M2 with live preview.
# Returns the re-trimmed SangerAlignment when the user clicks "Done".
sa2 <- globalTrimApp(sa)
3. Explore your data
Open the per-read Shiny app for a SangerContig (or use launchApp(sa) on a full SangerAlignment):
launchApp(sa)
You can also pull up an interactive WebGL chromatogram for a single read without launching the full app:
sr <- sa@contigList[[1]]@forwardReadList[[1]]
chromatogram_plotly(sr, max_points = 8000, showtrim = TRUE)
4. Export and report
# FASTA: dispatches across SangerRead / SangerContig / SangerAlignment
writeFasta(sa)
# HTML report (requires pandoc) — works on lazy-AA objects out of the box
generateReport(sa)
Lazy AA accessors
When no AA reference is supplied, primaryAASeqS{1,2,3}() compute on demand:
sr <- sa@contigList[[1]]@forwardReadList[[1]]
length(sr@primaryAASeqS1) # 0 — slot is empty under lazyAA = TRUE
primaryAASeqS1(sr) # AAString returned by accessor (computed on call)
To restore eager translation (e.g. for the legacy direct-slot pattern):
sr_eager <- SangerRead(
inputSource = "ABIF",
readFeature = "Forward Read",
readFileName = file.path(ab1_dir, "Achl_ACHLO006-09_1_F.ab1"),
TrimmingMethod = "M1",
lazyAA = FALSE
)
sr_eager@primaryAASeqS1 # populated at construction time
Cross-platform parallel
# macOS / Linux: forks via MulticoreParam
sa <- SangerAlignment(..., BPPARAM = BiocParallel::MulticoreParam(workers = 4))
# Windows: cluster-of-processes via SnowParam
sa <- SangerAlignment(..., BPPARAM = BiocParallel::SnowParam(workers = 4))
# Or just register a default once and forget about it:
BiocParallel::register(BiocParallel::SerialParam())
sa <- SangerAlignment(...) # picks up the registered backend
Citation
If sangeranalyseR is useful in your published work, please cite:
Kuan-Hao Chao, Kirston Barton, Sarah Palmer, and Robert Lanfear (2021).sangeranalyseR: simple and interactive processing of Sanger sequencing data in R. Genome Biology and Evolution. DOI: 10.1093/gbe/evab028.
sangeranalyseR
Fast, flexible, and reproducible workflows for assembling Sanger sequencing data into contigs in R. A free and open-source alternative to Geneious, CodonCode Aligner, and Phred-Phrap-Consed.
For full documentation see 📒 sangeranalyseR Documentation.
What’s new
SangerAlignment(...)thanks to a C++ peak-detection inner loop, parallel per-read construction (BiocParallel), and lazy 3-frame amino-acid translation that only runs when you ask for it.chromatogram_plotly()— smooth scrolling and zoom on Sanger traces with tens of thousands of points.globalTrimApp(sa)— adjust M1 / M2 trimming parameters across an entireSangerAlignmentwith a live consensus preview.For the full per-version changelog see
NEWS.md.Installation
From Bioconductor (recommended)
From GitHub
System requirements
build-essential), and Windows (Rtools).pandocfor HTML report rendering.Quick start
A four-step end-to-end example using the bundled
Allolobophora chloroticafixture (8 ABIF files, 4 contigs).1. Load and assemble
2. Tweak trimming parameters interactively
3. Explore your data
Open the per-read Shiny app for a
SangerContig(or uselaunchApp(sa)on a fullSangerAlignment):You can also pull up an interactive WebGL chromatogram for a single read without launching the full app:
4. Export and report
Lazy AA accessors
When no AA reference is supplied,
primaryAASeqS{1,2,3}()compute on demand:To restore eager translation (e.g. for the legacy direct-slot pattern):
Cross-platform parallel
Citation
If
sangeranalyseRis useful in your published work, please cite:Available on Genome Biology and Evolution (GBE) and Bioconductor.
Maintainers
License: GPL-2 (see
LICENSE).Issues and feature requests: github.com/roblanf/sangeranalyseR/issues.