changeset 0:ab62b4ecd5b9 draft default tip

"planemo upload for repository https://forgemia.inra.fr/quaysofthestics/sticsquays/-/tree/master/tools commit 5e434da355bade7d12364ccbd84b53848e6fa4c5"
author siwaa
date Mon, 18 Jul 2022 10:54:39 +0000
parents
children
files SMSticsTool-9.2.xml eval_only_stics_on_sms.R
diffstat 2 files changed, 98 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SMSticsTool-9.2.xml	Mon Jul 18 10:54:39 2022 +0000
@@ -0,0 +1,44 @@
+<tool id="SMSticsTool-9.2" name="sms_stics-9.2" version="1.0.0">
+  <description>to run the Stics simulator on the SMS DB [Stics-9.2]</description>
+  <requirements>
+    <container type="singularity">docker://registry.forgemia.inra.fr/quaysofthestics/sticsquays/rstudio_stics_sms:9.2</container>
+  </requirements>
+  <command detect_errors="aggressive">
+    <![CDATA[ 
+	     cp -r /home/rstudio/JavaSTICS-1.41-stics-9.2/ . &&
+	     cp -R /home/rstudio/EvaluationReports . &&
+	     unzip ${SMSdb} &&
+	     cp ${plan} USMlist.csv &&
+	     Rscript --verbose $__tool_directory__/eval_only_stics_on_sms.R &&
+	     zip -r eval.zip work/eval_* &&
+	     cp eval.zip ${evalFolder}
+     ]]>
+  </command>
+  <inputs>
+    <param name="SMSdb" type="data" format="zip" label="Select a stics SMS DB (zip file)"/>
+    <param name="plan" type="data" format="csv" label="Select a plan (csv file)"/>
+  </inputs>
+  <outputs>
+    <data format="zip" name="evalFolder"
+          label="Stics SMS Evaluation Folder">
+    </data>
+  </outputs>
+  <tests>
+  </tests>
+  <help>
+*The usage of this tool is restricted to the user of the stics_authorized group.*
+
+*To be granted, apply to the Project Stics Team and then request to SIWAA*
+
+Documentation
+-------------
+A tool to run the Stics simulator on a Stics SMS database.
+
+Credits
+-------
+-  Wrapped Tool Author: https://www6.paca.inrae.fr/stics_eng/About-us/Project-Stics-Team
+-  Stics Site: https://www6.paca.inra.fr/stics_eng
+-  Galaxy Tool Maintainer: Patrick Chabrier patrick.chabrier@inrae.fr
+-  Copyright: INRAE
+  </help>
+</tool>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/eval_only_stics_on_sms.R	Mon Jul 18 10:54:39 2022 +0000
@@ -0,0 +1,54 @@
+library(SticsRFiles)
+library(SticsOnR)
+library(dplyr)
+library(stringr)
+library(parallel)
+
+print("==================================")
+
+print(paste0("Cores=", detectCores()))
+
+print("==================================")
+
+native_wd_path <- getwd()
+
+# Initializations: set path here
+
+sms_path_V9 <- paste0(getwd(), "/Stics_Tests/branches/Stics_Tests_for_Stics_v92")
+
+sms_idesticsr_path <- "/home/rstudio/IDESticsR"
+
+invisible(sapply(list.files(file.path(sms_idesticsr_path),pattern = "*[R|r]$", full.names = TRUE), source))
+
+javastics <- paste0(getwd(), "/JavaSTICS-1.41-stics-9.2")
+
+path_typoFR <- file.path(sms_path_V9, "typo_usms_FR_14_12_2017_pour_tri_evaluation_officielle.csv")
+path_typo <- file.path(sms_path_V9, "typo_usms.csv")
+
+# Select corresponding USMs
+plant_files <- NULL
+
+USM_list_file <- paste0(native_wd_path,"/USMlist.csv")
+
+UsmMetadata <- read.csv(USM_list_file,header=T, sep=";",stringsAsFactors = FALSE)
+
+# to guess the plant
+plant <-  UsmMetadata$plant1[1]
+
+if (plant == "corn") {plant <- "maize"}
+
+USM_names <- UsmMetadata$usm
+
+workspace <- paste0(native_wd_path, "/work")
+
+res <- evaluate_SMS(sms_path=sms_path_V9, javastics=javastics, workspace=workspace,
+                    workspace_prev=NULL, 
+                    workspace_ref=NULL, path_typo=path_typo, 
+                    eval_folder=paste0("eval_",plant), usms=USM_names, 
+                    param_values=NULL, plant=plant, plant_files=plant_files, 
+                    var_names=NULL, 
+                    nb_cores=1, do_create_workspace=TRUE, 
+                    do_run=TRUE, do_eval=TRUE, do_generate_report=TRUE,
+                    report_path=file.path(paste0(native_wd_path, "/EvaluationReports"),str_to_title(plant)),
+                    stics_eval_version=NULL, stics_ref_version=NULL,
+                    sms_version=NULL)
\ No newline at end of file