---
title: "TEST Workflow Template" 
author: "Author: Daniela Cassol (danielac@ucr.edu) and Thomas Girke (thomas.girke@ucr.edu)"
date: "Last update: `r format(Sys.time(), '%d %B, %Y')`" 
output:
  BiocStyle::html_document:
    toc_float: true
    code_folding: show
package: systemPipeR
vignette: |
  %\VignetteIndexEntry{WF: TEST Workflow Template}
  %\VignetteEncoding{UTF-8}
  %\VignetteEngine{knitr::rmarkdown}
fontsize: 14pt
bibliography: bibtex.bib
---

```{css, echo=FALSE}
pre code {
white-space: pre !important;
overflow-x: scroll !important;
word-break: keep-all !important;
word-wrap: initial !important;
}
```

```{r style, echo = FALSE, results = 'asis'}
BiocStyle::markdown()
options(width=60, max.print=1000)
knitr::opts_chunk$set(
    eval=as.logical(Sys.getenv("KNITR_EVAL", "TRUE")),
    cache=as.logical(Sys.getenv("KNITR_CACHE", "TRUE")), 
    tidy.opts=list(width.cutoff=60), tidy=TRUE)
```

# Introduction

This is a test template.

# Samples and environment settings

## Required packages and resources

The `systemPipeR` package needs to be loaded to perform the analysis steps shown in
this report [@H_Backman2016-bt].

```{r load_systempiper, eval=TRUE, message=FALSE, spr=TRUE}
appendStep(sal) <- LineWise(code={
  library(systemPipeR)
  },
  step_name = "load_systempiper", 
  dependency = NA)
```

# SYSargsList example

```{r quality, eval=TRUE, spr=TRUE}
targetspath <- system.file("extdata", "targetsPE.txt", package = "systemPipeR")
appendStep(sal) <- SYSargsList(step_name = "quality",
                               targets=targetspath, 
                   wf_file = "trimmomatic/workflow_trimmomatic-pe.cwl", 
                   input_file = "trimmomatic/trimmomatic-pe.yml",
                   dir_path=system.file("extdata/cwl", package = "systemPipeR"),
                   inputvars=c(FileName1="_FASTQ_PATH1_", FileName2="_FASTQ_PATH2_", SampleName="_SampleName_"))
```

```{r index, eval=TRUE, spr=TRUE}
appendStep(sal) <- SYSargsList(step_name = "index",
                               dir = FALSE,
                               targets=NULL, 
                               wf_file = "hisat2/workflow_hisat2-index.cwl",
                               input_file="hisat2/hisat2-index.yml",
                               dir_path=system.file("extdata/cwl", package = "systemPipeR"), 
                               dependency = "quality")
```

```{r Mapping, spr=TRUE, eval=TRUE}
appendStep(sal) <- SYSargsList(targets="quality",
                               dir=TRUE, 
                               wf_file = "workflow-hisat2/workflow_hisat2-pe.cwl",
                               input_file="workflow-hisat2/workflow_hisat2-pe.yml",
                               dir_path=system.file("extdata/cwl", package = "systemPipeR"),
                               inputvars=c(trimmomatic_1_paired="_FASTQ_PATH1_",
                                           trimmomatic_2_paired="_FASTQ_PATH2_", SampleName="_SampleName_"),
                               rm_targets_col = c("FileName1", "FileName2"),
                               dependency = c("quality", "index"))
```

# Version Information

```{r sessionInfo, spr=TRUE}
appendStep(sal) <- LineWise(code={
  sessionInfo()
  },
  step_name = "sessionInfo", 
  dependency = "Mapping")
```

# Funding

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

# References
