Skip to content

Commit

Permalink
assume kallisto on PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvpickering committed Sep 16, 2019
1 parent 70ccf96 commit 32c0dec
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions R/build_kallisto_index.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#' @param species The species. Default is \code{homo_sapiens}.
#' @param release ensembl release. Default is \code{94} (latest in release for AnnotationHub -
#' needs to match with \code{\link{build_ensdb}}).
#' @param kallisto_path path to kallisto executable. Find with \code{which kallisto} in terminal.
#' Default assumes miniconda based installation.
#'
#' @return NULL
#' @export
Expand All @@ -15,9 +13,9 @@
#' # build kallist index for humans
#' build_kallisto_index(indices_dir)
#'
build_kallisto_index <- function(species = 'homo_sapiens', release = '94', kallisto_path = '/home/ubuntu/miniconda/bin/kallisto') {
build_kallisto_index <- function(species = 'homo_sapiens', release = '94') {

kallisto_version <- get_pkg_version(kallisto_path)
kallisto_version <- get_pkg_version('kallisto')
indices_dir <- system.file(package = 'drugseqr.data')
indices_dir <- file.path(indices_dir, paste0('indices/kallisto_', kallisto_version))

Expand Down Expand Up @@ -46,7 +44,7 @@ build_kallisto_index <- function(species = 'homo_sapiens', release = '94', kalli
# build index
index_fname <- gsub('fa.gz$', paste0(ensembl_release, '_k31.idx'), ensembl_fasta)
index_fname <- tolower(index_fname)
tryCatch(system2(kallisto_path, args=c('index',
tryCatch(system2('kallisto', args=c('index',
'-i', index_fname,
ensembl_fasta)),
error = function(err) {err$message <- 'Is kallisto installed and on the PATH?'; stop(err)})
Expand Down

0 comments on commit 32c0dec

Please sign in to comment.