Skip to content

Commit

Permalink
Merge pull request tgirke#14 from systemPipeR/master
Browse files Browse the repository at this point in the history
3 new workflows
  • Loading branch information
tgirke committed Aug 21, 2023
2 parents 8fa1d78 + ec5428c commit 049d490
Show file tree
Hide file tree
Showing 93 changed files with 12,777 additions and 1,131 deletions.
22 changes: 22 additions & 0 deletions ..Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Version: 1.0

RestoreWorkspace: No
SaveWorkspace: No
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 4
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

AutoAppendNewline: Yes
StripTrailingWhitespace: Yes

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageCheckArgs: --no-build-vignettes --no-tests
PackageRoxygenize: rd,collate,namespace
2 changes: 1 addition & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
^\.github
^docs
vignettes/*_cache

^\.Rhistory
^.*\.Rproj$
^\.Rproj\.user$
Binary file modified .github/depends.Rds
Binary file not shown.
2 changes: 1 addition & 1 deletion .github/ref_vignette/vignette_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
vignette_version: 1.0.15
vignette_version: 1.0.17
8 changes: 4 additions & 4 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ jobs:
fail-fast: false
matrix:
config:
- {os: ubuntu-20.04, r: '4.1.3', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-20.04, r: '4.2.2', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.SPR_DATA }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@master
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
- uses: r-lib/actions/setup-pandoc@master
- uses: r-lib/actions/setup-pandoc@v2
- name: Query dependencies
run: |
install.packages('remotes')
Expand All @@ -53,7 +53,7 @@ jobs:
remotes::install_cran("rcmdcheck")
install.packages(c("BiocManager", "knitcitations"))
BiocManager::install("BiocStyle")
BiocManager::install("lz100/systemPipeR")
BiocManager::install("tgirke/systemPipeR")
shell: Rscript {0}
## Update the workflows temapltes...
- name: update version number
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@ docs/articles/systemPipeRIBOseq_files/*
docs/articles/systemPipeRNAseq_files/*
docs/articles/systemPipeRdata_files/*
docs/articles/systemPipeVARseq_files/*

*.Rproj
.Rproj.user
.Rhistory
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: systemPipeRdata
Title: systemPipeRdata: Workflow templates and sample data
Version: 2.1.2
Date: 2022-10-23
Date: 2023-08-14
Author: Thomas Girke
Maintainer: Thomas Girke <[email protected]>
biocViews: Genetics, Infrastructure, DataImport, Sequencing, RNASeq,
Expand Down
62 changes: 13 additions & 49 deletions R/dataenv.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,9 @@ pathList <- function() {
annotationdir=system.file("extdata/annotation", "", package="systemPipeRdata", mustWork=TRUE),
fastqdir=system.file("extdata/fastq", "", package="systemPipeRdata", mustWork=TRUE),
bamdir=system.file("extdata/bam", "", package="systemPipeRdata", mustWork=TRUE),
paramdir=system.file("extdata/param", "", package="systemPipeRdata", mustWork=TRUE),
workflows=system.file("extdata/workflows", "", package="systemPipeRdata", mustWork=TRUE),
chipseq=system.file("extdata/workflows/chipseq", "", package="systemPipeRdata", mustWork=TRUE),
rnaseq=system.file("extdata/workflows/rnaseq", "", package="systemPipeRdata", mustWork=TRUE),
riboseq=system.file("extdata/workflows/riboseq", "", package="systemPipeRdata", mustWork=TRUE),
varseq=system.file("extdata/workflows/varseq", "", package="systemPipeRdata", mustWork=TRUE),
new=system.file("extdata/workflows/new", "", package="systemPipeRdata", mustWork=TRUE)
paramdir=system.file("extdata/param", "", package="systemPipeRdata", mustWork=TRUE)
)
}

#########################################
## Generate environments for workflows ##
#########################################
Expand All @@ -29,12 +22,11 @@ genWorkenvir <- function(workflow, mydirname=NULL, bam=FALSE, ref="master", subd
genWorkdata(path = mydirname2)
} else {
check_workflow <- dir(system.file("extdata/workflows", "", package="systemPipeRdata", mustWork=TRUE))
if(!workflow %in% check_workflow) stop("workflow can only be assigned one of: ", paste(check_workflow, collapse=", "))
workflow <- match.arg(workflow, check_workflow)
if(workflow=="new" && is.null(mydirname)) warning("It is recommended to specify the workflow directory name, using 'mydirname' argument")
if(all(!c(is.null(mydirname), is.character(mydirname)))) stop("mydirname can only be assigned 'NULL' or a character vector of length 1")
## If 'mydirname' is NULL (default) use value assigned to 'workflow' as directory name
if(is.null(mydirname)) {
mydirname2 <- workflow
mydirname2 <- workflow
} else {
mydirname2 <- mydirname
}
Expand All @@ -43,37 +35,9 @@ genWorkenvir <- function(workflow, mydirname=NULL, bam=FALSE, ref="master", subd
if(dir.exists(mydirname2) | dir.exists(mydirname2temp)) stop("Directory name assigned to 'mydirname' or its temp variant exists already. Please assign to 'mydirname' a different name or rename/delete existing one.")
dir.create(mydirname2temp)
## Move workflow templates into workflow directory
if(workflow=="varseq") {
file.copy(pathList()$varseq, mydirname2temp, recursive=TRUE)
file.rename(paste0(normalizePath(mydirname2temp), "/", workflow), mydirname2) # generates final dir
unlink(mydirname2temp, recursive = TRUE) # removes temp dir
#file.copy(c(paste0(pathList()$paramdir, "gatk_run.sh"), paste0(pathList()$paramdir, "sambcf_run.sh")), paste0(mydirname2, "/"))
#file.copy(c(paste0(pathList()$paramdir, "Makefile_varseq")), paste0(mydirname2, "/Makefile"))
} else if(workflow=="rnaseq") {
file.copy(pathList()$rnaseq, mydirname2temp, recursive=TRUE)
file.rename(paste0(normalizePath(mydirname2temp), "/", workflow), mydirname2) # generates final dir
unlink(mydirname2temp, recursive=TRUE) # removes temp dir
#file.copy(c(paste0(pathList()$paramdir, "Makefile_rnaseq")), paste0(mydirname2, "/Makefile"))
} else if(workflow=="riboseq") {
file.copy(pathList()$riboseq, mydirname2temp, recursive=TRUE)
file.rename(paste0(normalizePath(mydirname2temp), "/", workflow), mydirname2) # generates final dir
unlink(mydirname2temp, recursive=TRUE) # removes temp dir
#file.copy(c(paste0(pathList()$paramdir, "Makefile_riboseq")), paste0(mydirname2, "/Makefile"))
# file.copy(c(paste0(pathList()$paramdir, "bibtex.bib")), paste0(mydirname2, "/bibtex.bib"), overwrite=TRUE)
} else if(workflow=="chipseq") {
file.copy(pathList()$chipseq, mydirname2temp, recursive=TRUE)
file.rename(paste0(normalizePath(mydirname2temp), "/", workflow), mydirname2) # generates final dir
unlink(mydirname2temp, recursive=TRUE) # removes temp dir
file.copy(c(paste0(pathList()$paramdir, "/targetsPE_chip.txt"), paste0(pathList()$paramdir, "/targets_chip.txt")), paste0(mydirname2, "/"))
#file.copy(c(paste0(pathList()$paramdir, "Makefile_chipseq")), paste0(mydirname2, "/Makefile"))
# file.copy(c(paste0(pathList()$paramdir, "bibtex.bib")), paste0(mydirname2, "/bibtex.bib"), overwrite=TRUE)
} else if(workflow=="new"){
file.copy(pathList()$new, mydirname2temp, recursive=TRUE)
file.rename(paste0(normalizePath(mydirname2temp), "/", workflow), mydirname2) # generates final dir
unlink(mydirname2temp, recursive=TRUE) # removes temp dir
} else {
stop("workflow can only be assigned one of:", paste(check_workflow, collapse=", "))
}
file.copy(system.file("extdata/workflows/", workflow, package="systemPipeRdata", mustWork=TRUE), mydirname2temp, recursive=TRUE)
file.rename(paste0(normalizePath(mydirname2temp), "/", workflow), mydirname2) # generates final dir
unlink(mydirname2temp, recursive=TRUE) # removes temp dir
## Moving data and param common files
file.copy(normalizePath(list.files(pathList()$fastqdir, "*", full.names=TRUE)), paste0(mydirname2, "/data"), overwrite=TRUE, recursive=TRUE)
file.copy(normalizePath(list.files(pathList()$annotationdir, "*", full.names=TRUE)), paste0(mydirname2, "/data"), overwrite=TRUE, recursive=TRUE)
Expand Down Expand Up @@ -124,9 +88,9 @@ genWorkdata <- function(path=getwd(), data=TRUE, param=TRUE){
############################################
## Generate environments for SPR_packages ##
############################################
# This function installs packages from GitHub. Internally, it is used remotes::install_github(), which also requires remotes to be installed.
# This function installs packages from GitHub. Internally, it is used remotes::install_github(), which also requires remotes to be installed.
## Arguments
# package_repo Repository Github address in the format `username/repo`.
# package_repo Repository Github address in the format `username/repo`.
# ref Desired GitHub reference for the `"branch"` name. Default to `"master"`.
# subdir subdirectory within GitHub repo that contains the R package.
# mydirname Specifies the name of the workflow directory and the *Rmd file. Default is NULL, using the workflow/package name.
Expand All @@ -143,7 +107,7 @@ genWorkdata <- function(path=getwd(), data=TRUE, param=TRUE){
pkg_req <- sapply(pkgs, function(x) !requireNamespace(x, quietly=TRUE))
## If 'mydirname' is NULL (default) use value assigned to 'pkg_name' as directory/*Rmd name
if(is.null(mydirname)) {
mydirname2 <- pkg_name
mydirname2 <- pkg_name
} else {
mydirname2 <- mydirname
}
Expand Down Expand Up @@ -183,8 +147,8 @@ genWorkdata <- function(path=getwd(), data=TRUE, param=TRUE){
############################################
## Check Workflow Templates Availability ##
############################################
# This function checks the workflow templates availability from systemPipeRdata package and
# also from GitHub.
# This function checks the workflow templates availability from systemPipeRdata package and
# also from GitHub.
## Arguments
# github if TRUE, it will return the available Workflow Templates packages from https://github.com/systemPipeR
## Note:
Expand All @@ -198,8 +162,8 @@ availableWF <- function(github = FALSE){
tryCatch(get_repos <- jsonlite::fromJSON("https://api.github.com/orgs/systemPipeR/repos"),
error = function(e){
stop('You have reached the limit for GitHub API requests. The limit is 60 requests per hour.')
}
)
}
)
WFrepos <- data.frame(workflow=get_repos$name, html=get_repos$html_url, description=get_repos$description)
## Keep repos with the right description
WFrepos <- WFrepos[WFrepos$description %in% "Workflow Template", ]
Expand Down
2 changes: 2 additions & 0 deletions inst/extdata/workflows/SPblast/.batchtools.conf.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cluster.functions <- makeClusterFunctionsSlurm(template="batchtools.slurm.tmpl")

Loading

0 comments on commit 049d490

Please sign in to comment.