sub script of MainPipelineScript: counts Image folders and sub folders and return...
authorUnknown Author <unknown>
Tue, 5 Aug 2008 23:10:12 +0000 (23:10 +0000)
committerUnknown Author <unknown>
Tue, 5 Aug 2008 23:10:12 +0000 (23:10 +0000)
htswdataprod/scripts/CheckImageFolders [new file with mode: 0755]

diff --git a/htswdataprod/scripts/CheckImageFolders b/htswdataprod/scripts/CheckImageFolders
new file mode 100755 (executable)
index 0000000..8e063c8
--- /dev/null
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+# -- Check Image folders and find out cycle number ---------------------                                                                                                                                                               
+
+# -- Get the num of cycles from L001
+if [ ! -d Images/L001 ]
+then
+  echo "ERROR_L001_not_found."
+  exit 127 
+fi
+c=1
+while [ -d Images/L001/C$c.1 ] && [ $c -le 36 ]
+do
+ c=`expr $c +  1`
+done
+
+toC_1=`expr $c -  1`
+
+## echo "DUBUG INFO: Found $toC_1 folders in L001"
+##--- Now compare each of the other lanes 2 - 8 to C1
+NumCycles=0
+for ((  l = 2 ;  l <= 8;  l++  ))
+do
+  ## echo "lane folder $l"
+  if [ -d Images/L00$l ]
+  then
+    c=1
+    while  [ -d Images/L00$l/C$c.1 ] && [ $c -le 36 ]
+    do 
+      NumCycles=$c
+      c=`expr $c +  1`
+    done
+    ## Check
+    if [ $NumCycles != $toC_1 ]
+    then 
+        echo "ERROR_Num_Of_Cycles_in_$l_is_not_$toC_1"
+        exit 127
+    fi
+  else
+    echo "Img_folder_L00$l_not_found"
+    exit 127
+  fi
+done
+
+tocycle=$toC_1
+echo $tocycle
+exit
\ No newline at end of file