updated paths
authorUnknown Author <unknown>
Tue, 5 Aug 2008 23:00:03 +0000 (23:00 +0000)
committerUnknown Author <unknown>
Tue, 5 Aug 2008 23:00:03 +0000 (23:00 +0000)
htswdataprod/scripts/MainPipelineScript

index b0c0602d79e8e5704a427fdb166b59c11aac8e59..e172a8ffe6340d8694a637a22ead62c7b78af9c7 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
-# Last updated: Jul/30/2008 By Rami
-#---------------------------------
+# Last updated: Jul/31/2008 By Rami
+# ---------------------------------
 # Main Desc: Top level wrapper script for the whole Data pipeline after sequencing is done until data analysis. 
 # Start: Read current folder as input Run Folder (ex: 080220_HWI-FC2057U).
 # This scripts assumes that:
@@ -46,12 +46,14 @@ if [ -d ExpTrackLog ]
 else mkdir ExpTrackLog
 fi
 
-exptrackmainsc="$HOME/EXPTRACK/exp_track_main.py"
+#exptrackmainsc="$HOME/EXPTRACK/exp_track_main.py"
+exptrackmainsc="exp_track_main.py"
 # -- Check Image folders and find out cycle number 
-tocycle=`$HOME/EXPTRACK/CheckImageFolders`
+#tocycle=`$HOME/EXPTRACK/CheckImageFolders`
+tocycle=`CheckImageFolders`
 
 ## Uncomment this if you want to force a cycle number:
-##tocycle=36
+tocycle=36
 
 if [ $tocycle -gt 0 ] && [ $tocycle -lt 37 ]
 then echo "" 
@@ -76,7 +78,7 @@ echo "Run Folder: $runfolder"
 echo "FlowcellId: $fcid"
 echo "------------------------------------------------------"
 echo "Config File generation"
-rm config.txt
+#rm config.txt
 python $exptrackmainsc getconfile $fcid $runfolder
 if [ -f config.txt ]
 then 
@@ -90,7 +92,7 @@ echo ""
 echo "------------------------------------------------------"
 echo "LaneNames.xml file generation: "
 echo ""
-rm LaneNames.xml
+#rm LaneNames.xml
 python $exptrackmainsc getLanesNames $fcid
 if [ -f LaneNames.xml ]
 then
@@ -128,6 +130,73 @@ then echo "Proceeding .."
 else echo "Response: "$confirm; exit
 fi
 ###### START PROCESS
+
+## First check if this is a run from scratch or from Bustard or Gerald ~~~~~
+firecrestdir=`ls Data | grep "^C1-$tocycle.*_Firecrest.*"`
+firecrestfinished=Data/$firecrestdir/finished.txt
+bustfinished=Data/$firecrestdir/Bustard*_*/finished.txt
+gerfinished=Data/$firecrestdir/Bustard*_*/GERALD_*/finished.txt
+phaseMsg=''
+nextDo='all'
+
+if [ -f $firecrestfinished ] 
+then
+  phaseMsg='Firecrest Finished (found finished.txt). Start from BUSTARD? [Yes/[Any Key]] (Enter [Any Key] to Start from scratch)'
+  nextDo='Bustard'
+  if [ -f $bustfinished ]
+  then 
+    phaseMsg='Bustard Finished (found finished.txt). Start from GERALD? [Yes/[Any Key]] (Enter [Any Key] to Start from scratch)'
+    nextDo='Gerald'
+    if [ -f $gerfinished ]
+    then
+      phaseMsg='It seems like Solexa pipeline has completed (found all 3 finished.txt files). Procees to next steps (CollectReads etc..)? [Yes/[Any Key]] (Enter [Any Key] to Start from scratch)'
+      nextDo='next'
+    fi
+  fi
+else
+  echo "Finished.txt not found: $firecrestfinished" 
+fi
+
+echo $phaseMsg 
+if [ $nextDo == "all" ]
+then 
+  echo ""
+else
+  confirm=''
+  read confirm
+  if [ $confirm == "Yes" ]
+  then 
+    #Launch MPListener in the background 
+    #$HOME/EXPTRACK/MPListener $fcid $runfolder $tocycle &
+    MPListener $fcid $runfolder $tocycle & 
+    if [ $nextDxo == "Bustard" ]
+    then
+      #Change dir down to Bustard run folder
+      echo "Changing dir to Data/$firecrestdir/Bustard*_*/"
+      cd Data/$firecrestdir/Bustard*_*
+      echo "Starting Solexa data process (`date`) FROM BUSTARD ..."
+      python $exptrackmainsc updsts $fcid $runfolder 1 From_BUSTARD
+      make -j 8 recursive
+      ## MPListner takes care of the rest 
+    else 
+      if [ $nextDxo == "Gerald" ]
+      then
+        #Change dir down to Bustard run folder    
+        echo "Changing dir to Data/$firecrestdir/Bustard*_*/Gerald..."
+        cd Data/$firecrestdir/Bustard*_*/GERALD_*
+        echo "Starting Solexa data process (`date`) FROM GERALD ..."
+        python $exptrackmainsc updsts $fcid $runfolder 1 From_GERALD
+        make -j 8
+        ## MPListner takes care of the rest
+      fi
+    fi
+    exit 
+  fi
+fi 
+### ~~~~~~~~  
+
+
+
 if [ -f ExpTrackLog/OK_get_check_config_file ]
  then
   echo "Ready for Make file generation step"
@@ -168,7 +237,8 @@ germakefile=Data/$firecrestdir/Bustard*_*/GERALD_*/Makefile
 if [ -f $firemakefile ] && [ -f $bustmakefile ] && [ -f $germakefile ]
 then 
  #Launch MPListener in the background 
- $HOME/EXPTRACK/MPListener $fcid $runfolder $tocycle &
+ #$HOME/EXPTRACK/MPListener $fcid $runfolder $tocycle &
+ MPListener $fcid $runfolder $tocycle & 
  #Change dir down 2 folders to the Firecrest folder
  echo "Changing dir to Data/$firecrestdir"
  cd Data/$firecrestdir