annotate FormatDream.R @ 3:6978113c6053 draft default tip

Uploaded
author taoufik
date Sat, 26 Jan 2019 19:38:59 -0500
parents ea02d47cd0c2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
7c746038ed87 Uploaded
taoufik
parents:
diff changeset
1 log_file=file("Read_Dataset.log", open = "wt")
7c746038ed87 Uploaded
taoufik
parents:
diff changeset
2 sink(log_file)
7c746038ed87 Uploaded
taoufik
parents:
diff changeset
3 sink(log_file, type = "out")
7c746038ed87 Uploaded
taoufik
parents:
diff changeset
4 suppressWarnings(suppressMessages(library("batch")))
7c746038ed87 Uploaded
taoufik
parents:
diff changeset
5 suppressWarnings(suppressMessages(library(data.table)))
7c746038ed87 Uploaded
taoufik
parents:
diff changeset
6 listArguments = parseCommandArgs(evaluate=FALSE)
7c746038ed87 Uploaded
taoufik
parents:
diff changeset
7 datasetsource = listArguments[["datasetsource"]]
7c746038ed87 Uploaded
taoufik
parents:
diff changeset
8
7c746038ed87 Uploaded
taoufik
parents:
diff changeset
9 training=fread(datasetsource,header = T)
7c746038ed87 Uploaded
taoufik
parents:
diff changeset
10 training1=fread(datasetsource,header = T)
7c746038ed87 Uploaded
taoufik
parents:
diff changeset
11 training=as.matrix(training)
7c746038ed87 Uploaded
taoufik
parents:
diff changeset
12 training=training[,-1]
7c746038ed87 Uploaded
taoufik
parents:
diff changeset
13 rownames(training)<-training1$V1
7c746038ed87 Uploaded
taoufik
parents:
diff changeset
14 training=t(training)
7c746038ed87 Uploaded
taoufik
parents:
diff changeset
15 training=training[,-c(4,7)]
3
6978113c6053 Uploaded
taoufik
parents: 2
diff changeset
16 tp=training[,4]
6978113c6053 Uploaded
taoufik
parents: 2
diff changeset
17 tr=training[,5]
6978113c6053 Uploaded
taoufik
parents: 2
diff changeset
18 tp[tp=="6HR"]<-0
6978113c6053 Uploaded
taoufik
parents: 2
diff changeset
19 tp[tp=="24HR"]<-1
6978113c6053 Uploaded
taoufik
parents: 2
diff changeset
20 tr[tr=="DHA"]<-0
6978113c6053 Uploaded
taoufik
parents: 2
diff changeset
21 tr[tr=="UT"]<-1
6978113c6053 Uploaded
taoufik
parents: 2
diff changeset
22 training[,4]=tp
6978113c6053 Uploaded
taoufik
parents: 2
diff changeset
23 training[,5]=tr
1
7c746038ed87 Uploaded
taoufik
parents:
diff changeset
24 fwrite(
7c746038ed87 Uploaded
taoufik
parents:
diff changeset
25 as.data.frame(training),"Format_Dream.tsv",sep="\t"
7c746038ed87 Uploaded
taoufik
parents:
diff changeset
26 )
7c746038ed87 Uploaded
taoufik
parents:
diff changeset
27
7c746038ed87 Uploaded
taoufik
parents:
diff changeset
28
7c746038ed87 Uploaded
taoufik
parents:
diff changeset
29
7c746038ed87 Uploaded
taoufik
parents:
diff changeset
30
7c746038ed87 Uploaded
taoufik
parents:
diff changeset
31
7c746038ed87 Uploaded
taoufik
parents:
diff changeset
32
7c746038ed87 Uploaded
taoufik
parents:
diff changeset
33
7c746038ed87 Uploaded
taoufik
parents:
diff changeset
34