Mercurial > repos > mingchen0919 > rmarkdown_i_adhore
comparison i_adhore_configure.Rmd @ 0:9755ce6ac4d5 draft
planemo upload for repository https://github.com/statonlab/docker-GRReport/tree/master/my_tools/rmarkdown_i_adhore commit b6ef011f29d6c75775be9cc0e0abe53e19981d1d-dirty
author | mingchen0919 |
---|---|
date | Tue, 08 Aug 2017 12:53:57 -0400 |
parents | |
children | dab02b629d48 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:9755ce6ac4d5 |
---|---|
1 --- | |
2 title: 'i-adhore: generate i-adhore config file' | |
3 output: | |
4 html_document: | |
5 number_sections: true | |
6 toc: true | |
7 theme: cosmo | |
8 highlight: tango | |
9 --- | |
10 | |
11 ```{r setup, include=FALSE, warning=FALSE, message=FALSE} | |
12 knitr::opts_chunk$set(echo = ECHO) | |
13 ``` | |
14 | |
15 # Genomes and analysis files | |
16 | |
17 ```{r} | |
18 g_analysis_files_set = strsplit(opt$g_analysis_file, ';')[[1]] | |
19 g_analysis_files_list = list() | |
20 # for(i in g_analysis_files_set) { | |
21 # genome = strsplit(i, ':')[[1]][1] | |
22 # analysis_files = strsplit(i, ':')[[1]][2] %>% | |
23 # strsplit(',') %>% `[[`(1) %>% | |
24 # (function(x){ | |
25 # paste0(1:length(x),' ', x) | |
26 # }) | |
27 # g_analysis_files_list[[genome]] = analysis_files | |
28 # } | |
29 for(i in g_analysis_files_set) { | |
30 genome = strsplit(i, ':')[[1]][1] | |
31 analysis_files = strsplit(i, ':')[[1]][2] %>% | |
32 strsplit(',') %>% `[[`(1) %>% | |
33 laply(.fun = function(x){ | |
34 file_name = strsplit(x, '/')[[1]] %>% tail(1) | |
35 file_name = strsplit(file_name, '\\.')[[1]][1] | |
36 paste0(file_name, ' ', x) | |
37 }) | |
38 g_analysis_files_list[[genome]] = c( | |
39 'name' = paste0('genome=', strsplit(i, ':')[[1]][1]), | |
40 'analysis_files' = analysis_files | |
41 ) | |
42 print(paste0('genome=', strsplit(i, ':')[[1]][1])) | |
43 print(analysis_files) | |
44 } | |
45 ``` | |
46 | |
47 # Other parameters | |
48 | |
49 ```{r} | |
50 params = c( | |
51 'blast table' = opt$blast_table, | |
52 'output_path' = opt$i_adhore_configure_dir, | |
53 'gap_size' = opt$gap_size, | |
54 'cluster_gap' = opt$cluster_gap, | |
55 'q_value' = opt$q_value, | |
56 'prob_cutoff' = opt$prob_cutoff, | |
57 'anchor_points' = opt$anchor_points, | |
58 'level_2_only' = opt$level2only, | |
59 'table_type' = opt$table_type, | |
60 'multi_hypothesis_correction' = opt$multi_hypothesis_correction | |
61 ) | |
62 | |
63 df = data.frame(name = names(params), | |
64 value = params) | |
65 knitr::kable(df) | |
66 ``` | |
67 | |
68 | |
69 ```{r echo=FALSE} | |
70 # generate i_adhore_configure.txt file | |
71 lines = c(unlist(g_analysis_files_list), | |
72 ' ', | |
73 paste0(df$name, '=', df$value), | |
74 'CompareAligners') | |
75 fileConn = file('I_ADHORE_CONFIGURE_TXT') | |
76 writeLines(lines, con = fileConn) | |
77 ``` | |
78 | |
79 |