diff ab-index.R @ 0:e2bff90af491 draft default tip

planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/regionalgam commit ffe42225fff8992501b743ebe2c78e50fddc4a4e
author ecology
date Thu, 20 Jun 2019 04:04:19 -0400
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ab-index.R	Thu Jun 20 04:04:19 2019 -0400
@@ -0,0 +1,14 @@
+#!/usr/bin/env Rscript
+
+args = commandArgs(trailingOnly=TRUE)
+source(args[1])
+
+
+tryCatch({input = read.table(args[2], header=TRUE,sep=" ")},finally={input = read.table(args[2], header=TRUE,sep=",")})
+pheno = read.table(args[3], header=TRUE,sep="	")
+
+if("TREND" %in% colnames(input)){
+    input <- input[input$TREND==1,c("SPECIES","SITE","YEAR","MONTH","DAY","COUNT")]
+}
+data.index <- abundance_index(input, pheno)
+write.table(data.index, file="data.index", row.names=FALSE, sep="	")