Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
jlopez
sagJL
Commits
e2bd3abb
Commit
e2bd3abb
authored
Jan 18, 2019
by
mmassaviol
Browse files
Remove predefined tools
parent
28f0dfea
Changes
1
Hide whitespace changes
Inline
Side-by-side
main.R
View file @
e2bd3abb
...
...
@@ -3,30 +3,30 @@ library(yaml)
path_yml
<-
"/home/mbb/Documents/waw/workflows/RNAseq/sag.yaml"
path_tools
<-
"/home/mbb/Documents/waw/tools"
#
path_tools <- "/home/mbb/Documents/waw/tools"
APP
<<-
yaml.load_file
(
path_yml
)
$
App
files_tools
<-
paste0
(
path_tools
,
'/'
,
list.files
(
path_tools
,
pattern
=
"sag.yml"
,
recursive
=
TRUE
))
#
files_tools <- paste0(path_tools,'/', list.files(path_tools,pattern = "sag.yml",recursive = TRUE))
#============================================================
get_predefined_tool
<-
function
(
path
)
{
all
<-
list
()
#
get_predefined_tool <- function(path) {
#
all <- list()
index
<-
1
for
(
f
in
files_tools
)
{
yml
<-
yaml.load_file
(
f
)
if
(
length
(
yml
)
==
0
)
{
all
<-
list
(
yaml.load_file
(
f
))
}
else
{
all
[[
index
]]
<-
yaml.load_file
(
f
)
}
index
<-
index
+
1
}
#
index <- 1
#
for(f in files_tools) {
#
yml <- yaml.load_file(f)
#
if(length(yml) == 0) {
#
all <- list(yaml.load_file(f))
#
} else {
#
all[[index]] <- yaml.load_file(f)
#
}
#
index <- index + 1
#
}
return
(
all
)
}
#
return(all)
#
}
#============================================================
...
...
@@ -236,24 +236,24 @@ generate_page_input <- function(res, cnt) {
#============================================================
get_predefined_box
<-
function
(
box
,
page_name
)
{
new_box
<-
NULL
for
(
t
in
YML_TOOLS
)
{
if
(
t
$
name
==
box
$
name
)
{
new_box
<-
t
#
get_predefined_box <- function(box, page_name) {
#
new_box <- NULL
#
for(t in YML_TOOLS) {
#
if(t$name == box$name) {
#
new_box <- t
if
(
box
$
concat_name_param
==
TRUE
)
{
for
(
z
in
1
:
length
(
new_box
$
content
))
{
new_box
$
content
[[
z
]]
$
name
<-
page_name
+
"_"
+
new_box
$
content
[[
z
]]
$
name
}
}
#
if(box$concat_name_param == TRUE) {
#
for(z in 1:length(new_box$content)) {
#
new_box$content[[z]]$name <- page_name + "_" + new_box$content[[z]]$name
#
}
#
}
break
}
}
#
break
#
}
#
}
return
(
new_box
)
}
#
return(new_box)
#
}
#============================================================
...
...
@@ -739,7 +739,7 @@ generate <- function() {
print
(
"Generate Start"
)
YML_TOOLS
<<-
get_predefined_tool
(
files_tools
)
#
YML_TOOLS <<- get_predefined_tool(files_tools)
if
(
dir.exists
(
APP
$
project
))
{
#unlink(APP$project, recursive=TRUE)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment