---
title: "R Notebook"
output: html_notebook
---

```{r}
library(genotype)
```


```{r}
n.sim = 10000

homogenotypes = rep('A')
```

# Impacte de la profondeur de séquençage

```{r}
p.hetero = 1/1000
error.rate = 1/100
merror = error_jc(rate = error.rate)
couvertures =1:50
```

```{r}
success.homo = numeric(length = length(couvertures))
i = 0
for (c in couvertures) {
  s = simulate_sites(rep('A',n.sim),
                     rep('A',n.sim),
                     coverage = c,
                     error = merror)
  g = genotyping(s,sequencing.error = error.rate,phetero = p.hetero)
  i = i+1
  success.homo[i] = sum(g$ok) 
}
```
