Mercurial > repos > ecology > geo_cov_template
annotate geo_cov_temp.R @ 1:4f5816b57c13 draft
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit 5c327a780dc58fb954e7b65db6fd413ee3909c84
author | ecology |
---|---|
date | Mon, 04 Dec 2023 21:48:29 +0000 |
parents | dc2dfad1627b |
children | 0fe3b8bd9d8b |
rev | line source |
---|---|
0
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
1 #27/11/2023 |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
2 #Seguineau Pauline |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
3 #Make geographic coverage template |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
4 |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
5 #Load packages |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
6 |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
7 library(EMLassemblyline) |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
8 |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
9 #Load arguments |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
10 |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
11 args = commandArgs(trailingOnly=TRUE) |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
12 if(length(args)>0){ |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
13 |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
14 data_table <- args[1] |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
15 tablename <- args[2] |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
16 lat_col <- as.numeric(args[3]) |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
17 long_col <- as.numeric(args[4]) |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
18 site_col <- as.numeric(args[5]) |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
19 empty <- args[6] |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
20 } |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
21 |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
22 datatable = read.table(data_table,header=T) |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
23 |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
24 latcol = names(datatable[lat_col]) |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
25 longcol = names(datatable[long_col]) |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
26 sitecol = names(datatable[site_col]) |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
27 |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
28 if (empty == "false"){ |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
29 empty = FALSE |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
30 }else if (empty=="true"){ |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
31 empty=TRUE} |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
32 |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
33 #Make template |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
34 |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
35 template_geographic_coverage(path =".", data.path = "data_files", data.table = tablename, lat.col = latcol, lon.col = longcol, site.col = sitecol, empty = empty) |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
36 |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
37 |