#!/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:
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 ""
echo "FlowcellId: $fcid"
echo "------------------------------------------------------"
echo "Config File generation"
-rm config.txt
+#rm config.txt
python $exptrackmainsc getconfile $fcid $runfolder
if [ -f config.txt ]
then
echo "------------------------------------------------------"
echo "LaneNames.xml file generation: "
echo ""
-rm LaneNames.xml
+#rm LaneNames.xml
python $exptrackmainsc getLanesNames $fcid
if [ -f LaneNames.xml ]
then
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"
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