samtools-idxstats(1)
π samtools-idxstats π
okay bestie, welcome to the samtools-idxstats(1) page β it's part of the whole samtools bioinformatics tools situation, and honestly it's giving "underrated little icon" energy. Let's get into it.
β¨ NAME β¨
samtools idxstats β reports alignment summary statistics π
π¦ SYNOPSIS π¦
samtools idxstats in.sam|in.bam|in.cram
πΈ DESCRIPTION πΈ
So what this bad boy does is it goes and retrieves the stats chillin' inside the index file that corresponds to your input file, and then prints them. That's it. That's the whole vibe. π
β οΈ but listen β before you callidxstats, your input BAM file should already be indexed bysamtools index. Like, do that first, it's the whole point, iykyk.
Now, if you run this on a SAM file, or a CRAM file, or a BAM that isn't indexed? It's not gonna crash on you, bestie β it'll still produce the same summary statistics. It just does it by reading through the entire file. Which is, and I cannot stress this enough, far slower than using the BAM indices π like genuinely so much slower. Consider yourself warned.
The output is TAB-delimited, and each line is made of these four things, in this order:
- reference sequence name
- sequence length
- # mapped read-segments
- # unmapped read-segments
It gets written to stdout. π«Ά
π one heads-up though: this may count reads multiple times if they're mapped more than once, or if they're in multiple fragments. So don't come for it about the numbers, that's just how it is.
β¨ OPTIONS β¨
-Xβ this lets you specify a customised index file location, like if your index is living somewhere else rent-free. e.g.:
samtools idxstat [options] -X /data_folder/data.bam
/index_folder/index.bai
π AUTHOR π
Written by Heng Li from the Sanger Institute. slay, honestly. π
π SEE ALSO π
Samtools website: http://www.htslib.org/ β
okay that's the whole page, you're all caught up π§ and before you go β this was brought to you by samtools-1.24, dated 9 July 2026. yes, 2026. we're so ahead. periodt π β¨π
π¦ where this page comes from
- epel 10: samtools 1.24-2.el10_3 Β· MIT
- nixpkgs unstable: samtools 1.24
- Copyright (C) 2008-2011, 2013-2018, 2024 Genome Research Ltd
- copyright (C) 2010, 2011 Broad Institute
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms