Reconstructs diploid DNA allelic sequences from mixed sequencing traces containing heterozygous insertions/deletions (indels). Uses dynamic programming to resolve IUPAC ambiguity codes into allele pairs.
Based on the algorithm by D.A. Dmitriev & R.A. Rakitov. Ported from the original Classic ASP/VBScript implementation.
Download from the releases page for Linux (x86/arm64), macOS (x86/arm64), and Windows.
Requires Go 1.24+.
go install github.com/SpeciesFileGroup/indelligent/indelligent@latestgit clone https://github.com/SpeciesFileGroup/indelligent.git
cd indelligent
just installindelligent "TKGKKSCMW"Output (FASTA, colored by default):
>allele1
.TGGTGCCAT
>allele2
TTGGTGCCA.
>combined
TTGGTGCCAT
Mismatches and non-standard IUPAC bases are highlighted in red. Use
--no-color to disable.
# FASTA (default)
indelligent "TKGKKSCMW"
# JSON (compact)
indelligent "TKGKKSCMW" -f compact
# JSON (pretty-printed)
indelligent "TKGKKSCMW" -f pretty
# Tab-separated values
indelligent "TKGKKSCMW" -f tsvAdd -d for detailed statistics in FASTA and TSV output.
One sequence per line:
indelligent sequences.txt > results.fastaOr via stdin:
cat sequences.txt | indelligentFor lower memory usage with large files, use stream mode (-s) which
processes one sequence at a time instead of batching:
indelligent -s sequences.txtStart the built-in web server:
indelligent -p 1977Then open http://localhost:1977 in a browser. The web interface provides an interactive form matching the original ASP application, with color-highlighted results, simulation tools, and parameter controls.
When the web server is running:
# Health check
curl http://localhost:1977/api/v1/ping
# Version
curl http://localhost:1977/api/v1/version
# Analyze a single sequence
curl http://localhost:1977/api/v1/TKGKKSCMW
# Analyze multiple sequences
curl -X POST http://localhost:1977/api/v1/ \
-H "Content-Type: application/json" \
-d '{"sequences": ["TKGKKSCMW", "ATCRYSMK"]}'Generate a random fragment with known indels and analyze it:
indelligent --simulate --sim-length 100 --sim-indel 3| Flag | Description |
|---|---|
-V, --version |
Show version and build info |
-f, --format |
Output format: fasta (default), compact, pretty, tsv |
-d, --details |
Include full statistics in output |
-j, --jobs |
Worker threads (default: number of CPUs) |
-p, --port |
Start web service on port |
-s, --stream |
Stream mode instead of batch |
-u, --unordered |
Allow unordered output (faster) |
-b, --batch-size |
Max sequences per batch (default: 50000) |
-q, --quiet |
Suppress progress logging |
--no-color |
Disable colored output |
| Flag | Description |
|---|---|
-m, --max-shift |
Max phase shift size in bp (default: 15) |
-P, --shift-penalty |
Shift change penalty (default: 2) |
-x, --fix-shifts |
Restrict to specific shift magnitudes, comma-separated (e.g. 1,3) |
-A, --align-alleles |
Align alleles with gap characters (default: true) |
-a, --float-align |
Floating indel alignment: left or right (default: right) |
-L, --long-indels |
Display longer indel variants |
| Flag | Description |
|---|---|
--simulate |
Run in simulation mode |
--sim-length |
Fragment length in bp (default: 10) |
--sim-indel |
First indel size in bp (default: 1) |
--sim-indel2 |
Second indel size in bp (default: 0) |
--sim-allele |
Second indel allele: 1 or 2 (default: 2) |
--sim-subs |
Number of substitutions (default: 0) |
Indelligent can be used as a Go library:
package main
import (
"fmt"
"github.com/SpeciesFileGroup/indelligent"
)
func main() {
cfg := indelligent.NewConfig(
indelligent.OptMaxShift(20),
indelligent.OptAlignAlleles(true),
)
ind := indelligent.New(cfg)
res := ind.Analyze("TKGKKSCMW")
fmt.Println("Allele 1:", res.Allele1)
fmt.Println("Allele 2:", res.Allele2)
fmt.Println("Combined:", res.Combined)
fmt.Printf("Resolved: %d/%d (%.0f%%)\n",
res.Stats.ResolvedPositions, res.Stats.Length, res.Stats.ResolvedPct)
}For batch processing:
seqs := []string{"TKGKKSCMW", "ATCRYSMK", "WWSSMMKK"}
results := ind.AnalyzeMany(seqs) // concurrent, order-preserved# Build
just docker
# Run web server
docker run -p 1977:1977 sfgrp/indelligent
# Analyze a sequence
docker run sfgrp/indelligent "TKGKKSCMW"# Run tests
go test ./...
# Run tests with race detector
go test -race -count=1 ./...
# Build
just build
# Build release binaries for all platforms
just releaseThe analysis pipeline processes IUPAC-encoded mixed sequencing traces through six stages:
- Parse -- Normalize input and build the base-pair matrix (MX1)
- Score -- Forward/reverse dynamic programming to produce score matrices (MX2/MX3)
- Call -- Assign alleles and detect phase shifts from scores (MX4)
- Resolve -- Iteratively resolve ambiguous positions using 23+ decision rules
- Align -- Reposition gaps (floating indels) left or right
- Build -- Reconstruct allele sequences, aligned sequences, and consensus
MIT
Dmitriev D.A. & Rakitov R.A. (2008) Decoding of superimposed traces produced by direct sequencing of heterozygous indels. PLoS Computational Biology, 4(7): e1000113.