view list_paired.Rmd @ 6:52ecc1cfd205 draft

planemo upload commit 979e0f1c28c74ca7df02ef20c2208e9677bc820a-dirty
author mingchen0919
date Mon, 02 Apr 2018 10:21:30 -0400
parents 4f9f1e76f7e6
children
line wrap: on
line source

---
title: 'Expose data (list:paired)'
output: html_document
---

<style>
pre code, pre, code {
  white-space: pre !important;
  overflow-x: scroll !important;
  word-break: keep-all !important;
  word-wrap: initial !important;
}
</style>

```{r setup, include=FALSE, warning=FALSE, message=FALSE}
knitr::opts_chunk$set(error = TRUE)
```

## User input

```{r, echo=FALSE, eval=TRUE}
##-------- build script files -----------

# build script file: script.sh
df = read.table(paste0(Sys.getenv('REPORT_FILES_PATH'), '/options_and_arguments.txt'), 
                sep = '|', header = TRUE)


knitr::kable(df)
```

```{r, echo=FALSE}
write('', file = paste0(Sys.getenv('REPORT_FILES_PATH'), '/script.sh'))
if (nrow(df) > 0) {
  for (i in 1:nrow(df)) {
    tool_output_dir = readLines(df[i, 'tool_output_dir'])[1]
    full_path = paste0(tool_output_dir, '/', df[i, 'relative_path'])
    # if it is a directory path, add '/*' to the end.
    if (dir.exists(full_path)) {
      full_path = paste0(full_path, '/*')
    }
    command_line = paste0('cp -r ', full_path, ' list_paired')
    write(command_line, append = TRUE, 
          file = paste0(Sys.getenv('REPORT_FILES_PATH'), '/script.sh'))
  }
}
```