This module provides functionality to generate SVG chromatograms from ABIF trace files. It renders the four fluorescence channels with base calls in a visual format that resembles the output of DNA sequencing instruments. Command-line usage:
abichromatogram <trace_file.ab1> [options]
Options:
-o, --output FILE
Output SVG file (default: chromatogram.svg)
-w, --width WIDTH
SVG width in pixels (default: 1200)
--height HEIGHT
SVG height in pixels (default: 600)
-s, --start POS
Start position (default: 0)
-e, --end POS
End position (default: whole trace)
-d, --downsample
FACTOR Downsample factor for visualization (default: 1)
--hide-bases
Hide base calls
--debug
Show debug information
-h, --help
Show this help message and exit
-v, --version
Show version information and exit
Example usage:
# Generate a chromatogram from a trace file abichromatogram input.ab1 -o output.svg # Generate a zoomed view of a specific region with downsampling abichromatogram input.ab1 -s 500 -e 1000 -d 5
Types
Channel = enum A = "A", C = "C", G = "G", T = "T"
- The four channels used in capillary electrophoresis Source Edit
TraceData = object points*: seq[TraceDataPoint] ## Processed trace data points baseOrder*: string ## Order of bases in channels (e.g., "ACGT") peaks*: seq[int] ## Base call peak positions sequence*: string ## Called sequence traceLen*: int ## Total length of trace in data points baseColors*: Table[Channel, string] ## Color mapping for each nucleotide base
- Processed trace data ready for visualization Source Edit
TraceDataPoint = object position*: int ## X position (scan number) values*: Table[Channel, int] ## Intensity value for each channel (scaled 0-1000)
- A single data point in the trace with values for each channel Source Edit