Commit b8bafad302138b13b3381aa768c2fe29142fa42c

Authored by Efrain Gonzalez
1 parent 1b7f1377e8
Exists in master

Updated by adding in output for average without zscore

Showing 1 changed file with 66 additions and 24 deletions   Show diff stats
... ... @@ -404,7 +404,26 @@ THEFT <- function(){
404 404 }
405 405 j <- j + 1
406 406 }
407   -
  407 +
  408 +
  409 + ##Outputting non Z-score Average over genes
  410 + newoutput <-NuRDATN
  411 + colnames(newoutput) <- rownames(tabRDATID)
  412 + nfnewout <- strsplit(alz,"[\\]") %>%
  413 + .[[1]] %>%
  414 + .[length(.)] %>%
  415 + gsub("\\D","",.) %>%
  416 + c("GSE",.,"newout.txt") %>%
  417 + paste(collapse = "")
  418 + noutput <- newoutput %>%
  419 + t()%>%
  420 + as.data.frame(.,stringsAsFactors = FALSE)
  421 + noutput <- cbind(rownames(noutput),noutput)
  422 + colnames(noutput) <- c("Gene Symbol",subjnam)
  423 + rownames(noutput) <- NULL
  424 + write.table(noutput, file = nfnewout, sep = "\t",col.names = TRUE,row.names = FALSE)
  425 +
  426 +
408 427 ##Scaling the Data
409 428 scrawdat <- NuRDATN%>%
410 429 scale()
... ... @@ -417,14 +436,17 @@ THEFT &lt;- function(){
417 436 .[[1]] %>%
418 437 .[length(.)] %>%
419 438 gsub("\\D","",.) %>%
420   - c("GSE",.,"zscore.txt") %>%
  439 + c("GSE",.,"avg.txt") %>%
421 440 paste(collapse = "")
422 441 zscraw <- scrawdat %>%
423 442 t()%>%
424 443 as.data.frame(.,stringsAsFactors = FALSE)
425   - colnames(zscraw) <- subjnam
426   - write.table(zscraw, file = nfnzsc, sep = "\t",col.names = TRUE,row.names = TRUE)
427   -
  444 + zscraw <- cbind(rownames(zscraw),zscraw)
  445 + colnames(zscraw) <- c("Gene Symbol",subjnam)
  446 + rownames(zscraw) <- NULL
  447 + write.table(zscraw, file = nfnewout, sep = "\t",col.names = TRUE,row.names = FALSE)
  448 +
  449 +
428 450 ##Discretized the Data
429 451 dialzdat <- scrawdat %>%
430 452 dndat(.) %>%
... ... @@ -706,25 +728,45 @@ THEFT &lt;- function(){
706 728 j <- j + 1
707 729 }
708 730  
709   - ##Scaling the Data
710   - scrawdat <- NuRDATN%>%
711   - scale()
712   - attr(scrawdat,"scaled:center") <- NULL
713   - attr(scrawdat,"scaled:scale") <- NULL
714   - colnames(scrawdat) <- rownames(tabRDATID)
715   -
716   - #Outputting the Z-score file
717   - nfnzsc <- strsplit(alz,"[\\]") %>%
718   - .[[1]] %>%
719   - .[length(.)] %>%
720   - gsub("\\D","",.) %>%
721   - c("GSE",.,"zscore.txt") %>%
722   - paste(collapse = "")
723   - zscraw <- scrawdat %>%
724   - t()%>%
725   - as.data.frame(.,stringsAsFactors = FALSE)
726   - colnames(zscraw) <- subjnam
727   - write.table(zscraw, file = nfnzsc, sep = "\t",col.names = TRUE,row.names = TRUE)
  731 + ##Outputting non Z-score Average over genes
  732 + newoutput <-NuRDATN
  733 + colnames(newoutput) <- rownames(tabRDATID)
  734 + nfnewout <- strsplit(alz,"[\\]") %>%
  735 + .[[1]] %>%
  736 + .[length(.)] %>%
  737 + gsub("\\D","",.) %>%
  738 + c("GSE",.,"avg.txt") %>%
  739 + paste(collapse = "")
  740 + noutput <- newoutput %>%
  741 + t()%>%
  742 + as.data.frame(.,stringsAsFactors = FALSE)
  743 + noutput <- cbind(rownames(noutput),noutput)
  744 + colnames(noutput) <- c("Gene Symbol",subjnam)
  745 + rownames(noutput) <- NULL
  746 + write.table(noutput, file = nfnewout, sep = "\t",col.names = TRUE,row.names = FALSE)
  747 +
  748 +
  749 + ##Scaling the Data
  750 + scrawdat <- NuRDATN%>%
  751 + scale()
  752 + attr(scrawdat,"scaled:center") <- NULL
  753 + attr(scrawdat,"scaled:scale") <- NULL
  754 + colnames(scrawdat) <- rownames(tabRDATID)
  755 +
  756 + #Outputting the Z-score file
  757 + nfnzsc <- strsplit(alz,"[\\]") %>%
  758 + .[[1]] %>%
  759 + .[length(.)] %>%
  760 + gsub("\\D","",.) %>%
  761 + c("GSE",.,"zscore.txt") %>%
  762 + paste(collapse = "")
  763 + zscraw <- scrawdat %>%
  764 + t()%>%
  765 + as.data.frame(.,stringsAsFactors = FALSE)
  766 + zscraw <- cbind(rownames(zscraw),zscraw)
  767 + colnames(zscraw) <- c("Gene Symbol",subjnam)
  768 + rownames(zscraw) <- NULL
  769 + write.table(zscraw, file = nfnewout, sep = "\t",col.names = TRUE,row.names = FALSE)
728 770  
729 771 ##Discretized the Data
730 772 dialzdat <- scrawdat %>%