# DBT JRF 2022 — Question 131

Exam: DBT JRF 2022 · Section: B · Topic: Bioinformatics › NGS Data Formats - BAM vs SAM · Difficulty: Medium

## Question

During analysis of Next-Gen Sequencing data, what is the advantage of BAM files over SAM files?

## Options

- **A.** BAM files are human readable while SAM files are not.
- **B.** BAM files are larger than SAM files.
- **C.** BAM files are smaller than SAM files and hence easier to transfer.
- **D.** BAM files can hold more information than SAM files.

## Answer

Option C

## Explanation

BAM files vs. SAM files in NGS data analysis: SAM (Sequence Alignment/Map) vs BAM (Binary Alignment/Map): • SAM: plain TEXT format; human-readable; each line = one read alignment. • BAM: BINARY-compressed version of SAM; NOT human-readable. Key differences: • File size: BAM files are approximately 3–5 times SMALLER than equivalent SAM files. • Processing speed: BAM files are faster to read/write computationally. • Information content: IDENTICAL — BAM encodes exactly the same information as SAM, just in compressed binary format. • Indexing: BAM files can be indexed (.bai file) for rapid random access to specific genomic regions; SAM cannot be indexed this way. Tools: samtools, Picard, GATK all work natively with BAM; conversion: samtools view -b. BGZF compression: BAM uses blocked gzip format (BGZF) allowing random access while compressed. Answer: BAM files are binary-compressed SAM files; they are SMALLER (faster to transfer/store) but contain the same information.

Source: https://mypyqbuddy.com/questions/during-analysis-of-next-gen-sequencing-data-what-is-6a104cd5920734408bc0c792
