annotate tab2csv.R @ 0:659820e2aa61 draft

Uploaded
author mnhn65mo
date Wed, 08 Aug 2018 06:23:04 -0400
parents
children f1b7d0032530
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
659820e2aa61 Uploaded
mnhn65mo
parents:
diff changeset
1 #!/usr/bin/env Rscript
659820e2aa61 Uploaded
mnhn65mo
parents:
diff changeset
2 #Read csv - return tabular
659820e2aa61 Uploaded
mnhn65mo
parents:
diff changeset
3 #2 Options for now : sep an header
659820e2aa61 Uploaded
mnhn65mo
parents:
diff changeset
4
659820e2aa61 Uploaded
mnhn65mo
parents:
diff changeset
5 args = commandArgs(trailingOnly=TRUE)
659820e2aa61 Uploaded
mnhn65mo
parents:
diff changeset
6
659820e2aa61 Uploaded
mnhn65mo
parents:
diff changeset
7 if(args[3]=="TRUE"){
659820e2aa61 Uploaded
mnhn65mo
parents:
diff changeset
8 tabular<-read.table(args[1],sep="\t",header=TRUE)
659820e2aa61 Uploaded
mnhn65mo
parents:
diff changeset
9 write.tale(tabular,"out.csv",sep=args[2],row.names=FALSE)
659820e2aa61 Uploaded
mnhn65mo
parents:
diff changeset
10 }else{
659820e2aa61 Uploaded
mnhn65mo
parents:
diff changeset
11 tabular<-read.table(args[1],sep="\t",header=FALSE)
659820e2aa61 Uploaded
mnhn65mo
parents:
diff changeset
12 write.table(tabular,"out.csv",sep=args[2],col.names=FALSE,row.names=FALSE)
659820e2aa61 Uploaded
mnhn65mo
parents:
diff changeset
13 }
659820e2aa61 Uploaded
mnhn65mo
parents:
diff changeset
14