annotate flight_curve.R @ 2:0e7066603eab draft default tip

Uploaded
author mnhn65mo
date Mon, 06 Aug 2018 04:45:49 -0400
parents 5b126f770671
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
5b126f770671 Uploaded
mnhn65mo
parents:
diff changeset
1 #!/usr/bin/env Rscript
5b126f770671 Uploaded
mnhn65mo
parents:
diff changeset
2 #library('getopt')
5b126f770671 Uploaded
mnhn65mo
parents:
diff changeset
3 #library(devtools)
5b126f770671 Uploaded
mnhn65mo
parents:
diff changeset
4
5b126f770671 Uploaded
mnhn65mo
parents:
diff changeset
5 args = commandArgs(trailingOnly=TRUE)
5b126f770671 Uploaded
mnhn65mo
parents:
diff changeset
6 source(args[1]) #TODO replace by library(regionalGAM) if available as official package from bioconda
5b126f770671 Uploaded
mnhn65mo
parents:
diff changeset
7
5b126f770671 Uploaded
mnhn65mo
parents:
diff changeset
8 tryCatch({input = read.table(args[2], header=TRUE,sep=" ")},finally={input = read.table(args[2], header=TRUE,sep=",")})
5b126f770671 Uploaded
mnhn65mo
parents:
diff changeset
9 dataset1 <- input[,c("SPECIES","SITE","YEAR","MONTH","DAY","COUNT")]
5b126f770671 Uploaded
mnhn65mo
parents:
diff changeset
10 pheno <- flight_curve(dataset1)
5b126f770671 Uploaded
mnhn65mo
parents:
diff changeset
11
5b126f770671 Uploaded
mnhn65mo
parents:
diff changeset
12 write.table(pheno, file="pheno", row.names=FALSE, sep=" ")