From da758df454781c9b5a48d30b9aaf7c8e4e994cf5 Mon Sep 17 00:00:00 2001 From: Efrain Gonzalez Date: Tue, 20 Feb 2018 13:47:06 -0500 Subject: [PATCH] Updated outputting new file: average before z-score --- RCleanDscret.R | 61 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 41 insertions(+), 20 deletions(-) diff --git a/RCleanDscret.R b/RCleanDscret.R index f05f745..c311a3c 100644 --- a/RCleanDscret.R +++ b/RCleanDscret.R @@ -400,26 +400,47 @@ for(j in 1:length(tabRDATID)){ j <- j + 1 } -##Scaling the Data -scrawdat <- NuRDATN%>% - scale() -attr(scrawdat,"scaled:center") <- NULL -attr(scrawdat,"scaled:scale") <- NULL -colnames(scrawdat) <- rownames(tabRDATID) - -#Outputting the Z-score file -nfnzsc <- strsplit(alz,"[\\]") %>% - .[[1]] %>% - .[length(.)] %>% - gsub("\\D","",.) %>% - c("GSE",.,"zscore.txt") %>% - paste(collapse = "") -zscraw <- scrawdat %>% - t()%>% - as.data.frame(.,stringsAsFactors = FALSE) -colnames(zscraw) <- subjnam -write.table(zscraw, file = nfnzsc, sep = "\t",col.names = TRUE,row.names = TRUE) - +##Outputting non Z-score Average over genes + newoutput <-NuRDATN + colnames(newoutput) <- rownames(tabRDATID) + nfnewout <- strsplit(alz,"[\\]") %>% + .[[1]] %>% + .[length(.)] %>% + gsub("\\D","",.) %>% + c("GSE",.,"avg.txt") %>% + paste(collapse = "") + noutput <- newoutput %>% + t()%>% + as.data.frame(.,stringsAsFactors = FALSE) + noutput <- cbind(rownames(noutput),noutput) + colnames(noutput) <- c("Gene Symbol",subjnam) + rownames(noutput) <- NULL + write.table(noutput, file = nfnewout, sep = "\t",col.names = TRUE,row.names = FALSE) + + + ##Scaling the Data + scrawdat <- NuRDATN%>% + scale() + attr(scrawdat,"scaled:center") <- NULL + attr(scrawdat,"scaled:scale") <- NULL + colnames(scrawdat) <- rownames(tabRDATID) + + #Outputting the Z-score file + nfnzsc <- strsplit(alz,"[\\]") %>% + .[[1]] %>% + .[length(.)] %>% + gsub("\\D","",.) %>% + c("GSE",.,"zscore.txt") %>% + paste(collapse = "") + zscraw <- scrawdat %>% + t()%>% + as.data.frame(.,stringsAsFactors = FALSE) + zscraw <- cbind(rownames(zscraw),zscraw) + colnames(zscraw) <- c("Gene Symbol",subjnam) + rownames(zscraw) <- NULL + write.table(zscraw, file = nfnewout, sep = "\t",col.names = TRUE,row.names = FALSE) + + ##Discretized the Data dialzdat <- scrawdat %>% dndat(.) %>% -- 2.29.0