comparison rgedgeRpaired_nocamera.xml @ 122:6ded550dcc7d draft

Uploaded
author fubar
date Sun, 23 Nov 2014 07:18:05 -0500
parents d69a656284f5
children 51f998262ada
comparison
equal deleted inserted replaced
121:d69a656284f5 122:6ded550dcc7d
897 useCols = c(TCols,CCols) 897 useCols = c(TCols,CCols)
898 if (file.exists(Out_Dir) == F) dir.create(Out_Dir) 898 if (file.exists(Out_Dir) == F) dir.create(Out_Dir)
899 Count_Matrix = read.table(Input,header=T,row.names=1,sep='\t') 899 Count_Matrix = read.table(Input,header=T,row.names=1,sep='\t')
900 snames = colnames(Count_Matrix) 900 snames = colnames(Count_Matrix)
901 nsamples = length(snames) 901 nsamples = length(snames)
902 if (nsubj > 0 & nsubj != nsamples) { 902 if (nsubj > 0 & nsubj != nsamples) {
903 options("show.error.messages"=T) 903 options("show.error.messages"=T)
904 mess = paste('Fatal error: Supplied subject id list',paste(subjects,collapse=','), 904 mess = paste('Fatal error: Supplied subject id list',paste(subjects,collapse=','),
905 'has length',nsubj,'but there are',nsamples,'samples',paste(snames,collapse=',')) 905 'has length',nsubj,'but there are',nsamples,'samples',paste(snames,collapse=','))
906 write(mess, stderr()) 906 write(mess, stderr())
907 quit(save="no",status=4) 907 quit(save="no",status=4)
908 } 908 }
909 if (length(subjects) != 0) {subjects = subjects[useCols]} 909 if (length(subjects) != 0) {subjects = subjects[useCols]}
910 Count_Matrix = Count_Matrix[,useCols] ### reorder columns 910 Count_Matrix = Count_Matrix[,useCols]
911 rn = rownames(Count_Matrix) 911 rn = rownames(Count_Matrix)
912 islib = rn %in% c('librarySize','NotInBedRegions') 912 islib = rn %in% c('librarySize','NotInBedRegions')
913 LibSizes = Count_Matrix[subset(rn,islib),][1] # take first 913 LibSizes = Count_Matrix[subset(rn,islib),][1] # take first
914 Count_Matrix = Count_Matrix[subset(rn,! islib),] 914 Count_Matrix = Count_Matrix[subset(rn,! islib),]
915 group = c(rep(TreatmentName,length(TCols)), rep(ControlName,length(CCols)) ) 915 group = c(rep(TreatmentName,length(TCols)), rep(ControlName,length(CCols)) )