comparison eml_validate.R @ 7:49f38336f28f draft default tip

planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit 4b040fe7867d965fb88ce70cc08081367b62b063
author ecology
date Fri, 27 Sep 2024 12:59:14 +0000
parents
children
comparison
equal deleted inserted replaced
6:4cf24a95c4ff 7:49f38336f28f
1 #17/09/2024
2 #Seguineau Pauline
3
4 #EML validate
5
6 #Load packages
7
8 library(emld)
9 library(EML)
10
11 #Load arguments
12
13 args = commandArgs(trailingOnly=TRUE)
14
15 if(length(args)>0){
16 eml_file <- args[1]
17 }else{
18
19 stop("This tool needs at least one argument.")}
20
21 #run eml_validate
22
23 eml = read_eml(eml_file)
24
25 eml_valid = eml_validate(eml)
26
27 if(eml_valid==T){
28 cat("Your EML is valid.")
29 }else if(eml_valid==F && length(attr(eml_valid,""))>1){
30 cat("Your EML is not valid. You can improve it by correcting these errors:","\n")
31 attr(eml_valid,"")
32 }else{
33 cat("Your EML is not valid. You can improve it by correcting this error:","\n")
34 attr(eml_valid,"")
35 }