changeset 2:3d14d6a4ef7c draft

planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
author ecology
date Sat, 02 Dec 2023 01:49:48 +0000
parents 248b03f124dd
children 409d9329d2be
files geo_cov_temp.R table_templates.R taxo_cov_template.R templates1.R test-data/datafile_1.tsv test-data/geographic_coverage.txt test-data/taxa.tsv test-data/taxonomic_coverage.txt test-data/test-geocov.tabular
diffstat 9 files changed, 260 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/geo_cov_temp.R	Sat Dec 02 01:49:48 2023 +0000
@@ -0,0 +1,37 @@
+#27/11/2023
+#Seguineau Pauline
+#Make geographic coverage template
+
+#Load packages
+
+library(EMLassemblyline)
+
+#Load arguments
+
+args = commandArgs(trailingOnly=TRUE)
+if(length(args)>0){
+  
+  data_table <- args[1]
+  tablename <- args[2]
+  lat_col <- as.numeric(args[3])
+  long_col <- as.numeric(args[4])
+  site_col <- as.numeric(args[5])
+  empty <- args[6]
+}
+
+datatable = read.table(data_table,header=T)
+
+latcol = names(datatable[lat_col])
+longcol = names(datatable[long_col])
+sitecol = names(datatable[site_col])
+
+if (empty == "false"){
+   empty = FALSE
+}else if (empty=="true"){
+   empty=TRUE}
+
+#Make template
+
+template_geographic_coverage(path =".", data.path = "data_files", data.table = tablename, lat.col = latcol, lon.col = longcol, site.col = sitecol, empty = empty)
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/table_templates.R	Sat Dec 02 01:49:48 2023 +0000
@@ -0,0 +1,21 @@
+#28/11/2023 #SEGUINEAU Pauline 
+
+#Load packages
+
+library(EMLassemblyline)
+
+#Load arguments
+
+if (length(commandArgs(trailingOnly = TRUE)) > 0) {
+    data_table <- commandArgs(trailingOnly = TRUE)[1]
+}
+
+#Transform arguments
+
+table =  strsplit(data_table," ")
+
+#Make templates to describe data tables : Describes columns of a data table (classes, units, datetime formats, missing value codes) + catégorical variables.
+
+template_table_attributes(path = ".",data.path= "data_files", data.table = table[[1]])
+template_categorical_variables(path = ".", data.path = "data_files")
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/taxo_cov_template.R	Sat Dec 02 01:49:48 2023 +0000
@@ -0,0 +1,47 @@
+#28/11/2023
+#Seguineau Pauline
+#Make taxonomic coverage template
+
+#Load packages
+
+library(EMLassemblyline)
+
+#Load arguments
+
+args = commandArgs(trailingOnly=TRUE)
+if(length(args)>0){
+  data_taxa <- args[1]
+  taxa_table <- args[2]
+  taxa_col <- as.numeric(args[3])
+  taxa_name_type <- args[4]
+  authority <- as.numeric(args[5])
+  authority2 <- as.numeric(args[6])
+  authority3 <- as.numeric(args[7])
+  empty <- args[8]
+}
+
+#transfom arguments
+taxatable = read.table(data_taxa,header=T,sep="\t")
+taxacol = names(taxatable[taxa_col])
+
+if (authority2 == 0 && authority3==0){
+   authority_f = authority}
+   
+if(authority2 == 0 && authority3 != 0){
+   authority_f = c(authority,authority3)}
+
+if (authority2 !=0 && authority3==0){
+   authority_f = c(authority,authority2)}
+
+if (authority3 !=0 && authority2 !=0){
+   authority_f = c(authority,authority2,authority3)}
+   
+if (empty == "false"){
+   empty = FALSE
+}else if (empty=="true"){
+   empty=TRUE}
+
+
+#Make template
+
+template_taxonomic_coverage(path =".", data.path = "data_files", taxa.table = taxa_table, taxa.col = taxacol, taxa.name.type = taxa_name_type , taxa.authority = authority_f, empty = empty)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/templates1.R	Sat Dec 02 01:49:48 2023 +0000
@@ -0,0 +1,23 @@
+#22/11/2023 #SEGUINEAU Pauline 
+
+###First tool of EML Workflow
+
+#Load packages
+
+library(EMLassemblyline)
+
+#Load arguments
+
+args = commandArgs(trailingOnly=TRUE)
+if(length(args)>0){
+  
+  license <- args[1]
+  file_type <- args[2]
+}
+
+#Make templates to describe core features of a data package (abstract, methods, keywords, personnel, license). 
+
+template_core_metadata(path=".",license = license, file.type = file_type)
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/datafile_1.tsv	Sat Dec 02 01:49:48 2023 +0000
@@ -0,0 +1,113 @@
+Id	density_boats	distance_coast	percentage_turbidity	nb_individual	recorder	min_t	max_wind
+ID1	0	7.083851986	1	1	13740	9	13
+ID2	0	5.057419245	1	1	3760	11.7	15
+ID3	0	14.81271925	1	1	17598	9	13
+ID4	23.38130966	17.39474876	0	1	17607	12.8	24
+ID5	0	13.8788222	1	1	17608	14.3	17
+ID6	0	20.55593297	1	1	13733	20	17
+ID7	0	5.228906117	1	1	10250	14.3	30
+ID8	0	8.18336163	0.963336783	2	13740	11.7	15
+ID9	0	14.77478497	1	1	13733	11.7	15
+ID10	0	18.23789045	1	1	17573	9	13
+ID11	0	30.97770737	0.934057759	2	17608	8.1	13
+ID12	0	14.72135785	0	2	13733	8.1	13
+ID13	0	26.97792869	1	1	17578	8.1	13
+ID14	0	8.63834361	1	1	17329	11.7	15
+ID15	23.42372625	2.371250707	0.611485317	2	17232	14.3	30
+ID16	0	2.058590657	1	1	NA	11.7	15
+ID17	0	14.5557442	1	1	11693	14.3	17
+ID18	0	15.31628381	0.484376584	2	10250	14.2	9
+ID19	22.68310089	18.12266606	1	1	13733	16.9	13
+ID20	0	10.71630644	0.946424061	2	17608	NA	NA
+ID21	0	7.492501839	1	1	17608	14.3	30
+ID22	0	2.455167732	1	1	17578	8.1	13
+ID23	0	0.215005092	0.619357094	2	17608	13.3	0
+ID24	0	20.5942275	0.530977409	2	17573	12.8	24
+ID25	0	0.00565931	1	1	10250	9	13
+ID26	0	4.61669024	1	1	3760	8.1	13
+ID27	0	0.650746944	1	1	13289	NA	NA
+ID28	11.55094443	4.256523462	0.534748923	2	17608	17.4	15
+ID29	25.29249263	0.333785924	0	3	11693	16.9	13
+ID30	5.659985665	3.927116342	1	1	17578	16.9	13
+ID31	0	0.011314137	0	2	13740	20	17
+ID32	0	6.724401426	0.262229612	3	17578	8.5	7
+ID33	0	10.20546782	0.456408314	2	13676	17.8	13
+ID34	0	0.005662514	1	1	13289	9	13
+ID35	0	12.50424544	1	1	13733	13.3	0
+ID36	41.24173899	0.028288543	0	2	17607	NA	NA
+ID37	0	0.707453733	0	2	13733	17.8	13
+ID38	7.278017273	8.411585021	0.521433594	2	17601	17.4	15
+ID39	26.46665163	3.174693	1	1	17598	11.7	15
+ID40	21.65723654	8.846001472	0.672489759	2	17232	9	13
+ID41	0	7.296088753	0.033790965	2	17601	9	13
+ID42	0	0.848848396	0	3	17608	17.4	14
+ID43	0	17.47693701	1	1	NA	8.1	13
+ID44	0	8.040770102	1	1	17329	8.1	13
+ID45	0	9.227200724	1	1	17607	8.1	13
+ID46	0	4.089829166	0	1	17607	17.4	15
+ID47	16.24258106	12.9081546	0.519677866	2	17232	14.3	17
+ID48	0	28.17682685	0	3	13733	14.2	9
+ID49	0	11.13752122	0.568145458	2	17329	12.8	24
+ID50	0	12.15482119	0.744442086	2	13676	17.4	14
+ID51	0	1.075147125	0.126547756	2	17329	17.8	13
+ID52	0	0.639429606	0.318501019	3	17573	17.8	13
+ID53	0	11.34563151	1	1	13289	9	13
+ID54	0	6.070721358	1	1	11693	8.1	13
+ID55	0	2.534940304	1	1	3760	NA	NA
+ID56	0	0	1	1	17608	14.9	13
+ID57	23.6734518	9.73526417	1	1	13733	14.9	13
+ID58	22.77461434	2.30834512	0	2	3760	17.4	15
+ID59	0	9.034849513	1	1	NA	14.3	30
+ID60	0	1.61299451	1	1	17598	8.1	13
+ID61	0	1.550212164	1	1	17601	8.1	13
+ID62	16.6417688	0.198064626	1	1	13676	13.3	0
+ID63	0	0.147167035	0.503759276	2	13740	14.9	13
+ID64	0	1.126075147	1	1	17329	14.2	9
+ID65	0	1.166213768	0.486555056	2	10250	17.4	14
+ID66	0	37.17890687	0.241246715	3	11693	12.3	11
+ID67	0	1.01318843	1	1	NA	11.7	15
+ID68	0	14.97426034	0.513275979	3	17578	8.5	7
+ID69	0	0.050933786	1	1	10250	13.3	0
+ID70	0	1.60733488	1	1	11693	13.3	0
+ID71	0	0.15274085	0.616607437	2	11693	14.9	13
+ID72	0	4.745186863	0.427826338	3	17578	14.9	13
+ID73	0	0.005658029	1	1	13289	17.4	15
+ID74	20.10097018	1.120479882	1	1	17329	9	13
+ID75	0	1.833512535	1	1	11693	9	13
+ID76	0	1.964892412	1	1	3760	14.9	13
+ID77	0	1.024508972	1	1	17598	13.3	0
+ID78	13.02008677	2.446206116	0	2	17601	17.8	13
+ID79	0	5.849408836	0.506514891	2	17601	12.3	11
+ID80	0	0.82602546	1	1	17607	20	17
+ID81	0	6.632335465	1	1	13733	17.8	13
+ID82	9.774097667	2.083923212	0.147137616	2	17329	17.4	14
+ID83	0	0.843046283	1	1	17598	11.7	15
+ID84	0	17.16743054	1	1	3760	9	13
+ID85	0	2.347816248	1	1	17607	13.3	0
+ID86	0	2.089467724	1	1	17608	8.1	13
+ID87	14.70497236	1.782279054	1	1	17329	8.1	13
+ID88	0	1.828267391	1	1	10250	8.1	13
+ID89	19.54258479	2.829334541	1	1	3760	14.3	30
+ID90	22.89867383	0.50376408	1	1	17573	14.3	30
+ID91	0	7.486419194	1	1	13676	14.2	9
+ID92	0	4.612337295	1	1	17601	11.7	15
+ID93	0	20.34521788	1	1	17232	11.7	15
+ID94	0	13.69731259	0.558754442	2	13289	14.3	17
+ID95	0	0.481041313	0.601822162	2	17607	14.3	17
+ID96	0	19.55721647	0.856473518	3	17232	16.9	13
+ID97	0	9.467489106	1	1	10250	17.4	15
+ID98	0	22.78746039	0.460271388	3	11693	14.3	30
+ID99	0	8.380520951	0.769578171	2	17607	9	13
+ID100	32.43763517	0.486507892	0.297384797	4	17573	12.3	11
+ID101	39.87341993	18.47598574	0.377696294	3	17329	NA	NA
+ID102	0	1.482655198	0.420523151	2	17598	NA	NA
+ID103	0	1.188455008	1	1	13289	8.1	13
+ID104	0	2.981949867	1	1	17232	13.3	0
+ID105	6.048310547	0.06224536	1	1	17578	17.4	14
+ID106	0	0.067957866	1	1	17232	17.4	14
+ID107	0	0.305516266	0	1	17598	17.4	14
+ID108	0	1.375212224	0.512278187	2	17601	20	17
+ID109	23.18323585	0.045282164	0.355925541	2	13676	17.4	14
+ID110	0	0	0.599181014	2	17232	13.3	0
+ID111	0	0.050922259	1	1	17329	14.9	13
+ID112	0	0.763920326	1	1	13740	13.3	0
--- a/test-data/geographic_coverage.txt	Fri Nov 17 17:07:45 2023 +0000
+++ b/test-data/geographic_coverage.txt	Sat Dec 02 01:49:48 2023 +0000
@@ -1,2 +1,5 @@
 geographicDescription	northBoundingCoordinate	southBoundingCoordinate	eastBoundingCoordinate	westBoundingCoordinate
-Yvelines - Essonne - Seine et Marne	49.08428	48.12266	3.56409	1.60296
+1	-65.999946	-65.999946	142.3360535	142.3360535
+2	-66.394359	-66.394359	140.4840125	140.4840125
+3	-66.023545	-66.023545	142.745584	142.745584
+4	-66.3379125	-66.3379125	144.011634	144.011634
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/taxa.tsv	Sat Dec 02 01:49:48 2023 +0000
@@ -0,0 +1,5 @@
+taxa	site
+Achelia_sp	1
+Achelia_spicata	2
+Achelia_suflata	2
+Ammothea_adunca	3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/taxonomic_coverage.txt	Sat Dec 02 01:49:48 2023 +0000
@@ -0,0 +1,5 @@
+name	name_type	name_resolved	authority_system	authority_id
+Achelia_sp	scientific	Achelia	GBIF Backbone Taxonomy	2118396
+Achelia_spicata	scientific	Achelia spicata	GBIF Backbone Taxonomy	4338694
+Achelia_suflata	scientific	Achelia suflata	GBIF Backbone Taxonomy	NA
+Ammothea_adunca	scientific	Ammothea adunca	GBIF Backbone Taxonomy	5720487
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/test-geocov.tabular	Sat Dec 02 01:49:48 2023 +0000
@@ -0,0 +1,5 @@
+site	lat	long
+1	-65.999946	142.3360535
+2	-66.394359	140.4840125
+3	-66.023545	142.745584
+4	-66.3379125	144.011634