Commit dfe3a8b1 authored by Swati Parekh's avatar Swati Parekh
Browse files

Adapted for the specific version of Rsubread

parent ac282112
Loading
Loading
Loading
Loading
+22 −1
Original line number Diff line number Diff line
@@ -40,10 +40,31 @@ opt = parse_args(opt_parser);

print("I am loading useful packages...")
print(Sys.time())
packages <-c("multidplyr","dplyr","tidyr","reshape2","data.table","optparse","parallel","Rsubread","methods","GenomicRanges","GenomicFeatures","GenomicAlignments","AnnotationDbi","ggplot2","cowplot","tibble")
packages <-c("multidplyr","dplyr","tidyr","reshape2","data.table","optparse","parallel","methods","GenomicRanges","GenomicFeatures","GenomicAlignments","AnnotationDbi","ggplot2","cowplot","tibble")
paks<-lapply(packages, function(x) suppressMessages(require(x, character.only = TRUE)))
rm(paks)

# Check the version of Rsubread
bla<-data.frame(installed.packages()[grep("Rsubread",installed.packages()),c("LibPath","Version")],row.names = NULL)

if(length(grep("Rsubread",installed.packages()))==0){
  print("I did not find Rsubread so I am installing it...")
  install.packages("https://bioarchive.galaxyproject.org/Rsubread_1.26.0.tar.gz", repos = NULL, type = "source")
  library("Rsubread", lib.loc=as.character(bla[bla$Version %in% "1.26.0", "LibPath"]))
  
}else{
  
  if(installed.packages()[grep("Rsubread",installed.packages()),"Version"] != "1.26.0"){
    print("I need Rsubread 1.26.0 so I am installing it...")
    install.packages("https://bioarchive.galaxyproject.org/Rsubread_1.26.0.tar.gz", repos = NULL, type = "source")
    library("Rsubread", lib.loc=as.character(bla[bla$Version %in% "1.26.0", "LibPath"]))
  }else{
    print("I am loading Rsubread 1.26.0...")
    library("Rsubread", lib.loc=as.character(bla[bla$Version %in% "1.26.0", "LibPath"]))
  }
  
}

ncores=opt$cores
bcstart=opt$bcstart
bcend=opt$bcend