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

Hi everyone,

I have a mapping of PE reads to reference with a mean coverage of about 100 x. I need to sample (extract) reads across the alignment randomly to reduce coverage. Optimally but not necessarily, if there is heterozygote SNP, extract reads of both alleles.

Is there any way how to do it?

Thanks a lot in advance Milos

bam2fasta mapping extract_reads

1 answer

see samtools view -s

  -s FLOAT subsample reads (given INT.FRAC option value, 0.FRAC is the
           fraction of templates/read pairs to keep; INT part sets seed)

Thank you very much, Pierre!!! This is exactly what I need.

Log in to answer this question.