Literature DB >> 19505943

The Sequence Alignment/Map format and SAMtools.

Heng Li1, Bob Handsaker, Alec Wysoker, Tim Fennell, Jue Ruan, Nils Homer, Gabor Marth, Goncalo Abecasis, Richard Durbin.   

Abstract

SUMMARY: The Sequence Alignment/Map (SAM) format is a generic alignment format for storing read alignments against reference sequences, supporting short and long reads (up to 128 Mbp) produced by different sequencing platforms. It is flexible in style, compact in size, efficient in random access and is the format in which alignments from the 1000 Genomes Project are released. SAMtools implements various utilities for post-processing alignments in the SAM format, such as indexing, variant caller and alignment viewer, and thus provides universal tools for processing read alignments. AVAILABILITY: http://samtools.sourceforge.net.

Entities:  

Mesh:

Year:  2009        PMID: 19505943      PMCID: PMC2723002          DOI: 10.1093/bioinformatics/btp352

Source DB:  PubMed          Journal:  Bioinformatics        ISSN: 1367-4803            Impact factor:   6.937


1 INTRODUCTION

With the advent of novel sequencing technologies such as Illumina/Solexa, AB/SOLiD and Roche/454 (Mardis, 2008), a variety of new alignment tools (Langmead et al., 2009; Li et al., 2008) have been designed to realize efficient read mapping against large reference sequences, including the human genome. These tools generate alignments in different formats, however, complicating downstream processing. A common alignment format that supports all sequence types and aligners creates a well-defined interface between alignment and downstream analyses, including variant detection, genotyping and assembly. The Sequence Alignment/Map (SAM) format is designed to achieve this goal. It supports single- and paired-end reads and combining reads of different types, including color space reads from AB/SOLiD. It is designed to scale to alignment sets of 1011 or more base pairs, which is typical for the deep resequencing of one human individual. In this article, we present an overview of the SAM format and briefly introduce the companion SAMtools software package. A detailed format specification and the complete documentation of SAMtools are available at the SAMtools web site.

2 METHODS

2.1 The SAM format

2.1.1 Overview of the SAM format

The SAM format consists of one header section and one alignment section. The lines in the header section start with character ‘@’, and lines in the alignment section do not. All lines are TAB delimited. An example is shown in Figure 1b.
Fig. 1.

Example of extended CIGAR and the pileup output. (a) Alignments of one pair of reads and three single-end reads. (b) The corresponding SAM file. The ‘@SQ’ line in the header section gives the order of reference sequences. Notably, r001 is the name of a read pair. According to FLAG 163 (=1 + 2 + 32 + 128), the read mapped to position 7 is the second read in the pair (128) and regarded as properly paired (1 + 2); its mate is mapped to 37 on the reverse strand (32). Read r002 has three soft-clipped (unaligned) bases. The coordinate shown in SAM is the position of the first aligned base. The CIGAR string for this alignment contains a P (padding) operation which correctly aligns the inserted sequences. Padding operations can be absent when an aligner does not support multiple sequence alignment. The last six bases of read r003 map to position 9, and the first five to position 29 on the reverse strand. The hard clipping operation H indicates that the clipped sequence is not present in the sequence field. The NM tag gives the number of mismatches. Read r004 is aligned across an intron, indicated by the N operation. (c) Simplified pileup output by SAMtools. Each line consists of reference name, sorted coordinate, reference base, the number of reads covering the position and read bases. In the fifth field, a dot or a comma denotes a base identical to the reference; a dot or a capital letter denotes a base from a read mapped on the forward strand, while a comma or a lowercase letter on the reverse strand.

Example of extended CIGAR and the pileup output. (a) Alignments of one pair of reads and three single-end reads. (b) The corresponding SAM file. The ‘@SQ’ line in the header section gives the order of reference sequences. Notably, r001 is the name of a read pair. According to FLAG 163 (=1 + 2 + 32 + 128), the read mapped to position 7 is the second read in the pair (128) and regarded as properly paired (1 + 2); its mate is mapped to 37 on the reverse strand (32). Read r002 has three soft-clipped (unaligned) bases. The coordinate shown in SAM is the position of the first aligned base. The CIGAR string for this alignment contains a P (padding) operation which correctly aligns the inserted sequences. Padding operations can be absent when an aligner does not support multiple sequence alignment. The last six bases of read r003 map to position 9, and the first five to position 29 on the reverse strand. The hard clipping operation H indicates that the clipped sequence is not present in the sequence field. The NM tag gives the number of mismatches. Read r004 is aligned across an intron, indicated by the N operation. (c) Simplified pileup output by SAMtools. Each line consists of reference name, sorted coordinate, reference base, the number of reads covering the position and read bases. In the fifth field, a dot or a comma denotes a base identical to the reference; a dot or a capital letter denotes a base from a read mapped on the forward strand, while a comma or a lowercase letter on the reverse strand. In SAM, each alignment line has 11 mandatory fields and a variable number of optional fields. The mandatory fields are briefly described in Table 1. They must be present but their value can be a ‘⋆’ or a zero (depending on the field) if the corresponding information is unavailable. The optional fields are presented as key-value pairs in the format of TAG:TYPE:VALUE. They store extra information from the platform or aligner. For example, the ‘RG’ tag keeps the ‘read group’ information for each read. In combination with the ‘@RG’ header lines, this tag allows each read to be labeled with metadata about its origin, sequencing center and library. The SAM format specification gives a detailed description of each field and the predefined TAGs.
Table 1.

Mandatory fields in the SAM format

No.NameDescription
1QNAMEQuery NAME of the read or the read pair
2FLAGBitwise FLAG (pairing, strand, mate strand, etc.)
3RNAMEReference sequence NAME
4POS1-Based leftmost POSition of clipped alignment
5MAPQMAPping Quality (Phred-scaled)
6CIGARExtended CIGAR string (operations: MIDNSHP)
7MRNMMate Reference NaMe (‘=’ if same as RNAME)
8MPOS1-Based leftmost Mate POSition
9ISIZEInferred Insert SIZE
10SEQQuery SEQuence on the same strand as the reference
11QUALQuery QUALity (ASCII-33=Phred base quality)

2.1.2 Extended CIGAR

The standard CIGAR description of pairwise alignment defines three operations: ‘M’ for match/mismatch, ‘I’ for insertion compared with the reference and ‘D’ for deletion. The extended CIGAR proposed in SAM added four more operations: ‘N’ for skipped bases on the reference, ‘S’ for soft clipping, ‘H’ for hard clipping and ‘P’ for padding. These support splicing, clipping, multi-part and padded alignments. Figure 1 shows examples of CIGAR strings for different types of alignments.

2.1.3 Binary Alignment/Map format

To improve the performance, we designed a companion format Binary Alignment/Map (BAM), which is the binary representation of SAM and keeps exactly the same information as SAM. BAM is compressed by the BGZF library, a generic library developed by us to achieve fast random access in a zlib-compatible compressed file. An example alignment of 112 Gbp of Illumina GA data requires 116 GB of disk space (1.0 byte per input base), including sequences, base qualities and all the meta information generated by MAQ. Most of this space is used to store the base qualities.

2.1.4 Sorting and indexing

A SAM/BAM file can be unsorted, but sorting by coordinate is used to streamline data processing and to avoid loading extra alignments into memory. A position-sorted BAM file can be indexed. We combine the UCSC binning scheme (Kent et al., 2002) and simple linear indexing to achieve fast random retrieval of alignments overlapping a specified chromosomal region. In most cases, only one seek call is needed to retrieve alignments in a region.

2.2 SAMtools software package

SAMtools is a library and software package for parsing and manipulating alignments in the SAM/BAM format. It is able to convert from other alignment formats, sort and merge alignments, remove PCR duplicates, generate per-position information in the pileup format (Fig. 1c), call SNPs and short indel variants, and show alignments in a text-based viewer. For the example alignment of 112 Gbp Illumina GA data, SAMtools took about 10 h to convert from the MAQ format and 40 min to index with <30 MB memory. Conversion is slower mainly because compression with zlib is slower than decompression. External sorting writes temporary BAM files and would typically be twice as slow as conversion. SAMtools has two separate implementations, one in C and the other in Java, with slightly different functionality. Mandatory fields in the SAM format

3 CONCLUSIONS

We designed and implemented a generic alignment format, SAM, which is simple to work with and flexible enough to keep most information from various sequencing platforms and read aligners. The equivalent binary representation, BAM, is compact in size and supports fast retrieval of alignments in specified regions. Using positional sorting and indexing, applications can perform stream-based processing on specific genomic regions without loading the entire file into memory. The SAM/BAM format, together with SAMtools, separates the alignment step from downstream analyses, enabling a generic and modular approach to the analysis of genomic sequencing data.
  4 in total

1.  The human genome browser at UCSC.

Authors:  W James Kent; Charles W Sugnet; Terrence S Furey; Krishna M Roskin; Tom H Pringle; Alan M Zahler; David Haussler
Journal:  Genome Res       Date:  2002-06       Impact factor: 9.043

2.  Mapping short DNA sequencing reads and calling variants using mapping quality scores.

Authors:  Heng Li; Jue Ruan; Richard Durbin
Journal:  Genome Res       Date:  2008-08-19       Impact factor: 9.043

Review 3.  Next-generation DNA sequencing methods.

Authors:  Elaine R Mardis
Journal:  Annu Rev Genomics Hum Genet       Date:  2008       Impact factor: 8.929

4.  Ultrafast and memory-efficient alignment of short DNA sequences to the human genome.

Authors:  Ben Langmead; Cole Trapnell; Mihai Pop; Steven L Salzberg
Journal:  Genome Biol       Date:  2009-03-04       Impact factor: 13.583

  4 in total
  2000 in total

1.  Directed Nucleosome Sliding during the Formation of the Simian Virus 40 Particle Exposes DNA Sequences Required for Early Transcription.

Authors:  Meera Ajeet Kumar; Karine Kasti; Lata Balakrishnan; Barry Milavetz
Journal:  J Virol       Date:  2019-02-05       Impact factor: 5.103

2.  CD4+ T cells induce rejection of urothelial tumors after immune checkpoint blockade.

Authors:  Yuji Sato; Jennifer K Bolzenius; Abdallah M Eteleeb; Xinming Su; Christopher A Maher; Jennifer K Sehn; Vivek K Arora
Journal:  JCI Insight       Date:  2018-12-06

3.  Identification of STAC3 variants in non-Native American families with overlapping features of Carey-Fineman-Ziter syndrome and Moebius syndrome.

Authors:  Aida Telegrafi; Bryn D Webb; Sarah M Robbins; Carlos E Speck-Martins; David FitzPatrick; Leah Fleming; Richard Redett; Andreas Dufke; Gunnar Houge; Jeske J T van Harssel; Alain Verloes; Angela Robles; Irini Manoli; Elizabeth C Engle; Ethylin W Jabs; David Valle; John Carey; Julie E Hoover-Fong; Nara L M Sobreira
Journal:  Am J Med Genet A       Date:  2017-08-04       Impact factor: 2.802

4.  Comparative population genomics of maize domestication and improvement.

Authors:  Matthew B Hufford; Xun Xu; Joost van Heerwaarden; Tanja Pyhäjärvi; Jer-Ming Chia; Reed A Cartwright; Robert J Elshire; Jeffrey C Glaubitz; Kate E Guill; Shawn M Kaeppler; Jinsheng Lai; Peter L Morrell; Laura M Shannon; Chi Song; Nathan M Springer; Ruth A Swanson-Wagner; Peter Tiffin; Jun Wang; Gengyun Zhang; John Doebley; Michael D McMullen; Doreen Ware; Edward S Buckler; Shuang Yang; Jeffrey Ross-Ibarra
Journal:  Nat Genet       Date:  2012-06-03       Impact factor: 38.330

5.  The hnRNP Q-like gene is retroinserted into the B chromosomes of the cichlid fish Astatotilapia latifasciata.

Authors:  Bianca O Carmello; Rafael L B Coan; Adauto L Cardoso; Erica Ramos; Bruno E A Fantinatti; Diego F Marques; Rogério A Oliveira; Guilherme T Valente; Cesar Martins
Journal:  Chromosome Res       Date:  2017-08-03       Impact factor: 5.239

6.  Exome sequencing in Jewish and Arab patients with rhabdomyolysis reveals single-gene etiology in 43% of cases.

Authors:  Asaf Vivante; Hadas Ityel; Ben Pode-Shakked; Jing Chen; Shirlee Shril; Amelie T van der Ven; Nina Mann; Johanna Magdalena Schmidt; Reeval Segel; Adi Aran; Avraham Zeharia; Orna Staretz-Chacham; Omer Bar-Yosef; Annick Raas-Rothschild; Yuval E Landau; Richard P Lifton; Yair Anikster; Friedhelm Hildebrandt
Journal:  Pediatr Nephrol       Date:  2017-08-05       Impact factor: 3.714

7.  Metabolic and spatio-taxonomic response of uncultivated seafloor bacteria following the Deepwater Horizon oil spill.

Authors:  K M Handley; Y M Piceno; P Hu; L M Tom; O U Mason; G L Andersen; J K Jansson; J A Gilbert
Journal:  ISME J       Date:  2017-08-04       Impact factor: 10.302

8.  Complete Genome Sequence of Clostridium kluyveri JZZ Applied in Chinese Strong-Flavor Liquor Production.

Authors:  Yansheng Wang; Bin Li; Hong Dong; Xunduan Huang; Ruiyu Chen; Xingjie Chen; Laoji Yang; Bing Peng; Guopai Xie; Wei Cheng; Biao Hao; Changrun Li; Junfeng Xia; Buchang Zhang
Journal:  Curr Microbiol       Date:  2018-07-20       Impact factor: 2.188

9.  Pervasive within-Mitochondrion Single-Nucleotide Variant Heteroplasmy as Revealed by Single-Mitochondrion Sequencing.

Authors:  Jacqueline Morris; Young-Ji Na; Hua Zhu; Jae-Hee Lee; Hoa Giang; Alexandra V Ulyanova; Gordon H Baltuch; Steven Brem; H Isaac Chen; David K Kung; Timothy H Lucas; Donald M O'Rourke; John A Wolf; M Sean Grady; Jai-Yoon Sul; Junhyong Kim; James Eberwine
Journal:  Cell Rep       Date:  2017-12-05       Impact factor: 9.423

10.  Highly Efficient Knockout of a Squid Pigmentation Gene.

Authors:  Karen Crawford; Juan F Diaz Quiroz; Kristen M Koenig; Namrata Ahuja; Caroline B Albertin; Joshua J C Rosenthal
Journal:  Curr Biol       Date:  2020-07-30       Impact factor: 10.834

View more

北京卡尤迪生物科技股份有限公司 © 2022-2023.