view eval_only_stics_on_sms.R @ 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
line wrap: on
line source

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)