simulations.Rmd 633 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
---
title: "R Notebook"
output: html_notebook
---

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


```{r}
n.sim = 10000

homogenotypes = rep('A')
```

# Impacte de la profondeur de squenage

```{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) 
}
```