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