---
layout: post
title: "How to find the best sampling depth for rarefaction (CC202)"
blurb: "This isn't an arbitrary process"
author: "PD Schloss"
date: 2022-04-07 11:00
comments: false
youtube: c7H8jLjTxSE
start_hash: 34387e1f203317d5071244728fe5ffe292688a3e
end_hash: 52a70390b74b5d3fd4dd9a214927ec1b1424d64f
---

One critique of rarefaction is that the sampling depth people pick is arbitrary. Is that true? In this Code Club, I'll show you my thought process for picking the best sampling depth to use for rarefying my data by rarefaction. Along the way we'll look at approaches to visualize the number of sequences per sample. We'll also see how to calculate Good's coverage to ascertain how well we have sampled our communities for a desired depth of sequencing.

<iframe style="margin: 0 auto;display:block;" width="560" height="315" src="https://www.youtube.com/embed/{{ page.youtube }}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>


## Code

You can browse the state of the repository at the
* [beginning of the episode](https://github.com/riffomonas/distances/tree/{{ page.start_hash }})
* [end of the episode](https://github.com/riffomonas/distances/tree/{{ page.end_hash }})
