<p>A BAM file should have a roughly similar size to a compressed FASTQ file, because they're both compressed files that contain similar information. BAM will be slightly larger, because it contains information about mapping and differences from the reference.</p>

<p>If you are concerned about space and have a reference sequence available, you can store mapped reads as CRAM format, which will save a lot more space.</p>

CC BY-SA 3.0
2017-11-25T14:20:19.890Z
Could also be smaller if you remove duplicate reads. I doubt it will ever be *significantly* different in size from the original fastq file, but a +/- a few hundred megabytes (more for larger files) or so is to be expected.
terdon
CC BY-SA 4.0
2019-02-04T14:26:49.393Z
A *sorted* BAM will be (potentially substantially) *smaller* than an equivalent FASTQ file, even when containing mapping information.
Konrad Rudolph
CC BY-SA 3.0
2017-11-25T01:42:16.123Z
2017-11-25T01:42:16.123Z
gringer
<p>Is there a way to estimate the size of a BAM file will have after mapping with BWA?</p>

<p>The input file are two mates fastq files, compressed with gzip, each one about 70G.</p>

<sam><fastq><bwa>
Estimating BAM file from compressed fastq file size
# Estimating BAM file from compressed fastq file size

(Asked by: username_0 on 2017-11-24)

Is there a way to estimate the size of a BAM file will have after mapping with BWA?

The input file are two mates fastq files, compressed with gzip, each one about 70G.

**Tags:** sam, fastq, bwa

---

## 1 answers

### Answer by username_1 on 2017-11-25. Score: 4 | Accepted answer

A BAM file should have a roughly similar size to a compressed FASTQ file, because they're both compressed files that contain similar information. BAM will be slightly larger, because it contains information about mapping and differences from the reference.

If you are concerned about space and have a reference sequence available, you can store mapped reads as CRAM format, which will save a lot more space.

> **Comments:**
> **username_2**: Could also be smaller if you remove duplicate reads. I doubt it will ever be *significantly* different in size from the original fastq file, but a +/- a few hundred megabytes (more for larger files) or so is to be expected.  
> **username_3**: A *sorted* BAM will be (potentially substantially) *smaller* than an equivalent FASTQ file, even when containing mapping information.  

---

