knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "inst/vignette-supp/",
  echo=TRUE, 
  warning=FALSE, 
  message=FALSE,
  tidy=TRUE
)

R-CMD-check

rhierbaps

We have recently developed a faster verion of the BAPs clustering method. It can be found here.

Installation

rhierbaps is available on CRAN.

install.packages("rhierbaps")

The development version is available on github. It can be installed with devtools

install.packages("devtools")

devtools::install_github("gtonkinhill/rhierbaps")

If you would like to also build the vignette with your installation run:

devtools::install_github("gtonkinhill/rhierbaps", build_vignettes = TRUE)

Quick Start

Run hierBAPS.

# 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)
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")

if (file.exists("child.Rmd")) {
  file.remove("child.Rmd")
}


gtonkinhill/rhierbaps documentation built on May 3, 2021, 9:04 p.m.