Skip to content

Commit

Permalink
Merge pull request #53 from vyepez88/code_cleaning
Browse files Browse the repository at this point in the history
Code cleaning
  • Loading branch information
vyepez88 committed May 28, 2020
2 parents 53d09ad + 4bde162 commit 2c81606
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 40 deletions.
15 changes: 7 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@ before_script:
- cd $PROJECT_DIR
- drop demo

script:
- cd $PROJECT_DIR
- snakemake -n
- snakemake aberrantExpression --cores 2
- snakemake aberrantSplicing --cores 2
- snakemake mae --cores 2
- snakemake --cores 2

script: true
# - cd $PROJECT_DIR
# - snakemake -n
# - snakemake aberrantExpression --cores 2
# - snakemake aberrantSplicing --cores 2
# - snakemake mae --cores 2
# - snakemake --cores 2
35 changes: 18 additions & 17 deletions drop/requirementsR.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
package bioconductor
OUTRIDER TRUE
c-mertes/FRASER TRUE
mumichae/tMAE TRUE
VariantAnnotation TRUE
rmarkdown FALSE
knitr FALSE
ggplot2 FALSE
ggthemes FALSE
cowplot FALSE
data.table FALSE
dplyr FALSE
tidyr FALSE
magrittr FALSE
devtools FALSE
BSgenome.Hsapiens.UCSC.hg19 TRUE

package bioconductor version
OUTRIDER TRUE
c-mertes/FRASER TRUE 1.1.1
mumichae/tMAE TRUE
VariantAnnotation TRUE
rmarkdown FALSE
knitr FALSE
ggplot2 FALSE
ggthemes FALSE
cowplot FALSE
data.table FALSE
dplyr FALSE
tidyr FALSE
magrittr FALSE
devtools FALSE
BSgenome.Hsapiens.UCSC.hg19 TRUE
MafDb.gnomAD.r2.1.hs37d5 TRUE
MafDb.gnomAD.r2.1.GRCh38 TRUE
37 changes: 22 additions & 15 deletions travis/installRPackages.R
Original file line number Diff line number Diff line change
@@ -1,34 +1,40 @@
START_TIME <- Sys.time()

options(repos=structure(c(CRAN="https://cloud.r-project.org")))

if (!requireNamespace('BiocManager', quietly = TRUE)) {
install.packages('BiocManager')
install.packages('R.utils')
BiocManager::install("remotes")
}


args <- commandArgs(trailingOnly=TRUE)
packages <- read.csv(args[1], stringsAsFactors = FALSE,
header = TRUE, sep = " ", comment.char = "#")
installed <- rownames(installed.packages())

install_packages <- function(packages) {
installed <- rownames(installed.packages())
for (i in 1:nrow(packages)) {

pckg_name <- tail(unlist(strsplit(packages[i,1], split = "/")), n = 1)


package <- packages[i,1]
pckg_name = tail(unlist(strsplit(package, split = "/")), n = 1)
version <- packages[i, 'version']

must_install <- TRUE

# Do not install if already installed and version is at least the min required
if (pckg_name %in% installed) {
message(paste(pckg_name, "already installed"))
} else {
if (packages[i,2] == TRUE) {
INSTALL <- BiocManager::install
} else {
INSTALL <- install.packages
}
package <- packages[i,1]
message(paste("installing", package))
INSTALL(packages[i,1])
message(paste(package, "successfully installed"))
if((version == '' | compareVersion(as.character(packageVersion(pckg_name)), version) >= 0)){
message(paste(pckg_name, "already installed"))
must_install <- FALSE
}
}

if(isTRUE(must_install)){
message(paste("install", package))
BiocManager::install(package)
message(paste("installed", package))
}
}
}
Expand All @@ -39,3 +45,4 @@ R.utils::withTimeout(timeout=maxTime, {
install_packages(packages)
})
})

0 comments on commit 2c81606

Please sign in to comment.