Repository 'entities_template'
hg clone https://toolshed.g2.bx.psu.edu/repos/ecology/entities_template

Changeset 3:299db57196ac (2024-09-27)
Previous changeset 2:1b11e38718af (2024-09-10)
Commit message:
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit 4b040fe7867d965fb88ce70cc08081367b62b063
added:
eml_validate.R
test-data/report.txt
b
diff -r 1b11e38718af -r 299db57196ac eml_validate.R
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/eml_validate.R Fri Sep 27 12:58:52 2024 +0000
[
@@ -0,0 +1,35 @@
+#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,"")
+} 
b
diff -r 1b11e38718af -r 299db57196ac test-data/report.txt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/report.txt Fri Sep 27 12:58:52 2024 +0000
[
@@ -0,0 +1,2 @@
+Your EML is not valid. You can improve it by correcting this error: 
+[1] "Element 'creator': This element is not expected. Expected is one of ( references, alternateIdentifier, shortName, title )."