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

Uploaded
author taoufik
date Sat, 26 Jan 2019 19:38:59 -0500
parents ea02d47cd0c2
children
line wrap: on
line source

log_file=file("Read_Dataset.log", open = "wt")
sink(log_file)
sink(log_file, type = "out") 
suppressWarnings(suppressMessages(library("batch")))
suppressWarnings(suppressMessages(library(data.table)))
listArguments = parseCommandArgs(evaluate=FALSE)
datasetsource = listArguments[["datasetsource"]]

training=fread(datasetsource,header = T)
training1=fread(datasetsource,header = T)
training=as.matrix(training)
training=training[,-1]
rownames(training)<-training1$V1
training=t(training)
training=training[,-c(4,7)]
tp=training[,4]
tr=training[,5]
tp[tp=="6HR"]<-0
tp[tp=="24HR"]<-1
tr[tr=="DHA"]<-0
tr[tr=="UT"]<-1
training[,4]=tp
training[,5]=tr
fwrite(
  as.data.frame(training),"Format_Dream.tsv",sep="\t"
)