Skip to content

Commit

Permalink
issue 39 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DomBennett committed Jan 9, 2019
1 parent a98cc77 commit c7ed965
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/pipeline-tools.R
Expand Up @@ -77,7 +77,9 @@ blast_setup <- function(d, v, wd) {
# test version
stdout <- rawToChar(res[['stdout']])
stdout <- strsplit(x = stdout, split = '\n')[[1]]
vrsn <- gsub('[a-zA-Z:+]', '', stdout[[1]])
# remove contraction symbol create on windows(?), issue 39
stdout <- sub('~1:', '', stdout[[1]])
vrsn <- gsub('[a-zA-Z:+]', '', stdout)
vrsn <- gsub('\\s', '', vrsn)
write(x = paste0('Filepath: ', ech, ', version: ', vrsn, '\n'),
append = TRUE, file = file.path(wd, 'blast_versions.txt'))
Expand Down
17 changes: 17 additions & 0 deletions other/dev.R
@@ -1,5 +1,22 @@

cmd_path <- file.path('/usr/local/ncbi/blast/bin', 'makeblastdb')
res <- phylotaR:::cmdln(cmd = cmd_path, args = '-version')
# Is the status TRUE?
(res[['status']] == 0)
# What are the details?
stdout <- rawToChar(res[['stdout']])
(stdout <- strsplit(x = stdout, split = '\n')[[1]])
# Can we extract the version number?
vrsn <- gsub('[a-zA-Z:+]', '', stdout[[1]])
vrsn <- gsub('\\s', '', vrsn)
(vrsn <- as.numeric(strsplit(vrsn, '\\.')[[1]]))
# Version should be 2 +, expect TRUE
(vrsn[1] >= 2 & vrsn[2] >= 0)

cmd_path <- '/usr/local/ncbi/blast/bin'
phylotaR:::blast_setup(d = cmd_path, v = TRUE, wd = getwd())

stdout <- "MAKEBL~1: 2.7.1+\n Package: blast 2.7.1, build Oct 18 2017 19:55:35\n"


devtools::load_all('~/Coding/phylotaR_restez')
Expand Down

0 comments on commit c7ed965

Please sign in to comment.