changeset 12:f5b1f7d4db53 draft

planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit 6df7b8ef3a603f7792ed5815ff324ede8a7b2b0b-dirty
author mingchen0919
date Mon, 25 Sep 2017 16:10:27 -0400
parents e2a0bc241b56
children ff1cb127967e
files collection_list.Rmd
diffstat 1 files changed, 24 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/collection_list.Rmd	Mon Sep 25 15:52:44 2017 -0400
+++ b/collection_list.Rmd	Mon Sep 25 16:10:27 2017 -0400
@@ -21,9 +21,29 @@
 ```
 
 
-```{r}
-from_files = strsplit("FILE_LIST", ',')[[1]]
-to_files = gsub('\\.dat', '\\.fastqsanger', from_files)
-file.copy(from_files, to_files)
+```{bash 'copy data to working directory'}
+mkdir files_directory
+# Copy uploaded data to the working directory
+for f in $(echo FILE_LIST | sed "s/,/ /g")
+do
+    sed "s/.dat/"
+    cp $f ./files_directory
+done
 ```
 
+```{r}
+# create directory
+dir.create('./files_directory')
+# get full paths of original files
+from_files = strsplit("FILE_LIST", ',')[[1]]
+# copy files to the created directory.
+file.copy(from_files, './files_directory')
+# get original file names
+original_files = list.files('./files_directory')
+# create new files names from original file names
+new_files = gsub('\\.dat', '\\.fastqsanger', original_files)
+# rename files
+file.copy(paste0('./files_directory/', original_files),
+          paste0('./files_directory/', new_files))
+```
+