RAMTools provides efficient tools for converting SAM files to ROOT's modern, columnar RNTuple format (RAM - ROOT Alignment/Map) and working with genomic alignment data.
- High-performance SAM to RAM conversion
- Chromosome-based splitting for parallel processing
- Region-based querying capabilities
- ROOT 6.26+
- C++17 compatible compiler
- CMake 3.16+
# 1. Build the tools
mkdir build && cd build
cmake ..
make -j$(nproc)
# 2. Convert a SAM file to the RAM format
./tools/samtoramntuple ../test/samexample.sam output.root
# 3. Query a specific region from the command line
./tools/ramntupleview output.root "chr1:15700-15800"The primary way to interact with RAMTools is through these command-line executables.
Convert a standard SAM file into the optimized RNTuple-based RAM format.
# Basic conversion
./tools/samtoramntuple input.sam output.root
# Split by chromosome for parallel processing
# (Creates output-chr1.root, output-chr2.root, etc.)
./tools/samtoramntuple input.sam output -splitQuery a specific genomic region from a RAM file, similar to samtools view.
# Usage: ./tools/ramntupleview [input.root] "[chromosome]:[start]-[end]"
./tools/ramntupleview output.root "chr1:10150-10300"Tested with the HG00154 sample from the 1000 Genomes Project (196M reads, 72.1 GB SAM). RAM is RNTuple-only. The same sample compresses to 11.4 GB.
| Region | Time (s) | CPU (s) | Reads/sec | Total Reads |
|---|---|---|---|---|
| Small (100bp) | 4.10 | 2.55 | 2.7 | 7 |
| Gene (BRCA2) | 1.20 | 1.15 | 37,308 | 42,961 |
| 10Mb | 7.40 | 6.67 | 446,331 | 2,977,922 |
| 100Mb | 6.46 | 6.36 | 448,688 | 2,852,438 |
| Region | Time (s) | CPU (s) | Reads/sec | Total Reads |
|---|---|---|---|---|
| Small (100bp) | 2.98 | 1.67 | 4.2 | 7 |
| Gene (BRCA2) | 1.01 | 0.948 | 45,321 | 42,961 |
| 10Mb | 7.43 | 6.68 | 445,709 | 2,977,922 |
| 100Mb | 6.47 | 6.29 | 453,736 | 2,852,438 |
| Region | Time (s) | CPU (s) | Reads/sec | Total Reads |
|---|---|---|---|---|
| Small (100bp) | 2.85 | 1.73 | 4.0 | 7 |
| Gene (BRCA2) | 1.19 | 1.14 | 37,529 | 42,961 |
| 10Mb | 7.40 | 6.62 | 449,599 | 2,977,922 |
| 100Mb | 6.49 | 6.41 | 445,148 | 2,852,438 |
Key findings:
- Large-region throughput is about 445,000–454,000 reads/sec across LZMA, LZ4, and ZLIB
- LZ4 is the fastest of the three on the 100Mb query (453,736 reads/sec)
- Small 100bp queries are dominated by setup overhead (a few seconds for 7 reads)