Here the CIGAR string does distinguish between matches and mismatches, thus the
MD-TAG is not mandatory. In general, a CIGAR string is made up of and ,
where is an operation specified as a single character (Table 7.3).
Example CIGAR: 3¼1I3¼1D2¼1X2¼
7.2.5 BAM
A BAM file (*.bam) is the compressed binary version of a SAM file. BAM files are binary
files, which mean they cannot be opened like text files; they are compressed and can be
sorted and/or indexed.
They consist of a header section and an alignment section. The header contains
information about the entire file, such as sample name and length. Alignments contain
the name, sequence, and quality of a read. Alignment information and custom tags can also
be found in the alignment section.
The following table shows the information for each read or read pair depicted in the
alignment section:
RG
Read group, which indicates the number of reads for a specific sample
BC
Barcode tag, indicating the read-associated demultiplexed sample ID
SM
Single-end alignment quality
AS
Paired-end alignment quality
NM
Edit distance tag, recording the Levenshtein distance between read and reference
XN
Amplicon name tag, recording the amplicon tile ID associated with the read
BAM files can also have a companion file, called an index file. This file has the same
name, suffixed with *.bai. The BAI file acts like an external table of contents, and allows
programs to jump directly to specific parts of the BAM file without reading through all of
the sequences. Without the corresponding BAM file, your BAI file is useless, since it does
not actually contain any sequence data.
Table 7.3 CIGAR string for error calculation (optional field: NM:i:<#>)
<#> Operator
CIGAR string description (<#> means number of)
<#>¼
<#> of matches
<#>X
<#> of mismatches
<#>D
<#>Deletions (gap in the sequencing read)
<#>I
<#>Insertions (gap in the reference sequence)
<#>N
<#> skipped region (gap in the sequencing read)
S
Soft clipping (clipped sequences present in SEQ)
H
Hard clipping (clipped sequences not present in SEQ)
86
M. Kappelmann-Fenzl
MD-TAG is not mandatory. In general, a CIGAR string is made up of
where
Example CIGAR: 3¼1I3¼1D2¼1X2¼
7.2.5 BAM
A BAM file (*.bam) is the compressed binary version of a SAM file. BAM files are binary
files, which mean they cannot be opened like text files; they are compressed and can be
sorted and/or indexed.
They consist of a header section and an alignment section. The header contains
information about the entire file, such as sample name and length. Alignments contain
the name, sequence, and quality of a read. Alignment information and custom tags can also
be found in the alignment section.
The following table shows the information for each read or read pair depicted in the
alignment section:
RG
Read group, which indicates the number of reads for a specific sample
BC
Barcode tag, indicating the read-associated demultiplexed sample ID
SM
Single-end alignment quality
AS
Paired-end alignment quality
NM
Edit distance tag, recording the Levenshtein distance between read and reference
XN
Amplicon name tag, recording the amplicon tile ID associated with the read
BAM files can also have a companion file, called an index file. This file has the same
name, suffixed with *.bai. The BAI file acts like an external table of contents, and allows
programs to jump directly to specific parts of the BAM file without reading through all of
the sequences. Without the corresponding BAM file, your BAI file is useless, since it does
not actually contain any sequence data.
Table 7.3 CIGAR string for error calculation (optional field: NM:i:<#>)
<#> Operator
CIGAR string description (<#> means number of)
<#>¼
<#> of matches
<#>X
<#> of mismatches
<#>D
<#>Deletions (gap in the sequencing read)
<#>I
<#>Insertions (gap in the reference sequence)
<#>N
<#> skipped region (gap in the sequencing read)
S
Soft clipping (clipped sequences present in SEQ)
H
Hard clipping (clipped sequences not present in SEQ)
86
M. Kappelmann-Fenzl
