annotate collection_list.Rmd @ 6:a0c8b2b25774 draft

planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit 88ca36a41aa577ba888cee39cf81b176bf7e68db
author mingchen0919
date Tue, 26 Sep 2017 13:33:22 -0400
parents 63e9500cdeec
children
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 ---
6
a0c8b2b25774 planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit 88ca36a41aa577ba888cee39cf81b176bf7e68db
mingchen0919
parents: 4
diff changeset
2 title: 'Build collection: a list of datasets'
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
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
4
63e9500cdeec planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_collection_builder commit 436d91722b309f61890d13d7ed28cd43c79a5c74
mingchen0919
parents: 3
diff changeset
23 # Rename files
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
24
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
25 ```{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
26 # 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
27 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
28 # 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
29 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
30 # 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
31 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
32 # 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
33 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
34 # 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
35 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
36 # 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
37 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
38 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
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