comparison taxo_cov_template.R @ 2:8a697f446051 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:50:00 +0000
parents
children
comparison
equal deleted inserted replaced
1:9d56f6480194 2:8a697f446051
1 #28/11/2023
2 #Seguineau Pauline
3 #Make taxonomic coverage template
4
5 #Load packages
6
7 library(EMLassemblyline)
8
9 #Load arguments
10
11 args = commandArgs(trailingOnly=TRUE)
12 if(length(args)>0){
13 data_taxa <- args[1]
14 taxa_table <- args[2]
15 taxa_col <- as.numeric(args[3])
16 taxa_name_type <- args[4]
17 authority <- as.numeric(args[5])
18 authority2 <- as.numeric(args[6])
19 authority3 <- as.numeric(args[7])
20 empty <- args[8]
21 }
22
23 #transfom arguments
24 taxatable = read.table(data_taxa,header=T,sep="\t")
25 taxacol = names(taxatable[taxa_col])
26
27 if (authority2 == 0 && authority3==0){
28 authority_f = authority}
29
30 if(authority2 == 0 && authority3 != 0){
31 authority_f = c(authority,authority3)}
32
33 if (authority2 !=0 && authority3==0){
34 authority_f = c(authority,authority2)}
35
36 if (authority3 !=0 && authority2 !=0){
37 authority_f = c(authority,authority2,authority3)}
38
39 if (empty == "false"){
40 empty = FALSE
41 }else if (empty=="true"){
42 empty=TRUE}
43
44
45 #Make template
46
47 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)