annotate flight-curve.R @ 0:f3e1b6d244a6 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:03:57 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
f3e1b6d244a6 planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/regionalgam commit ffe42225fff8992501b743ebe2c78e50fddc4a4e
ecology
parents:
diff changeset
1 #!/usr/bin/env Rscript
f3e1b6d244a6 planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/regionalgam commit ffe42225fff8992501b743ebe2c78e50fddc4a4e
ecology
parents:
diff changeset
2 args = commandArgs(trailingOnly=TRUE)
f3e1b6d244a6 planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/regionalgam commit ffe42225fff8992501b743ebe2c78e50fddc4a4e
ecology
parents:
diff changeset
3 source(args[1]) #TODO replace by library(regionalGAM) if available as official package from bioconda
f3e1b6d244a6 planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/regionalgam commit ffe42225fff8992501b743ebe2c78e50fddc4a4e
ecology
parents:
diff changeset
4 tryCatch({input = read.table(args[2], header=TRUE,sep=" ")},finally={input = read.table(args[2], header=TRUE,sep=",")})
f3e1b6d244a6 planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/regionalgam commit ffe42225fff8992501b743ebe2c78e50fddc4a4e
ecology
parents:
diff changeset
5 dataset1 <- input[,c("SPECIES", "SITE", "YEAR", "MONTH", "DAY", "COUNT")]
f3e1b6d244a6 planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/regionalgam commit ffe42225fff8992501b743ebe2c78e50fddc4a4e
ecology
parents:
diff changeset
6 pheno <- flight_curve(dataset1, MinVisit = args[3], MinOccur = args[4])
f3e1b6d244a6 planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/regionalgam commit ffe42225fff8992501b743ebe2c78e50fddc4a4e
ecology
parents:
diff changeset
7
f3e1b6d244a6 planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/regionalgam commit ffe42225fff8992501b743ebe2c78e50fddc4a4e
ecology
parents:
diff changeset
8 write.table(pheno, file="pheno", row.names=FALSE, sep=" ")