samtools-tview(1)
π samtools-tview π
ok so real talk, this is the samtools tview page from the samtools manual β the cute little interactive alignment viewer β and i'm gonna walk you through every single bit of it, no skips, no "you'll figure it out" energy π
β¨ NAME β¨
samtools tview β display alignments in a curses-based interactive viewer π¦
like, yes bestie, your BAM alignments. in a terminal. with ncurses. iconic behavior honestly.
πΈ SYNOPSIS πΈ
samtools tview [-p chr:pos] [-s STR] [-d display] in.sorted.bam
[ref.fasta]
that's the whole vibe. sorted bam in, optional reference fasta, some flags if you're feeling spicy π₯
π DESCRIPTION π
so this is the text alignment viewer β it's based on the ncurses library, meaning it runs right there in your terminal and it's fully interactive. main character energy fr π
once you're inside the viewer:
- hit
?for help β yes it has a help menu, she's helpful - hit
gto jump the alignment start to a region. the format is likechr10:10,000,000, or=10,000,000when you're viewing the same reference sequence as before β¨
now, the layout, top to bottom:
- the top line shows the reference sequence β or just a bunch of
'N's if the reference is unknown π« - underneath that is the consensus, derived from the sequence alignments
- below the consensus, all the sequence alignment records get shown
and about the casing: uppercase vs lowercase is how you tell the sequence strand apart. uppercase = top / forward strand, periodt π
when the reference is known, both the consensus and the alignment record sequences get displayed in a dot-notation π where a matching character shows up as '.' (forward strand) or ',' (reverse strand), and like... only the mismatching bases and the missing bases actually show up as letters. sneak peek just the drama, love that for us.
you can toggle this mode on and off with the "." command π«
β OPTIONS β
-d displayβ output as(H)tml,(C)ursesor(T)ext. that's the display mode bestie, pick your fighter.
the width of the generated text is controlled by the COLUMNS environment variable, or by the -w option for the non-curses outputs π heads up tho: COLUMNS may be a local shell variable, so you might need to export it first, or just specify it right on the command line before the command. like so:
export COLUMNS ; samtools tview -d T -p 1:234567 in.bam
-p chr:posβ go directly to this position π no scrolling around like a lost little guy.-s STRβ display only alignments from this sample or read group.STRhas to match either anIDorSMfield in an@RGheader record, no cap. for example:
samtools tview -p chr20:10M -s NA12878 grch38.fa
-w INTβ specifies the display width when using the HTML or Text output modes π (curses does its own thing, she doesn't need it).-Xβ if this option is set, it will allows user to specify customized index file location(s) if the data folder does not contain any index file ποΈ (yes i kept the original wording, she said "it will allows", we respect her). example usage:
samtools tview [options] -X </data_folder/data.bam>
[/index_folder/index.bai] [ref.fasta]
lowkey important: in.sorted.bam in the synopsis β the bam's gotta be sorted. the manpage says it, i'm saying it, we're all saying it together π«Ά
π AUTHOR π
written by Heng Li from the Sanger Institute π an absolute legend, we stan.
π SEE ALSO π
samtools(1)- Samtools website: <http://www.htslib.org/>
and that's the whole page bestie, every flag accounted for, nothing dropped, we ate and left no crumbs π
samtools-1.24 Β· 9 July 2026 β that's the version and date this page shipped with, mwah π catch you in the next manpage ππ
π¦ where this page comes from
- epel 10: samtools 1.24-2.el10_3 Β· MIT
- nixpkgs unstable: samtools 1.24
- Copyright (C) 2008-2011, 2013-2019, 2022 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