diff annotations_template.R @ 0:ad96b20423cf 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 13:01:04 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/annotations_template.R	Fri Sep 27 13:01:04 2024 +0000
@@ -0,0 +1,81 @@
+#17/07/2024
+#Seguineau Pauline
+
+#Make annotation template
+#Load packages
+
+library(EMLassemblyline)
+
+#Load arguments
+
+args = commandArgs(trailingOnly=TRUE)
+
+if(length(args)>0){
+  prod <- args[1]
+  if (prod == "fr_scratch"){
+      select <- args[2]
+      data_table <- args[3]
+      if(select == "data_table"){
+          data_table <- args[3]
+      }else if(select == "other_entities"){
+          other_entities <- args[3]
+      }else if(select == "both"){
+          data_table <- args[3]
+          other_entities <- args[4]}
+  }else{
+      eml <- args[2]
+  }
+}
+
+#Transform arguments
+
+if(prod =="fr_scratch" && select == "both"){
+     table = strsplit(data_table," ")
+     other = strsplit(other_entities," ")
+
+#Make templates to add annotations from scratch
+
+     template_annotations(
+          path ="data_files/",
+          data.table = table[[1]],
+          other.entity = other[[1]]) 
+          
+}else if (prod == "fr_scratch" && select == "data_table"){
+
+     table = strsplit(data_table," ")
+     template_annotations(
+          path ="data_files/",
+          data.table = table[[1]]) 
+
+}else if (prod == "fr_scratch" && select == "other_entities"){
+
+     other = strsplit(other_entities," ")
+     template_annotations(
+          path ="data_files/",
+          other.entity = other[[1]]) 
+
+#Make templates to add annotations from EML file
+
+}else{
+     template_annotations(
+          path= "data_files/",
+          eml = eml)}
+          
+          
+          
+          
+          
+          
+          
+          
+          
+          
+          
+          
+          
+          
+          
+          
+          
+          
+