R/build_indexes.R

#' Build Index for Bowtie Mapper
build_bowtie_indexes <- function(opt) {
  # Creating INDEXES -
  if (!isTRUE(opt$nofilter)) {
    # Check if bowtie index exists for the reference genome (ref)
    if (!fs::file_exists(paste0(opt$ref, ".rev.1.ebwt"))) {
      message("[BUILDING INDEX FOR REFERENCE GENOME]\n")
      fc("bowtie-build ", opt$ref, " ", opt$ref, " ")
    }
    ## Check if bowtie index exists for the bacterial genomes
    #  $bowtie_index_bacterial = "$bacterial_genomes_file".".rev.2.ebwtl";
    if (!fs::file_exists(paste0(opt$bact, ".rev.1.ebwtl"))) {
      message("[BUILDING INDEX FOR BACTERIAL GENOMES]\n")
      fc("bowtie-build", opt$bact, " ", opt$bact, " ")
    }
  }
}
luciorq/five documentation built on May 21, 2019, 2:30 a.m.