Mercurial > repos > ecology > vector_template
comparison eml_validate.R @ 1:fe9ba2edc449 draft
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit 4b040fe7867d965fb88ce70cc08081367b62b063
| author | ecology |
|---|---|
| date | Fri, 27 Sep 2024 12:56:33 +0000 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 0:f8dad04c9efa | 1:fe9ba2edc449 |
|---|---|
| 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 } |
