Im looking for the best way to downsample nanopore long-reads. Ideally I would want to downsample to a specific average read depth e.g. 5x
I have found a few methods e.g. using samtools
but this seems to work for downsampling to a specific number or fraction of reads. Rasusa
downsamples to a specific coverage /depth but requires fastq input and I would prefer to downsample my BAM files so I don't have to re-run my alignment on many samples again.
You can use
reformat.sh
from BBMap suite. But this may not satisfy the "specific avg depth".Okay, thanks. Just double-checking this will work with long-reads?
Yes it should work with long read BAM's.