BAM Flag Index Query - A rust CLI tool to index and extract aligned sequences from a BAM file by their FLAG combination.
Count reads with the unmapped flag and is not a PCR duplicate:
bafiq count -f 0x4 -F 0x400 my.bamThe same as above but using named flags:
bafiq count --flag read-unmapped --no-flag pcr-dup my.bamStore filtered reads to a subset BAM file:
bafiq view -f 0x4 -F 0x400 my.bam | samtools view -bS -o unmapped-no-dup.bamInstall just for the best development experience:
cargo install justThen use the project's built-in commands:
# Build the project (handles macOS setup automatically)
just build
# See all available commands
just helpRun comprehensive benchmarks with statistical analysis:
# Index building benchmarks (multiple strategies vs samtools)
just bench-index --bam my.bam --threads 2,4,8 --samples 5 --clear-cache
# View operation benchmarks (bafiq vs samtools)
just bench-view --bam my.bam --flags 0x4,0x2 --threads 2,4 --samples 3
# Get help for specific benchmark types
just bench-index --help
just bench-view --helpjust build