Mercurial > repos > ecology > raster_template
annotate geo_cov_temp.R @ 3:36150f04b524 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:53 +0000 |
parents | 06e29cdc08bf |
children |
rev | line source |
---|---|
0
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
1 #27/11/2023 |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
2 #Seguineau Pauline |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
3 #Make geographic coverage template |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
4 |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
5 #Load packages |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
6 |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
7 library(EMLassemblyline) |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
8 |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
9 #Load arguments |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
10 |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
11 args = commandArgs(trailingOnly=TRUE) |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
12 if(length(args)>0){ |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
13 |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
14 data_table <- args[1] |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
15 tablename <- args[2] |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
16 lat_col <- as.numeric(args[3]) |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
17 long_col <- as.numeric(args[4]) |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
18 site_col <- as.numeric(args[5]) |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
19 empty <- args[6] |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
20 } |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
21 |
1
06e29cdc08bf
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit 43f3c45c97ba7d09ad1ea19df9e953cfe917dde8
ecology
parents:
0
diff
changeset
|
22 datatable = read.table(data_table,sep="\t",header=T) |
0
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
23 |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
24 latcol = names(datatable[lat_col]) |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
25 longcol = names(datatable[long_col]) |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
26 sitecol = names(datatable[site_col]) |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
27 |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
28 if (empty == "false"){ |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
29 empty = FALSE |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
30 }else if (empty=="true"){ |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
31 empty=TRUE} |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
32 |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
33 |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
34 #Make template |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
35 |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
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) |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
37 |
b34c5a70b706
planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/EMLassemblyline commit f00c48e2a16ba6154e6c1aa50330586eefb13a32
ecology
parents:
diff
changeset
|
38 |