Skip to content
Snippets Groups Projects

Fix output folders

Merged Gervaise Henry requested to merge develop into master
Compare and
3 files
+ 33
33
Preferences
File browser
Compare changes
+ 28
28
@@ -64,18 +64,18 @@ shinyServer(
n = length(cancer.list) + 1
for(i in cancer.list){
incProgress(1/n, detail = paste0("collating data ", count, " of ", length(cancer.list)))
if(!file.exists(paste0("../Expression/out_genes/",gene,"/",i,".txt"))){
if(!file.exists(paste0("../output/Expression/out_genes/",gene,"/",i,".txt"))){
cat("File not present\n")
if(!dir.exists(paste0("../Expression/out_genes/",gene))){
system(paste0("mkdir ../Expression/out_genes/",gene))
if(!dir.exists(paste0("../output/Expression/out_genes/",gene))){
system(paste0("mkdir ../output/Expression/out_genes/",gene))
cat("Made directory\n")
}
system(paste0("ls ../Expression/*",i,"*txt | while read line ; do fname=$(basename $line); head -1 $line > ../Expression/out_genes/",
gene,"/","$fname; grep -wi ",gene," $line >> ../Expression/out_genes/",gene,"/","$fname;done"))
system(paste0("ls ../output/Expression/*",i,"*txt | while read line ; do fname=$(basename $line); head -1 $line > ../output/Expression/out_genes/",
gene,"/","$fname; grep -wi ",gene," $line >> ../output/Expression/out_genes/",gene,"/","$fname;done"))
cat("creating data\n")
}
temp <- as.data.frame(t(read.table(paste("../Expression/out_genes/",gene,"/",i,".txt",sep=""),header=T,sep="\t",row.names=1)))
temp <- as.data.frame(t(read.table(paste("../output/Expression/out_genes/",gene,"/",i,".txt",sep=""),header=T,sep="\t",row.names=1)))
temp$type <- as.factor(ifelse(grepl("11",row.names(temp)),"Normal","Tumor"))
temp$cancer <- rep(i,nrow(temp))
if(ncol(temp)<3 | length(unique(temp$type))<2){
@@ -125,22 +125,22 @@ shinyServer(
incProgress(1/n, detail = "Getting expression data")
#Import Expression and Clinical Data
cat(paste0("going to read expression ",cancer,"\n"))
if(!file.exists(paste0("../Expression/out_genes/",gene,"/",cancer,".txt"))){
if(!file.exists(paste0("../output/Expression/out_genes/",gene,"/",cancer,".txt"))){
cat("File not present\n")
if(!dir.exists(paste0("../Expression/out_genes/",gene))){
system(paste0("mkdir ../Expression/out_genes/",gene))
if(!dir.exists(paste0("../output/Expression/out_genes/",gene))){
system(paste0("mkdir ../output/Expression/out_genes/",gene))
cat("Made directory\n")
}
system(paste0("ls ../Expression/*",cancer,"*txt | while read line ; do fname=$(basename $line); head -1 $line > ../Expression/out_genes/",
gene,"/","$fname; grep -wi ",gene," $line >> ../Expression/out_genes/",gene,"/","$fname;done"))
system(paste0("ls ../output/Expression/*",cancer,"*txt | while read line ; do fname=$(basename $line); head -1 $line > ../output/Expression/out_genes/",
gene,"/","$fname; grep -wi ",gene," $line >> ../output/Expression/out_genes/",gene,"/","$fname;done"))
cat("creating data\n")
}
exp <- read.table(paste0("../Expression/out_genes/",gene,"/",cancer,".txt"),header=T,row.names=1,check.names=F)
#exp <- read.table(paste0("../Expression/",cancer,".txt"),header=T,row.names=1,check.names=F) #Instead of importing entire expression matrix should import single gene.
exp <- read.table(paste0("../output/Expression/out_genes/",gene,"/",cancer,".txt"),header=T,row.names=1,check.names=F)
#exp <- read.table(paste0("../output/Expression/",cancer,".txt"),header=T,row.names=1,check.names=F) #Instead of importing entire expression matrix should import single gene.
cat("going to read clinical data\n")
incProgress(1/n, detail = "Getting clinical data")
clinical <- read.table(paste("../Clinical/",cancer,".txt",sep=""),header=T,row.names=1,sep="\t")
clinical <- read.table(paste("../output/Clinical/",cancer,".txt",sep=""),header=T,row.names=1,sep="\t")
#Process Clinical
@@ -291,18 +291,18 @@ shinyServer(
n = length(cancer.list) + 1
for(i in cancer.list){
#incProgress(1/n, detail = paste0("collating data ", count, " of ", length(cancer.list)))
if(!file.exists(paste0("../Expression/out_genes/",gene,"/",i,".txt"))){
if(!file.exists(paste0("../output/Expression/out_genes/",gene,"/",i,".txt"))){
cat("File not present\n")
if(!dir.exists(paste0("../Expression/out_genes/",gene))){
system(paste0("mkdir ../Expression/out_genes/",gene))
if(!dir.exists(paste0("../output/Expression/out_genes/",gene))){
system(paste0("mkdir ../output/Expression/out_genes/",gene))
cat("Made directory\n")
}
system(paste0("ls ../Expression/*",i,"*txt | while read line ; do fname=$(basename $line); head -1 $line > ../Expression/out_genes/",
gene,"/","$fname; grep -wi ",gene," $line >> ../Expression/out_genes/",gene,"/","$fname;done"))
system(paste0("ls ../output/Expression/*",i,"*txt | while read line ; do fname=$(basename $line); head -1 $line > ../output/Expression/out_genes/",
gene,"/","$fname; grep -wi ",gene," $line >> ../output/Expression/out_genes/",gene,"/","$fname;done"))
cat("creating data\n")
}
temp <- as.data.frame(t(read.table(paste("../Expression/out_genes/",gene,"/",i,".txt",sep=""),header=T,sep="\t",row.names=1)))
temp <- as.data.frame(t(read.table(paste("../output/Expression/out_genes/",gene,"/",i,".txt",sep=""),header=T,sep="\t",row.names=1)))
temp$type <- as.factor(ifelse(grepl("11",row.names(temp)),"Normal","Tumor"))
temp$cancer <- rep(i,nrow(temp))
if(ncol(temp)<3 | length(unique(temp$type))<2){
@@ -352,22 +352,22 @@ shinyServer(
#incProgress(1/n, detail = "Getting expression data")
#Import Expression and Clinical Data
cat(paste0("going to read expression ",cancer,"\n"))
if(!file.exists(paste0("../Expression/out_genes/",gene,"/",cancer,".txt"))){
if(!file.exists(paste0("../output/Expression/out_genes/",gene,"/",cancer,".txt"))){
cat("File not present\n")
if(!dir.exists(paste0("../Expression/out_genes/",gene))){
system(paste0("mkdir ../Expression/out_genes/",gene))
if(!dir.exists(paste0("../output/Expression/out_genes/",gene))){
system(paste0("mkdir ../output/Expression/out_genes/",gene))
cat("Made directory\n")
}
system(paste0("ls ../Expression/*",cancer,"*txt | while read line ; do fname=$(basename $line); head -1 $line > ../Expression/out_genes/",
gene,"/","$fname; grep -wi ",gene," $line >> ../Expression/out_genes/",gene,"/","$fname;done"))
system(paste0("ls ../output/Expression/*",cancer,"*txt | while read line ; do fname=$(basename $line); head -1 $line > ../output/Expression/out_genes/",
gene,"/","$fname; grep -wi ",gene," $line >> ../output/Expression/out_genes/",gene,"/","$fname;done"))
cat("creating data\n")
}
exp <- read.table(paste0("../Expression/out_genes/",gene,"/",cancer,".txt"),header=T,row.names=1,check.names=F)
#exp <- read.table(paste0("../Expression/",cancer,".txt"),header=T,row.names=1,check.names=F) #Instead of importing entire expression matrix should import single gene.
exp <- read.table(paste0("../output/Expression/out_genes/",gene,"/",cancer,".txt"),header=T,row.names=1,check.names=F)
#exp <- read.table(paste0("../output/Expression/",cancer,".txt"),header=T,row.names=1,check.names=F) #Instead of importing entire expression matrix should import single gene.
cat("going to read clinical data\n")
#incProgress(1/n, detail = "Getting clinical data")
clinical <- read.table(paste("../Clinical/",cancer,".txt",sep=""),header=T,row.names=1,sep="\t")
clinical <- read.table(paste("../output/Clinical/",cancer,".txt",sep=""),header=T,row.names=1,sep="\t")
#Process Clinical