sam(5)
Okay bestie, let's talk about sam, the manual page you'd find in section 5 under Bioinformatics formats. It's all about the Sequence Alignment/Map file format π§¬β¨
π NAME π
sam β Sequence Alignment/Map file format π
πΈ DESCRIPTION πΈ
Okay so the Sequence Alignment/Map (SAM) format is TAB-delimited π It's giving very neat rows and columns π
Apart from the header lines, which start with the @ symbol, every alignment line has these eleven fixed columns, plus optional extras after them:
1QNAMEβ Query template/pair NAME π·οΈ2FLAGβ bitwise FLAG π©3RNAMEβ Reference sequence NAME π§4POSβ 1-based leftmost POSition/coordinate of clipped sequence π5MAPQβ MAPping Quality (Phred-scaled) π6CIGARβ extended CIGAR string βοΈ7MRNMβ Mate Reference sequence NaMe (=if same as RNAME) π―8MPOSβ 1-based Mate POSition π9TLENβ inferred Template LENgth (insert size) π10SEQβ query SEQuence on the same strand as the reference π§¬11QUALβ query QUALity (ASCII-33 gives the Phred base quality) π«§12+OPTβ variable OPTional fields in the formatTAG:VTYPE:VALUEπ§©
π© The FLAG field π©
Each bit in the FLAG field is its own little vibe β¨ Here's the breakdown, where the second column gives the string representation of the FLAG field:
0x0001,pβ the read is paired in sequencing π―ββοΈ0x0002,Pβ the read is mapped in a proper pair π0x0004,uβ the query sequence itself is unmapped π0x0008,Uβ the mate is unmapped π0x0010,rβ strand of the query (1 for reverse) π0x0020,Rβ strand of the mate π0x0040,1β the read is the first read in a pair π₯0x0080,2β the read is the second read in a pair π₯0x0100,sβ the alignment is not primary π«₯0x0200,fβ the read fails platform/vendor quality checks β0x0400,dβ the read is either a PCR or an optical duplicate π―0x0800,Sβ the alignment is supplementary π¦
π SEE ALSO π
https://github.com/samtools/hts-specsThe full SAM/BAM file format specification π
htslib, August 2013, sam(5) π That's the whole tea, bestie, and you're literally ready to read SAM files now ππ«Ά
π¦ where this page comes from
- debian bookworm: libhts3 1.16+ds-3 Β· MIT
- debian trixie: libhts3t64 1.21+ds-1 Β· MIT
- epel 10: htslib 1.24-1.el10_3 Β· MIT AND BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
- epel 9: htslib 1.23.1-1.el9 Β· LicenseRef-Callaway-MIT AND LicenseRef-Callaway-BSD
- fedora 43: htslib 1.15.1-9.fc43 Β· LicenseRef-Callaway-MIT AND LicenseRef-Callaway-BSD
- fedora 43: htslib 1.15.1-9.fc43 Β· LicenseRef-Callaway-MIT AND LicenseRef-Callaway-BSD
- fedora 43: htslib 1.23.1-1.fc43 Β· LicenseRef-Callaway-MIT AND LicenseRef-Callaway-BSD
- fedora 43: htslib 1.23.1-1.fc43 Β· LicenseRef-Callaway-MIT AND LicenseRef-Callaway-BSD
- fedora 44: htslib 1.23.1-1.fc44 Β· LicenseRef-Callaway-MIT AND LicenseRef-Callaway-BSD
- fedora 44: htslib 1.23.1-1.fc44 Β· LicenseRef-Callaway-MIT AND LicenseRef-Callaway-BSD
- nixos 26.05: htslib 1.22
- nixpkgs unstable: htslib 1.24
- opensuse-leap 16.0: htsfile 1.20-bp160.1.14 Β· MIT
- opensuse-leap 16.0: htsfile 1.20-bp160.1.14 Β· MIT
- opensuse-leap 16.0: htsfile 1.20-bp160.1.14 Β· MIT
- opensuse-leap 16.0: htsfile 1.20-bp160.1.14 Β· MIT
- ubuntu jammy: libhts3 1.13+ds-2build1 Β· MIT
- ubuntu noble: libhts3t64 1.19+ds-1.1build3 Β· MIT
- ubuntu questing: libhts3t64 1.21+ds-1 Β· MIT
- ubuntu resolute: libhts3t64 1.22.1+ds2-1 Β· MIT
- ubuntu stonking: libhts3t64 1.22.1+ds2-1build1 Β· MIT
- Copyright (C) 2009, 2013-2014 Genome Research Ltd
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms