https://github.com/gtonkinhill/rhierbaps
rhierbaps: R implementation of hierBAPS
https://github.com/gtonkinhill/rhierbaps
population-genetics population-genomics population-structure r
Last synced: 8 months ago
JSON representation
rhierbaps: R implementation of hierBAPS
- Host: GitHub
- URL: https://github.com/gtonkinhill/rhierbaps
- Owner: gtonkinhill
- License: other
- Created: 2017-11-24T14:22:47.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-05-02T06:15:41.000Z (about 5 years ago)
- Last Synced: 2025-09-08T13:38:28.455Z (9 months ago)
- Topics: population-genetics, population-genomics, population-structure, r
- Language: R
- Homepage:
- Size: 1.63 MB
- Stars: 35
- Watchers: 4
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
bibliography: vignettes/bibliography.bib
output:
github_document
---
```{r, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "inst/vignette-supp/",
echo=TRUE,
warning=FALSE,
message=FALSE,
tidy=TRUE
)
```
[](https://github.com/gtonkinhill/rhierbaps/actions)
# rhierbaps
We have recently developed a faster verion of the BAPs clustering method. It can be found [here](https://github.com/gtonkinhill/fastbaps).
## Installation
`rhierbaps` is available on CRAN.
```{r, eval=FALSE}
install.packages("rhierbaps")
```
The development version is available on github. It can be installed with `devtools`
```{r, eval = FALSE}
install.packages("devtools")
devtools::install_github("gtonkinhill/rhierbaps")
```
If you would like to also build the vignette with your installation run:
```{r, eval=FALSE}
devtools::install_github("gtonkinhill/rhierbaps", build_vignettes = TRUE)
```
## Quick Start
Run hierBAPS.
```{r, fig.width =8, fig.height=6, fig.align='center'}
# install.packages("rhierbaps")
library(rhierbaps)
fasta.file.name <- system.file("extdata", "seqs.fa", package = "rhierbaps")
snp.matrix <- load_fasta(fasta.file.name)
hb.results <- hierBAPS(snp.matrix, max.depth=2, n.pops=20, quiet = TRUE)
head(hb.results$partition.df)
```
```{r, echo = FALSE}
intro_rmd <- 'vignettes/introduction.Rmd'
raw_rmd <- readLines(intro_rmd)
# remove yaml
yaml_lines <- grep("---", raw_rmd)
# remove appendix (session info)
appendix <- grep("Session", raw_rmd)
compressed_rmd <- raw_rmd[c(-seq(yaml_lines[1], yaml_lines[2], by = 1),
-seq(appendix, length(raw_rmd)))]
writeLines(compressed_rmd, "child.Rmd")
```
```{r, child = 'child.Rmd'}
```
```{r cleanup, echo=FALSE, include=FALSE}
if (file.exists("child.Rmd")) {
file.remove("child.Rmd")
}
```