-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
85 lines (56 loc) · 2.03 KB
/
README.Rmd
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
![](man/figures/balselr.png){width=40% height=40%}
## What is `balselr`?
Balancing selection with R allows you to run **NCD statistics** to detect **long-term balancing selection** in genomic datasets.
Original paper describing the NCD statistics: Bitarello, De Filippo, Teixeira, Schmidt, Kleinert, Meyer & Andrés (2018). Signatures of long-term balancing selection in human genomes. Genome biology and evolution, 10(3), 939-955. [Link](https://academic.oup.com/gbe/article/10/3/939/4938688)
## Installation
You can install the development version of balselr from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
library(devtools)
devtools::install_github("bitarellolab/balselr")
library(balselr)
```
## Example
This is a basic example which shows you how to read in a vcf file:
```{r, echo=T, eval=F}
read_vcf(x=system.file(package = "balselr", "example.vcf"))
```
This is an example which shows how to parse a vcf file and output an input file for `ncd1`:
```{r, echo=T, eval=F}
parse_vcf(
infile = system.file(package = "balselr", "example.vcf"),
n0 = 108,
type = "ncd1"
)
```
This is an example which shows how to parse a vcf file and output an input file for `ncd2`:
```{r, echo=T, eval=F}
parse_vcf(
infile = system.file(package = "balselr", "example.vcf"),
n0 = 108,
n1 = 2,
type = "ncd2"
)
```
Run `ncd1 (tf=0.5)` with a 3000 basepair window and a minimum of 8 informative sites per window using 2 cores:
```{r, echo=T, eval=F}
data(ncd1_input)
ncd1(x=ncd1_input, tf=0.5, w=3000, ncores=2, minIS=8)
```
Run `ncd2 (tf=0.5)` with a 3000 basepair window and a minimum of 2 informative sites per window using 2 cores:
```{r, echo=T, eval=F}
data(ncd2_input)
ncd2(x=ncd2_input, tf=0.5, w=3000, ncores=2, minIS=2)
```