Mercurial > repos > ecology > geo_cov_template
annotate geo_cov_temp.R @ 5:ea302cc18332 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 12:58:31 +0000 |
parents | a5f887cfcf94 |
children |
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 |
3
a5f887cfcf94
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit 43f3c45c97ba7d09ad1ea19df9e953cfe917dde8
ecology
parents:
2
diff
changeset
|
22 datatable = read.table(data_table,sep="\t",header=T) |
0
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 |
2
0fe3b8bd9d8b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
0
diff
changeset
|
33 |
0
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
34 #Make template |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
35 |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
36 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
|
37 |
dc2dfad1627b
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit ea09df299078ff13beda210b36b7edaa6a79c099
ecology
parents:
diff
changeset
|
38 |