Mercurial > repos > siwaa > redelac_stics_g
changeset 5:4f8d87b9c246 draft
"planemo upload for repository https://forgemia.inra.fr/redelac commit b3a95e69b8c2496ff3ec12c854404798d8bc55b1"
author | siwaa |
---|---|
date | Tue, 04 Jul 2023 16:37:44 +0000 |
parents | af7d9ca55205 |
children | bb1ac57f8545 |
files | redelacSticsInputGenerator.R redelacSticsInputGenerator.bash redelacSticsInputGenerator.xml |
diffstat | 3 files changed, 33 insertions(+), 30 deletions(-) [+] |
line wrap: on
line diff
--- a/redelacSticsInputGenerator.R Thu Jun 29 11:03:20 2023 +0000 +++ b/redelacSticsInputGenerator.R Tue Jul 04 16:37:44 2023 +0000 @@ -17,13 +17,11 @@ # USMs file usms_param <- read_params_table(file.path(workspace, USMsFile)) %>% select(usm_name,datedebut,datefin,finit,nomsol,fstation,fclim1,fclim2,culturean,nbplantes,codesimul,fplt_1,ftec_1,flai_1,fplt_2,ftec_2,flai_2) -gen_usms_xml(file = file.path(workspace, "usms.xml"), param_df = usms_param) # Tec files tec_param <- read_params_table(file.path(workspace, TecFile)) %>% select(!c(annee, date_min, date_max, Date_res_1, Date_res_2, Type_res_1, Type_res_2, Date_trav_1, Date_trav_2, Date_trav_3, Type_trav_1, Type_trav_2 ,Type_trav_3, plante_sem, date_sem, starts_with("nom_vari"), date_ferti_1, date_ferti_2, date_ferti_3, type_eng_1, type_eng_2, type_eng_3, date_rec, date_des, juleclair, nbinfloecl)) gen_tec_xml(param_df = tec_param, out_dir = workspace) -# select(!c(annee, date_min, date_max, Date_res_1, Date_res_2, Type_res_1, Type_res_2, Date_trav_1, Date_trav_2, Date_trav_3, Type_trav_1, Type_trav_2 ,Type_trav_3, plante_sem, date_sem) # Ini files ini_param <- read_params_table(file.path(workspace, IniFile)) @@ -35,14 +33,18 @@ # Generate STICS txt files------------------------------------------------------------------------------ # List of USMs -list_usms <- SticsRFiles::get_usms_list(file = file.path(workspace,"usms.xml")) ### Generate txt files into individual folders -# generate text files -gen_usms_xml2txt(javastics = javastics_path, - workspace = workspace, - out_dir = txt_path, - verbose = TRUE, - usm = list_usms) +for(i in 1:nrow(usms_param)) { + row <- usms_param[i,] + # do stuff with row + + gen_usms_xml(file = file.path(workspace, "usms.xml"), param_df = row) + + gen_usms_xml2txt(javastics = javastics_path, + workspace = workspace, + out_dir = txt_path, + verbose = TRUE) +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/redelacSticsInputGenerator.bash Tue Jul 04 16:37:44 2023 +0000 @@ -0,0 +1,20 @@ +cp -r /home/rstudio/JavaSTICS-1.5.1-STICS-10.0.0/JavaSTICS-1.5.1-STICS-10.0.0 . && +rm -rf JavaSTICS-1.5.1-STICS-10.0.0/config && +cp -r $1/config JavaSTICS-1.5.1-STICS-10.0.0 && +unzip $2 -d TMP && +export WSname=$(ls TMP) && +mv TMP/* JavaSTICS-1.5.1-STICS-10.0.0/WS && +cp JavaSTICS-1.5.1-STICS-10.0.0/config/param_gen.xml JavaSTICS-1.5.1-STICS-10.0.0/WS && +cp JavaSTICS-1.5.1-STICS-10.0.0/config/param_newform.xml JavaSTICS-1.5.1-STICS-10.0.0/WS && +unzip $3 -d TMPbis && +mv TMPbis/*/* JavaSTICS-1.5.1-STICS-10.0.0/WS && +cp $4 JavaSTICS-1.5.1-STICS-10.0.0/WS/USMs.csv && +cp $5 JavaSTICS-1.5.1-STICS-10.0.0/WS/Tec.csv && +cp $6 JavaSTICS-1.5.1-STICS-10.0.0/WS/Ini.csv && +cp $7 JavaSTICS-1.5.1-STICS-10.0.0/WS/Station.csv && +cd JavaSTICS-1.5.1-STICS-10.0.0 && +Rscript --verbose $1/redelacSticsInputGenerator.R && +rm WS/1* && +mv WS $WSname && +zip -r $WSname $WSname && +cp $WSname.zip $8
--- a/redelacSticsInputGenerator.xml Thu Jun 29 11:03:20 2023 +0000 +++ b/redelacSticsInputGenerator.xml Tue Jul 04 16:37:44 2023 +0000 @@ -4,27 +4,8 @@ <container type="singularity">docker://registry.forgemia.inra.fr/quaysofthestics/sticsquays/rstudio_stics_test:10.0.0</container> </requirements> <command detect_errors="aggressive"> - <![CDATA[ - cp -r /home/rstudio/JavaSTICS-1.5.1-STICS-10.0.0/JavaSTICS-1.5.1-STICS-10.0.0 . && - rm -rf JavaSTICS-1.5.1-STICS-10.0.0/config && - cp -r $__tool_directory__/config JavaSTICS-1.5.1-STICS-10.0.0 && - unzip ${Workspace} -d TMP && - export WSname=\$(ls TMP) && - mv TMP/* JavaSTICS-1.5.1-STICS-10.0.0/WS && - cp JavaSTICS-1.5.1-STICS-10.0.0/config/param_gen.xml JavaSTICS-1.5.1-STICS-10.0.0/WS && - cp JavaSTICS-1.5.1-STICS-10.0.0/config/param_newform.xml JavaSTICS-1.5.1-STICS-10.0.0/WS && - unzip ${Climat} -d TMPbis && - mv TMPbis/*/* JavaSTICS-1.5.1-STICS-10.0.0/WS && - cp ${USMs} JavaSTICS-1.5.1-STICS-10.0.0/WS/USMs.csv && - cp ${Tec} JavaSTICS-1.5.1-STICS-10.0.0/WS/Tec.csv && - cp ${Ini} JavaSTICS-1.5.1-STICS-10.0.0/WS/Ini.csv && - cp ${Station} JavaSTICS-1.5.1-STICS-10.0.0/WS/Station.csv && - cd JavaSTICS-1.5.1-STICS-10.0.0 && - Rscript --verbose $__tool_directory__/redelacSticsInputGenerator.R && - rm WS/1* && - mv WS \$WSname && - zip -r \$WSname \$WSname && - cp \$WSname.zip ${GeneratedWorkspace} + <![CDATA[ + bash $__tool_directory__/redelacSticsInputGenerator.bash $__tool_directory__ ${Workspace} ${Climat} ${USMs} ${Tec} ${Ini} ${Station} ${GeneratedWorkspace} ]]> </command> <inputs>