This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Downsampling fastq reads

Hi all,

Do you have recommendations which tool to use to randomly downsample a fastq file to a specified read number? Specifically I am working on shotgun metagenomic data.

Thanks Philipp

next-gen metagenomics

3 answers

seqtk sample or seqkit sample.

reformat.sh from BBMap suite. Following options are relevant.

reads=-1                Set to a positive number to only process this many INPUT reads (or pairs), then quit.
skipreads=-1            Skip (discard) this many INPUT reads before processing the rest.
samplerate=1            Randomly output only this fraction of reads; 1 means sampling is disabled.
sampleseed=-1           Set to a positive number to use that prng seed for sampling (allowing deterministic sampling).
samplereadstarget=0     (srt) Exact number of OUTPUT reads (or pairs) desired.
samplebasestarget=0     (sbt) Exact number of OUTPUT bases desired.

This tutorial shows in detail how to do it

Log in to answer this question.