Commit da758df454781c9b5a48d30b9aaf7c8e4e994cf5
1 parent
b8bafad302
Exists in
master
Updated outputting new file: average before z-score
Showing
1 changed file
with
41 additions
and
20 deletions
Show diff stats
RCleanDscret.R
... | ... | @@ -400,26 +400,47 @@ for(j in 1:length(tabRDATID)){ |
400 | 400 | j <- j + 1 |
401 | 401 | } |
402 | 402 | |
403 | -##Scaling the Data | |
404 | -scrawdat <- NuRDATN%>% | |
405 | - scale() | |
406 | -attr(scrawdat,"scaled:center") <- NULL | |
407 | -attr(scrawdat,"scaled:scale") <- NULL | |
408 | -colnames(scrawdat) <- rownames(tabRDATID) | |
409 | - | |
410 | -#Outputting the Z-score file | |
411 | -nfnzsc <- strsplit(alz,"[\\]") %>% | |
412 | - .[[1]] %>% | |
413 | - .[length(.)] %>% | |
414 | - gsub("\\D","",.) %>% | |
415 | - c("GSE",.,"zscore.txt") %>% | |
416 | - paste(collapse = "") | |
417 | -zscraw <- scrawdat %>% | |
418 | - t()%>% | |
419 | - as.data.frame(.,stringsAsFactors = FALSE) | |
420 | -colnames(zscraw) <- subjnam | |
421 | -write.table(zscraw, file = nfnzsc, sep = "\t",col.names = TRUE,row.names = TRUE) | |
422 | - | |
403 | +##Outputting non Z-score Average over genes | |
404 | + newoutput <-NuRDATN | |
405 | + colnames(newoutput) <- rownames(tabRDATID) | |
406 | + nfnewout <- strsplit(alz,"[\\]") %>% | |
407 | + .[[1]] %>% | |
408 | + .[length(.)] %>% | |
409 | + gsub("\\D","",.) %>% | |
410 | + c("GSE",.,"avg.txt") %>% | |
411 | + paste(collapse = "") | |
412 | + noutput <- newoutput %>% | |
413 | + t()%>% | |
414 | + as.data.frame(.,stringsAsFactors = FALSE) | |
415 | + noutput <- cbind(rownames(noutput),noutput) | |
416 | + colnames(noutput) <- c("Gene Symbol",subjnam) | |
417 | + rownames(noutput) <- NULL | |
418 | + write.table(noutput, file = nfnewout, sep = "\t",col.names = TRUE,row.names = FALSE) | |
419 | + | |
420 | + | |
421 | + ##Scaling the Data | |
422 | + scrawdat <- NuRDATN%>% | |
423 | + scale() | |
424 | + attr(scrawdat,"scaled:center") <- NULL | |
425 | + attr(scrawdat,"scaled:scale") <- NULL | |
426 | + colnames(scrawdat) <- rownames(tabRDATID) | |
427 | + | |
428 | + #Outputting the Z-score file | |
429 | + nfnzsc <- strsplit(alz,"[\\]") %>% | |
430 | + .[[1]] %>% | |
431 | + .[length(.)] %>% | |
432 | + gsub("\\D","",.) %>% | |
433 | + c("GSE",.,"zscore.txt") %>% | |
434 | + paste(collapse = "") | |
435 | + zscraw <- scrawdat %>% | |
436 | + t()%>% | |
437 | + as.data.frame(.,stringsAsFactors = FALSE) | |
438 | + zscraw <- cbind(rownames(zscraw),zscraw) | |
439 | + colnames(zscraw) <- c("Gene Symbol",subjnam) | |
440 | + rownames(zscraw) <- NULL | |
441 | + write.table(zscraw, file = nfnewout, sep = "\t",col.names = TRUE,row.names = FALSE) | |
442 | + | |
443 | + | |
423 | 444 | ##Discretized the Data |
424 | 445 | dialzdat <- scrawdat %>% |
425 | 446 | dndat(.) %>% |