subset of paired end reads from bam file or fastq file of different depth
1
0
Entering edit mode
6 months ago
rthapa ▴ 50

Hi,

I want to subsample the reads of different depth from a bam file. For eg. 10X, 20X, 30X and so on. I tried with ShortRead R package but I can input only certain number of reads. I couldn't know how depth I am subsampling. Does any one have suggestion on how to subsample paired end reads of desired depth from fastq file or bam file?

Thanks

0
Entering edit mode
6 months ago

get the mean depth of coverage using , for example, mosdepth and then subsample the bam using the option -s <float> of samtools view

0
Entering edit mode

Thank you. Do we need to specify anything for the paired end reads? The bam file is after mapping the paired end reads.