RepeatNet: an ab initio centromeric satellite sequence detection algorithm from unassembled paired-end or long-read whole-genome shotgun (WGS) reads (Alkan et al., Genome Research 2011), supporting Sanger, Illumina, PacBio HiFi, Oxford Nanopore (ONT), and PacBio CLR datasets with sparse 64-bit
- PHRAP, SPAdes, or hifiasm / Flye — assembling extracted reads/read pairs into contigs
- Tandem Repeats Finder (TRF) — extracting candidate satellite monomer / HOR consensus sequences from assembled contigs
-
Graphviz (
neato/dot) (optional) — visualizing$k$ -mer co-occurrence graphs and connected components
make # optimized build (-O3 -Wall -Wextra) -> ./repeatnet
make debug # AddressSanitizer + UBSan build for debugging
make clean # remove ./repeatnet and build/Run ./repeatnet --help or ./repeatnet <command> --help for full option summaries.
Usage: repeatnet <command> [options]
Pipeline commands:
loadseq index sanger/illumina/hifi/ont/pacbio-clr reads into .kindex
makegraph filter/merge .kindex and build the co-occurrence graph (.matrix/.viz)
components partition a .matrix graph into connected components
fetchseq extract reads or read pairs supporting a connected component
assemble assemble component reads + run TRF via YAML config [future work]
Utility commands:
trim remove k-mers in a component/file (and revcomps) from a .kindex
encode encode a k-mer sequence (1..31 bp) into its 64-bit integer vertex ID
decode decode 64-bit integer vertex IDs from a file back to k-mer sequences
help display help for any subcommand
Both compression (gzip / bgzip magic bytes 0x1f 0x8b vs. plain text, via zlib) and sequence format (FASTA > vs. FASTQ @) are auto-detected independently for every input file. Specify the sequencing platform via -m / --mode:
Forward (-f) and reverse (-r) mates are in matching order across two files (plain text or .gz). RepeatNet skips hash pairing, streams read pairs one-by-one in .h<H> from output filenames:
repeatnet loadseq --mode illumina -k 15 -f reads_1.fq.gz -r reads_2.fq.gz -o sampleUnpaired single-molecule long reads (-i). RepeatNet streams reads one-by-one without hash pairing (omitting .h<H> from output filenames) and records a read under a
repeatnet loadseq --mode hifi -k 21 -i reads.hifi.fq -o sample_hifi
repeatnet loadseq --mode ont -k 15 -i reads.ont.fq -o sample_ont
repeatnet loadseq --mode pacbio-clr -k 15 -i reads.clr.fa -o sample_clrSupports either an unordered/interleaved single file (-i, paired via clone-name hash() and writing <prefix>.h<H>.*) or two ordered mate files (-f and -r, streamed without hashing and writing <prefix>.*):
repeatnet loadseq --mode sanger -i sanger_reads.fa -o sanger_run# Illumina paired-end short reads:
repeatnet loadseq --mode illumina -f reads_1.fq -r reads_2.fq -o sample
# Or PacBio HiFi long reads (e.g., k = 21):
repeatnet loadseq --mode hifi -k 21 -i reads.hifi.fq -o sample
# Or interleaved Sanger reads (writes sample.h11.{kindex,names,kmers}):
repeatnet loadseq --mode sanger -i test.fa -o sampleGenerates <prefix>.kindex, <prefix>.names, and <prefix>.kmers (or <prefix>.h<H>.* when single-file sanger hash pairing is used).
repeatnet makegraph -x sample.kindex -m -c 100 -a 100-
-m(--merge, enabled by default; pass-M/--no-mergeto disable) merges each$k$ -mer with its reverse complement because WGS reads originate from both strands. -
-c 100discards$k$ -mer vertices occurring in fewer than 100 read pairs / long reads. -
-a 100keeps edges between pairs of$k$ -mers that co-occur in at least 100 read pairs / long reads (alternatively, omit-aand pass-e <float>to threshold by normalized Sørensen–Dice edge weight).
(Optional) Visualize the graph with Graphviz:
neato -Tps -o graph.eps sample.kindex.cut100.a100.merged.vizrepeatnet components -g sample.kindex.cut100.a100.merged.matrixWrites component-1.{matrix,viz,txt}, component-2.{matrix,viz,txt}, ..., plus <matrix>.degrees. Pick candidate satellite clusters (e.g., largest component-N.txt files).
# Illumina paired-end (split R1/R2 for SPAdes, or -o component-1.fa -F for PHRAP):
repeatnet fetchseq --mode illumina -C component-1.txt -f reads_1.fq -r reads_2.fq -x sample.kindex -1 comp1_1.fq -2 comp1_2.fq
# Long reads (HiFi / ONT / PacBio CLR):
repeatnet fetchseq --mode hifi -C component-1.txt -i reads.hifi.fq -x sample.kindex -o component-1.fq
# Interleaved Sanger input:
repeatnet fetchseq --mode sanger -C component-1.txt -i test.fa -x sample.h11.kindex -o component-1.fa(Tip: pass -F / --fasta to convert FASTQ reads to FASTA, or --clones-only to output only the unique supporting read/clone names.)
Finally, assemble the extracted reads (phrap, SPAdes, hifiasm, or Flye) and run TRF on the resulting contigs to obtain candidate satellite monomer/HOR consensus sequences.
Downstream assembler binaries/flags (phrap, spades, hifiasm, flye, or custom profiles) and TRF parameters are configured in config.yaml:
# Generate a default config.yaml template:
repeatnet assemble --init-config my_config.yaml
# Inspect resolved assembler & TRF settings:
repeatnet assemble -y config.yaml --show-config
repeatnet assemble -y config.yaml --mode illumina -1 comp1_1.fq -2 comp1_2.fq(Note: repeatnet assemble currently loads/validates the YAML configuration and resolves the target assembler + TRF commands; automated subprocess execution is stubbed as future work.)
In paired-end libraries (sanger, illumina), both mates of a centromeric insert lie inside the same tandem repeat array on opposite strands, so a hifi, ont, pacbio-clr), a centromeric read spans multiple tandem monomers on the same strand, producing
The .kindex file is RepeatNet's sparse 64-bit inverted index of tandem-repeat
-
Header (ASCII): Line 1 stores the
$k$ -mer length<WS>\n(1 <= WS <= 31, default12). -
Body (Binary records): For every active
$k$ -mer with$\ge 1$ supporting read/pair,.kindexstores[uint64_t code][uint32_t count][uint32_t read_id_1]...[uint32_t read_id_count]in ascendingcodeand ascendingread_idorder, where eachread_idindexes into<prefix>[.h<H>].names.
Saving .kindex decouples raw sequence parsing from graph exploration: you run loadseq once, and can then run makegraph, fetchseq, and trim repeatedly with different -c / -a / -e thresholds in seconds without re-indexing the WGS library.
(Note: .h<H> appears in <prefix>[.h<H>].* only when single-file --mode sanger hash pairing is used; it is omitted for illumina, hifi, ont, pacbio-clr, and two-file sanger.)
| File / Pattern | Command | Format | Description |
|---|---|---|---|
<prefix>[.h<H>].kindex |
loadseq |
Mixed ASCII + Binary | Sparse 64-bit <WS>\n header followed by binary [uint64_t code][uint32_t count][uint32_t id_1 ... id_count] records. |
<prefix>[.h<H>].names |
loadseq |
ASCII TSV | Read / clone ID lookup table: line 1 is total slot count nseq, followed by <id>\t<read_or_clone_name>. |
<prefix>[.h<H>].kmers |
loadseq |
ASCII TSV | Pre-merge <uint64_t code>\t<count> for all active |
<kindex>.histogram |
makegraph |
ASCII TSV | Pre-merge count distribution: <read_count>\t<num_kmers> sorted by ascending read_count to guide -c selection. |
<kindex>.cut<C>.<aA|eE>[.merged].matrix |
makegraph |
Binary | 64-bit co-occurrence repeat graph: [uint64_t num_edges][int WS] header followed by num_edges triples [uint64_t v1][uint64_t v2][uint32_t shared_reads] ( |
<kindex>.cut<C>.<aA|eE>[.merged].viz |
makegraph |
Graphviz DOT | Undirected graph (graph G { v1 -- v2; }) for visualization with neato or dot. |
<kindex>.cut<C>.<aA|eE>[.merged].edges |
makegraph --edgehist |
ASCII text | Shared-read co-occurrence weight (eboth) per emitted graph edge (one integer per line). |
<matrix>.degrees |
components |
ASCII TSV | Sparse vertex degree table (<uint64_t vertex_id>\t<degree>) sorted by vertex ID for every non-isolated vertex. |
component-<N>.matrix |
components |
Binary | Subgraph 64-bit .matrix file containing only the edges belonging to connected component N (-p customizes the component prefix). |
component-<N>.viz |
components |
Graphviz DOT | Subgraph visualization (subgraph clusterN { ... }) for connected component N labeled with decoded |
component-<N>.txt |
components |
ASCII text | Lexicographically sorted list of unique decoded N (passed to fetchseq -C). |
<hub_file>.neighbors |
components --getn |
ASCII text | Sorted, deduplicated 64-bit integer vertex IDs of the queried hub vertex(es) in <hub_file> and their immediate graph neighbors. |
<out.fa> / <out_1.fq>, <out_2.fq>
|
fetchseq |
FASTA / FASTQ / Text | Extracted reads or read pairs (single file via -o/stdout, split mates via -1/-2, forced FASTA via -F, or names via --clones-only) supporting a component. |
<prefix>-<kmerfile>.kindex |
trim / makegraph --trim
|
Mixed ASCII + Binary | Trimmed .kindex with all <kmerfile> and their reverse complements removed for iterative satellite peeling. |
<prefix>-<kmerfile>.kmers |
trim / makegraph --trim
|
ASCII TSV | Updated <uint64_t code>\t<count> summary corresponding to the trimmed .kindex. |
<ids_file>.decoded |
decode |
FASTA | Decoded ><vertex_id>\n<k-mer>) for 64-bit vertex IDs listed in <ids_file> (-k sets 12). |
Alkan C, Cardone MF, Catacchio CR, Antonacci F, O'Brien SJ, Ryder OA, Purgato S, Zoli M, Della Valle G, Eichler EE, Ventura M. (2011). Genome-wide characterization of centromeric satellites from multiple mammalian genomes. Genome Research, 21(1):137–145. doi:10.1101/gr.111278.110