[Patchwork-commits] r191 - pkg/TAPS/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Sep 24 14:51:34 CEST 2013


Author: sebastian_d
Date: 2013-09-24 14:51:34 +0200 (Tue, 24 Sep 2013)
New Revision: 191

Modified:
   pkg/TAPS/R/TAPS.r
Log:
update to datasamples.xlsx handling for different drive modes

Modified: pkg/TAPS/R/TAPS.r
===================================================================
--- pkg/TAPS/R/TAPS.r	2013-09-23 11:57:32 UTC (rev 190)
+++ pkg/TAPS/R/TAPS.r	2013-09-24 12:51:34 UTC (rev 191)
@@ -46,6 +46,7 @@
     setwd(directory)
     subs <- getSubdirs()
     subs=subs[subs!='frequencies' & subs!='frequencies_comp']
+    subsToSampleData=NULL
     if (is.null(subs)) {                                         ## check samples = subdirectories or a single sample = current directory
         subs=thisSubdir()
         setwd('..')
@@ -54,7 +55,14 @@
     
    # create SampleData file if there is none.   
     if (length(grep('SampleData.xlsx',dir()))==0) {
-        sampleData <- data.frame(Sample=subsToSampleData,cn1= -0.5, cn2=0, cn3=NA, loh=0.7, MAPD=NA, MHOF=NA)
+        if(!is.null(subsToSampleData))
+            {
+            sampleData <- data.frame(Sample=subsToSampleData,cn1= -0.5, cn2=0, cn3=NA, loh=0.7, MAPD=NA, MHOF=NA)
+            }
+        else
+            {
+            sampleData <- data.frame(Sample=subs,cn1= -0.5, cn2=0, cn3=NA, loh=0.7, MAPD=NA, MHOF=NA)
+            }
         write.xlsx(sampleData,'SampleData.xlsx',row.names=F)
     } else {
         sampleData=read.xlsx('SampleData.xlsx',1)



More information about the Patchwork-commits mailing list