Note: the most recent version of this vignette can be found here and a short overview slide show here.

Note: if you use systemPipeR and systemPipeRdata in published research, please cite:

Backman, T.W.H and Girke, T. (2016). systemPipeR: NGS Workflow and Report Generation Environment. BMC Bioinformatics, 17: 388. 10.1186/s12859-016-1241-0.

1 Introduction

systemPipeRdata is a helper package to generate with a single command NGS workflow templates that are intended to be used by its parent package systemPipeR (H Backman and Girke 2016). The latter is an environment for building end-to-end analysis pipelines with automated report generation for next generation sequence (NGS) applications such as RNA-Seq, Ribo-Seq, ChIP-Seq, VAR-Seq and many others. The directory structure of the workflow templates and the sample data used by systemPipeRdata are described here.

2 Getting Started

2.1 Installation

The R software for using systemPipeRdata can be downloaded from CRAN. The systemPipeRdata package can be installed from within R as follows:

if (!requireNamespace("BiocManager", quietly = TRUE)) install.packages("BiocManager")
BiocManager::install("systemPipeRdata")  # Installs from Bioconductor once
# available there
BiocManager::install("tgirke/systemPipeR", build_vignettes = TRUE, 
    dependencies = TRUE)  # Installs from github

2.2 Loading package and documentation

library("systemPipeRdata")  # Loads the package
library(help = "systemPipeRdata")  # Lists package info
vignette("systemPipeRdata")  # Opens vignette

2.3 Generate workflow template

Load one of the available NGS workflows into your current working directory. The following does this for the varseq template. The name of the resulting workflow directory can be specified under the mydirname argument. The default NULL uses the name of the chosen workflow. An error is issued if a directory of the same name and path exists already. Besides, it is possible to choose different version of the workflow template. Please check the available options here, or provide the download URL to your template. The URL can be specified under url argument and the file name in the urlname argument. The default NULL copies the current version available in the systemPipeRdata.

genWorkenvir(workflow = "varseq", mydirname = NULL, url = NULL, 
    urlname = NULL)
setwd("varseq")

On Linux and OS X systems the same can be achieved from the command-line of a terminal with the following commands.

$ Rscript -e "systemPipeRdata::genWorkenvir(workflow='varseq', mydirname=NULL, url=NULL, urlname=NULL)"

2.3.1 Directory Structure

The workflow templates generated by genWorkenvir contain the following preconfigured directory structure:

  • workflow/ (e.g. rnaseq/)
    • This is the root directory of the R session running the workflow.
    • Run script ( *.Rmd) and sample annotation (targets.txt) files are located here.
    • Note, this directory can have any name (e.g. rnaseq, varseq). Changing its name does not require any modifications in the run script(s).
    • Important subdirectories:
      • param/
        • Stores non-CWL parameter files such as: *.param, *.tmpl and *.run.sh. These files are only required for backwards compatibility to run old workflows using the previous custom command-line interface.
        • param/cwl/: This subdirectory stores all the CWL parameter files. To organize workflows, each can have its own subdirectory, where all CWL param and input.yml files need to be in the same subdirectory.
      • data/
        • FASTQ files
        • FASTA file of reference (e.g. reference genome)
        • Annotation files
        • etc.
      • results/
        • Analysis results are usually written to this directory, including: alignment, variant and peak files (BAM, VCF, BED); tabular result files; and image/plot files
        • Note, the user has the option to organize results files for a given sample and analysis step in a separate subdirectory.

Note: Directory names are indicated in green. Users can change this structure as needed, but need to adjust the code in their workflows accordingly.

Figure 1: systemPipeR’s preconfigured directory structure.

2.4 Run workflows

Next, run from within R the chosen sample workflow by executing the code provided in the corresponding *.Rmd template file. If preferred the corresponding *.Rnw or *.R versions can be used instead. Alternatively, one can run an entire workflow from start to finish with a single command by executing from the command-line 'make -B' within the workflow directory (here 'varseq'). Much more detailed information on running and customizing systemPipeR workflows is available in its overview vignette here. This vignette can also be opened from R with the following command.

library("systemPipeR")  # Loads systemPipeR which needs to be installed via BiocManager::install() from Bioconductor
vignette("systemPipeR", package = "systemPipeR")

2.5 Return paths to sample data

The location of the sample data provided by systemPipeRdata can be returned as a list.

pathList()
## $targets
## [1] "/tmp/Rtmp92goTm/Rinst3f263e23cfcf/systemPipeRdata/extdata/param/targets.txt"
## 
## $targetsPE
## [1] "/tmp/Rtmp92goTm/Rinst3f263e23cfcf/systemPipeRdata/extdata/param/targetsPE.txt"
## 
## $annotationdir
## [1] "/tmp/Rtmp92goTm/Rinst3f263e23cfcf/systemPipeRdata/extdata/annotation/"
## 
## $fastqdir
## [1] "/tmp/Rtmp92goTm/Rinst3f263e23cfcf/systemPipeRdata/extdata/fastq/"
## 
## $bamdir
## [1] "/tmp/Rtmp92goTm/Rinst3f263e23cfcf/systemPipeRdata/extdata/bam/"
## 
## $paramdir
## [1] "/tmp/Rtmp92goTm/Rinst3f263e23cfcf/systemPipeRdata/extdata/param/"
## 
## $workflows
## [1] "/tmp/Rtmp92goTm/Rinst3f263e23cfcf/systemPipeRdata/extdata/workflows/"
## 
## $chipseq
## [1] "/tmp/Rtmp92goTm/Rinst3f263e23cfcf/systemPipeRdata/extdata/workflows/chipseq/"
## 
## $rnaseq
## [1] "/tmp/Rtmp92goTm/Rinst3f263e23cfcf/systemPipeRdata/extdata/workflows/rnaseq/"
## 
## $riboseq
## [1] "/tmp/Rtmp92goTm/Rinst3f263e23cfcf/systemPipeRdata/extdata/workflows/riboseq/"
## 
## $varseq
## [1] "/tmp/Rtmp92goTm/Rinst3f263e23cfcf/systemPipeRdata/extdata/workflows/varseq/"

3 Version information

sessionInfo()
## R version 3.6.1 (2019-07-05)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 18.04.3 LTS
## 
## Matrix products: default
## BLAS:   /home/biocbuild/bbs-3.10-bioc/R/lib/libRblas.so
## LAPACK: /home/biocbuild/bbs-3.10-bioc/R/lib/libRlapack.so
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=C              
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] stats4    parallel  stats     graphics  grDevices
## [6] utils     datasets  methods   base     
## 
## other attached packages:
##  [1] systemPipeRdata_1.14.2      batchtools_0.9.11          
##  [3] data.table_1.12.6           ape_5.3                    
##  [5] ggplot2_3.2.1               systemPipeR_1.20.0         
##  [7] ShortRead_1.44.0            GenomicAlignments_1.22.1   
##  [9] SummarizedExperiment_1.16.0 DelayedArray_0.12.0        
## [11] matrixStats_0.55.0          Biobase_2.46.0             
## [13] BiocParallel_1.20.0         Rsamtools_2.2.1            
## [15] Biostrings_2.54.0           XVector_0.26.0             
## [17] GenomicRanges_1.38.0        GenomeInfoDb_1.22.0        
## [19] IRanges_2.20.1              S4Vectors_0.24.0           
## [21] BiocGenerics_0.32.0         BiocStyle_2.14.0           
## 
## loaded via a namespace (and not attached):
##  [1] colorspace_1.4-1         rjson_0.2.20            
##  [3] hwriter_1.3.2            bit64_0.9-7             
##  [5] AnnotationDbi_1.48.0     codetools_0.2-16        
##  [7] splines_3.6.1            knitr_1.26              
##  [9] zeallot_0.1.0            annotate_1.64.0         
## [11] GO.db_3.10.0             dbplyr_1.4.2            
## [13] pheatmap_1.0.12          graph_1.64.0            
## [15] BiocManager_1.30.10      compiler_3.6.1          
## [17] httr_1.4.1               GOstats_2.52.0          
## [19] backports_1.1.5          assertthat_0.2.1        
## [21] Matrix_1.2-17            lazyeval_0.2.2          
## [23] limma_3.42.0             formatR_1.7             
## [25] htmltools_0.4.0          prettyunits_1.0.2       
## [27] tools_3.6.1              gtable_0.3.0            
## [29] glue_1.3.1               GenomeInfoDbData_1.2.2  
## [31] Category_2.52.1          dplyr_0.8.3             
## [33] rappdirs_0.3.1           Rcpp_1.0.3              
## [35] vctrs_0.2.0              debugme_1.1.0           
## [37] nlme_3.1-142             rtracklayer_1.46.0      
## [39] xfun_0.11                stringr_1.4.0           
## [41] lifecycle_0.1.0          XML_3.98-1.20           
## [43] edgeR_3.28.0             zlibbioc_1.32.0         
## [45] scales_1.1.0             BSgenome_1.54.0         
## [47] VariantAnnotation_1.32.0 hms_0.5.2               
## [49] RBGL_1.62.1              RColorBrewer_1.1-2      
## [51] yaml_2.2.0               curl_4.2                
## [53] memoise_1.1.0            biomaRt_2.42.0          
## [55] latticeExtra_0.6-28      stringi_1.4.3           
## [57] RSQLite_2.1.2            genefilter_1.68.0       
## [59] checkmate_1.9.4          GenomicFeatures_1.38.0  
## [61] rlang_0.4.2              pkgconfig_2.0.3         
## [63] bitops_1.0-6             evaluate_0.14           
## [65] lattice_0.20-38          purrr_0.3.3             
## [67] bit_1.1-14               tidyselect_0.2.5        
## [69] GSEABase_1.48.0          AnnotationForge_1.28.0  
## [71] magrittr_1.5             bookdown_0.16           
## [73] R6_2.4.1                 base64url_1.4           
## [75] DBI_1.0.0                pillar_1.4.2            
## [77] withr_2.1.2              survival_3.1-7          
## [79] RCurl_1.95-4.12          tibble_2.1.3            
## [81] crayon_1.3.4             BiocFileCache_1.10.2    
## [83] rmarkdown_1.17           progress_1.2.2          
## [85] locfit_1.5-9.1           grid_3.6.1              
## [87] blob_1.2.0               Rgraphviz_2.30.0        
## [89] digest_0.6.23            xtable_1.8-4            
## [91] brew_1.0-6               openssl_1.4.1           
## [93] munsell_0.5.0            askpass_1.1

4 Funding

This project was supported by funds from the National Institutes of Health (NIH) and the National Science Foundation (NSF).

References

H Backman, Tyler W, and Thomas Girke. 2016. “systemPipeR: NGS workflow and report generation environment.” BMC Bioinformatics 17 (1):388. https://doi.org/10.1186/s12859-016-1241-0.