annotate collection_list.Rmd @ 1:6be61cb4a1d5 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:19:52 -0400
parents 78018b735124
children cb6efa0f0cb6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
78018b735124 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit ec13349788ea42e106b5ba3fc1a5095ed755e644-dirty
mingchen0919
parents:
diff changeset
1 ---
78018b735124 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit ec13349788ea42e106b5ba3fc1a5095ed755e644-dirty
mingchen0919
parents:
diff changeset
2 title: 'Collection builder (collection type: list)'
78018b735124 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit ec13349788ea42e106b5ba3fc1a5095ed755e644-dirty
mingchen0919
parents:
diff changeset
3 output:
78018b735124 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit ec13349788ea42e106b5ba3fc1a5095ed755e644-dirty
mingchen0919
parents:
diff changeset
4 html_document:
78018b735124 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit ec13349788ea42e106b5ba3fc1a5095ed755e644-dirty
mingchen0919
parents:
diff changeset
5 number_sections: true
78018b735124 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit ec13349788ea42e106b5ba3fc1a5095ed755e644-dirty
mingchen0919
parents:
diff changeset
6 toc: true
78018b735124 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit ec13349788ea42e106b5ba3fc1a5095ed755e644-dirty
mingchen0919
parents:
diff changeset
7 theme: cosmo
78018b735124 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit ec13349788ea42e106b5ba3fc1a5095ed755e644-dirty
mingchen0919
parents:
diff changeset
8 highlight: tango
78018b735124 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit ec13349788ea42e106b5ba3fc1a5095ed755e644-dirty
mingchen0919
parents:
diff changeset
9 ---
78018b735124 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit ec13349788ea42e106b5ba3fc1a5095ed755e644-dirty
mingchen0919
parents:
diff changeset
10
78018b735124 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit ec13349788ea42e106b5ba3fc1a5095ed755e644-dirty
mingchen0919
parents:
diff changeset
11 ```{r setup, include=FALSE, warning=FALSE, message=FALSE}
78018b735124 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit ec13349788ea42e106b5ba3fc1a5095ed755e644-dirty
mingchen0919
parents:
diff changeset
12 knitr::opts_chunk$set(
78018b735124 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit ec13349788ea42e106b5ba3fc1a5095ed755e644-dirty
mingchen0919
parents:
diff changeset
13 echo = ECHO
78018b735124 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit ec13349788ea42e106b5ba3fc1a5095ed755e644-dirty
mingchen0919
parents:
diff changeset
14 )
78018b735124 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit ec13349788ea42e106b5ba3fc1a5095ed755e644-dirty
mingchen0919
parents:
diff changeset
15 ```
78018b735124 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit ec13349788ea42e106b5ba3fc1a5095ed755e644-dirty
mingchen0919
parents:
diff changeset
16
1
6be61cb4a1d5 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit 6df7b8ef3a603f7792ed5815ff324ede8a7b2b0b-dirty
mingchen0919
parents: 0
diff changeset
17 # Command line arguments
6be61cb4a1d5 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit 6df7b8ef3a603f7792ed5815ff324ede8a7b2b0b-dirty
mingchen0919
parents: 0
diff changeset
18
6be61cb4a1d5 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit 6df7b8ef3a603f7792ed5815ff324ede8a7b2b0b-dirty
mingchen0919
parents: 0
diff changeset
19 ```{r 'command line arguments'}
0
78018b735124 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit ec13349788ea42e106b5ba3fc1a5095ed755e644-dirty
mingchen0919
parents:
diff changeset
20 str(opt)
78018b735124 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit ec13349788ea42e106b5ba3fc1a5095ed755e644-dirty
mingchen0919
parents:
diff changeset
21 ```
78018b735124 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit ec13349788ea42e106b5ba3fc1a5095ed755e644-dirty
mingchen0919
parents:
diff changeset
22
78018b735124 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit ec13349788ea42e106b5ba3fc1a5095ed755e644-dirty
mingchen0919
parents:
diff changeset
23
1
6be61cb4a1d5 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit 6df7b8ef3a603f7792ed5815ff324ede8a7b2b0b-dirty
mingchen0919
parents: 0
diff changeset
24 ```{r 'rename files'}
6be61cb4a1d5 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit 6df7b8ef3a603f7792ed5815ff324ede8a7b2b0b-dirty
mingchen0919
parents: 0
diff changeset
25 # create directory
6be61cb4a1d5 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit 6df7b8ef3a603f7792ed5815ff324ede8a7b2b0b-dirty
mingchen0919
parents: 0
diff changeset
26 dir.create('./files_directory')
6be61cb4a1d5 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit 6df7b8ef3a603f7792ed5815ff324ede8a7b2b0b-dirty
mingchen0919
parents: 0
diff changeset
27 # get full paths of original files
6be61cb4a1d5 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit 6df7b8ef3a603f7792ed5815ff324ede8a7b2b0b-dirty
mingchen0919
parents: 0
diff changeset
28 from_files = strsplit("FILE_LIST", ',')[[1]]
6be61cb4a1d5 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit 6df7b8ef3a603f7792ed5815ff324ede8a7b2b0b-dirty
mingchen0919
parents: 0
diff changeset
29 # copy files to the created directory.
6be61cb4a1d5 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit 6df7b8ef3a603f7792ed5815ff324ede8a7b2b0b-dirty
mingchen0919
parents: 0
diff changeset
30 file.copy(from_files, './files_directory')
6be61cb4a1d5 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit 6df7b8ef3a603f7792ed5815ff324ede8a7b2b0b-dirty
mingchen0919
parents: 0
diff changeset
31 # get original file names
6be61cb4a1d5 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit 6df7b8ef3a603f7792ed5815ff324ede8a7b2b0b-dirty
mingchen0919
parents: 0
diff changeset
32 original_files = list.files('./files_directory')
6be61cb4a1d5 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit 6df7b8ef3a603f7792ed5815ff324ede8a7b2b0b-dirty
mingchen0919
parents: 0
diff changeset
33 # create new files names from original file names
6be61cb4a1d5 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit 6df7b8ef3a603f7792ed5815ff324ede8a7b2b0b-dirty
mingchen0919
parents: 0
diff changeset
34 new_files = gsub('\\.dat', '\\.FORMAT', original_files)
6be61cb4a1d5 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit 6df7b8ef3a603f7792ed5815ff324ede8a7b2b0b-dirty
mingchen0919
parents: 0
diff changeset
35 # rename files
6be61cb4a1d5 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit 6df7b8ef3a603f7792ed5815ff324ede8a7b2b0b-dirty
mingchen0919
parents: 0
diff changeset
36 file.copy(paste0('./files_directory/', original_files),
6be61cb4a1d5 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit 6df7b8ef3a603f7792ed5815ff324ede8a7b2b0b-dirty
mingchen0919
parents: 0
diff changeset
37 paste0('./files_directory/', new_files))
6be61cb4a1d5 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit 6df7b8ef3a603f7792ed5815ff324ede8a7b2b0b-dirty
mingchen0919
parents: 0
diff changeset
38 ```
6be61cb4a1d5 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit 6df7b8ef3a603f7792ed5815ff324ede8a7b2b0b-dirty
mingchen0919
parents: 0
diff changeset
39
6be61cb4a1d5 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit 6df7b8ef3a603f7792ed5815ff324ede8a7b2b0b-dirty
mingchen0919
parents: 0
diff changeset
40 # End