# NOT RUN {
# Using BLAST result files in this package...
prefix <- c("GID1_vs_GID1_",
"GID2_vs_GID1_",
"GID3_vs_GID1_",
"GID2_vs_GID2_",
"GID3_vs_GID2_",
"GID3_vs_GID3_")
bf <- file.path(path.package("micropan"), "extdata", str_c(prefix, ".txt.xz"))
# We need to uncompress them first...
blast.files <- tempfile(pattern = prefix, fileext = ".txt.xz")
ok <- file.copy(from = bf, to = blast.files)
blast.files <- unlist(lapply(blast.files, xzuncompress))
# Computing pairwise distances
blast.dist <- bDist(blast.files)
# Read files separately, then use bDist
self.tbl <- readBlastSelf(blast.files)
pair.tbl <- readBlastPair(blast.files)
blast.dist <- bDist(blast.tbl = bind_rows(self.tbl, pair.tbl))
# ...and cleaning...
ok <- file.remove(blast.files)
# See also example for blastpAl
# }
Run the code above in your browser using DataLab