Downsamplesamples


#1

I ran into a situation today (trying to output some representative HomRef genotypes so I could look at allele balance behavior for those calls) where the ability to downsample samples would have been nice. I did use the downsamplevariants function, too.


#2

Hey Kyle! You can do this now. Jon added a function in the expr language pcoin(p) which will give you a random flip of a coin with probability p.

This will keep 10% (approximately) of samples:

  vds.filter_samples_expr('pcoin(.1)')

#3

Cool! That’s useful. Thanks for the update.