Browse code

script_cmdline.R - v1

No save function because useless in cmdline, added directly at the end of the script

Fred authored on24/05/2015 23:15:12
Showing1 changed files
1 1
new file mode 100755
... ...
@@ -0,0 +1,89 @@
1
+#!/usr/bin/env Rscript
2
+# Title:
3
+# Version: 
4
+# Author: Frédéric CHEVALIER <fcheval@txbiomedgenetics.org>
5
+# Created in: 2014-0
6
+# Modified in:
7
+
8
+
9
+
10
+#==========#
11
+# Comments #
12
+#==========#
13
+
14
+
15
+
16
+
17
+
18
+#===================#
19
+# Packages required #
20
+#===================#
21
+
22
+# library(getopt)
23
+
24
+
25
+
26
+#===========#
27
+# Functions #
28
+#===========#
29
+
30
+#-------------------------#
31
+# Function to save tables #
32
+#-------------------------#
33
+
34
+save.mytable <- function (x, filename, ext=".tsv", sep="\t", col.names=FALSE, row.names=FALSE, append=FALSE){
35
+	# Folder creation for table output (if does not exist)
36
+	if (file.exists("Results/") == FALSE) {dir.create("Results")}
37
+	
38
+	# Data export
39
+	write.table(x, file=paste("Results/",filename, ext, sep=""), col.names=col.names, row.names=row.names, append=append, sep=sep)
40
+}
41
+
42
+
43
+
44
+#===========#
45
+# Variables #
46
+#===========#
47
+
48
+# Data file
49
+myfile <- ""
50
+mydata <- read.csv(myfile, header=TRUE, sep=";")
51
+
52
+# Object contaning the input file name
53
+filename <- strsplit(myfile,".csv")
54
+
55
+
56
+
57
+#=================#
58
+# Data processing #
59
+#=================#
60
+
61
+
62
+
63
+
64
+
65
+#========#
66
+# Curves #
67
+#========#
68
+
69
+
70
+
71
+
72
+#=========#
73
+# Figures #
74
+#=========#
75
+
76
+
77
+
78
+# Create the graph folder if it do not already exist
79
+if (file.exists("Graphs/") == FALSE) {dir.create("Graphs")}
80
+
81
+pdf(file=paste("Graphs/", name, ".pdf", sep="")
82
+
83
+# Draw graph here
84
+
85
+dev.off()
86
+
87
+
88
+
89
+