Fastq file size after splitting bam
1
0
Entering edit mode
6.0 years ago
Gene_MMP8 ▴ 240

I have a bam file of roughly 75GB size. I wanted to check the read quality and so I split it using bedtools bamtofastq command.
bedtools bamtofastq -i t.bam -fq r1.fq -fq2 r2.fq
Now after checking the sizes of the fastq files, I found out that they are of 1.2GB size each. Isn't this unexpected? I was expecting larger file sizes. Where am I going wrong? Thanks!

software error sequencing • 2.4k views
ADD COMMENT
0
Entering edit mode

You don't need to convert the file. The BAM file includes the quality info.

Most common way to check quality is with FastQC and that will accept BAM files.

ADD REPLY
0
Entering edit mode

I wanted to realign my bam files with hg38 reference. Hence I am splitting

ADD REPLY
1
Entering edit mode

Can you try reformat.sh in=your.bam out1=R1.fq.gz out2=R2.fq.gz to see if you get files of the right size (from BBMap suite)? You could have a lot of secondary alignments etc and the fastq files you get may look much smaller since reads would be present more than once in your BAM file.

ADD REPLY
0
Entering edit mode

Thanks for your reply. I got fasta files after using samtools that were of proper sizes.(~108GB each). So those who encounter this problem please try to use samtools instead.

ADD REPLY
0
Entering edit mode
5.9 years ago
d-cameron ★ 2.9k

I was expecting larger file sizes. Where am I going wrong? Thanks!

This bedtools documentation has this to say about it:

When using this option, it is required that the BAM file is sorted/grouped by the read name. This keeps the resulting records in the two output FASTQ files in the same order. One can sort the BAM file by query name with samtools sort -n aln.bam aln.qsort.

It appears you did not follow the bedtools documentation and sort by queryname first.

ADD COMMENT

Login before adding your answer.

Traffic: 2176 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6