view eml_validate.R @ 3:3d585ce5fc9c draft default tip

planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit e519c7f66456a43f9beb69209a3eb45723065216
author ecology
date Fri, 30 Jan 2026 15:38:23 +0000
parents ef217ea69de9
children
line wrap: on
line source

#17/09/2024
#Seguineau Pauline 

#EML validate

#Load packages

library(emld)
library(EML)

#Load arguments

args = commandArgs(trailingOnly=TRUE)

if(length(args)>0){
  eml_file <- args[1]
}else{

stop("This tool needs at least one argument.")}

#run eml_validate

eml = read_eml(eml_file)

eml_valid = eml_validate(eml)

if(eml_valid==T){
  cat("Your EML is valid.")
}else if(eml_valid==F && length(attr(eml_valid,""))>1){
  cat("Your EML is not valid. You can improve it by correcting these errors:","\n")
  attr(eml_valid,"")
}else{
  cat("Your EML is not valid. You can improve it by correcting this error:","\n")
  attr(eml_valid,"")
}