Skip to content
Snippets Groups Projects
create_srfs.sh 3.6 KiB
Newer Older
  • Learn to ignore specific revisions
  • kohleman's avatar
    kohleman committed
    #!/bin/bash
    # Processing steps needed from the Illumina Output to the SRF files
    
    
    kohleman's avatar
    kohleman committed
    export RUN_BASE=/net/bs-dsu-data/array0/dsu/processing
    
    kohleman's avatar
    kohleman committed
    export LATEST_FOLDER=`ls -1dtr $RUN_BASE/*XX* | tail -1`
    
    kohleman's avatar
    kohleman committed
    export INTENSITY_FOLDER=Data/Intensities
    export BUSTARD=/usr/local/dsu/GAPipeline/bin/bustard.py
    
    kohleman's avatar
    kohleman committed
    export CONFIG_FILE=$LATEST_FOLDER/$INTENSITY_FOLDER/config.txt
    
    kohleman's avatar
    kohleman committed
    export CIF2TXT=/usr/local/dsu/bin/cif2txt.sh
    export LANES2SRF=/usr/local/dsu/bin/lanes2srf_RTA
    
    kohleman's avatar
    kohleman committed
    export NUMBER_OF_LANES=`cat $LATEST_FOLDER/$INTENSITY_FOLDER/RTAConfiguration.xml | grep NumberOfLanes | cut -d \> -f2 | cut -d \< -f1`
    export NUMBER_OF_TILES=`cat $LATEST_FOLDER/$INTENSITY_FOLDER/RTAConfiguration.xml | grep TilesPerLane | cut -d \> -f2 | cut -d \< -f1`
    
    kohleman's avatar
    kohleman committed
    export PAIRED_END=`cat  $LATEST_FOLDER/$INTENSITY_FOLDER/RTAConfiguration.xml | grep IsPairedEndRun  | cut -d \> -f2 | cut -d \< -f1`
    
    kohleman's avatar
    kohleman committed
    export NUMBER_OF_CYCLES=`ls -1tr $LATEST_FOLDER/$INTENSITY_FOLDER/L00$NUMBER_OF_LANES/ | tail -1 | cut -d . -f1 | cut -d C -f2`
    
    kohleman's avatar
    kohleman committed
    export MAILX=/bin/mailx
    export MAIL_LIST="manuel.kohler@bsse.ethz.ch"
    export RM=/bin/rm
    export MAKE=/usr/bin/make
    
    kohleman's avatar
    kohleman committed
    
    
    export PRG=`basename $0`
    
    kohleman's avatar
    kohleman committed
    export USAGE="Usage: ${PRG} <Path_to_Run_Base> <Number_of_Lanes> \n\nEXAMPLE: ${PRG} /array0/Runs/ 8" 
    
    kohleman's avatar
    kohleman committed
    if [ -z "${RUN_BASE}"  -o -z "${NUMBER_OF_LANES}" ]
    then
       echo "${USAGE}"
       exit 1
    fi
    
    kohleman's avatar
    kohleman committed
    cd $LATEST_FOLDER/$INTENSITY_FOLDER
    
    kohleman's avatar
    kohleman committed
    
    echo "5:ELAND_GENOME /array0/Genomes/PhiX" > $CONFIG_FILE
    
    kohleman's avatar
    kohleman committed
    if $PAIRED_END;
     then echo "5:ANALYSIS eland_pair" >> $CONFIG_FILE;
     else echo "5:ANALYSIS eland_extended" >> $CONFIG_FILE;
    fi
    
    kohleman's avatar
    kohleman committed
    echo "ELAND_MULTIPLE_INSTANCES 8" >> $CONFIG_FILE
    echo "EMAIL_LIST manuel.kohler@bsse.ethz.ch" >> $CONFIG_FILE
    
    
    kohleman's avatar
    kohleman committed
    /usr/local/dsu/GAPipeline/bin/GERALD.pl config.txt --FLOW_CELL v4  --EXPT_DIR BaseCalls/ --make
    cd BaseCalls/GERALD*
    make -j 8 all
    
    kohleman's avatar
    kohleman committed
    
    
    kohleman's avatar
    kohleman committed
    #$BUSTARD --CIF . --GERALD=$CONFIG_FILE --control-lane=5 --make
    
    #cd Bustard*
    #echo "Starting parallel make..."
    
    #make recursive -j 15 2>seq_make.err >seq_make.log
    
    kohleman's avatar
    kohleman committed
    cd $LATEST_FOLDER/$INTENSITY_FOLDER/BaseCalls
    
    kohleman's avatar
    kohleman committed
    
    
    kohleman's avatar
    kohleman committed
    $CIF2TXT $LATEST_FOLDER/$INTENSITY_FOLDER $NUMBER_OF_CYCLES $NUMBER_OF_TILES
    
    kohleman's avatar
    kohleman committed
    
    
    kohleman's avatar
    kohleman committed
    #$LANES2SRF $LATEST_FOLDER/$INTENSITY_FOLDER/BaseCalls $NUMBER_OF_LANES
    
    kohleman's avatar
    kohleman committed
    #$LANES2SRF /net/bs-dsu-data/array0/dsu/processing/091208_433DAAXX/Data/Intensities/BaseCalls/ 8
    
    
    kohleman's avatar
    kohleman committed
    export SRF_DIR=Srf
    #export ILLUMINA2SRF=/usr/local/dsu/bin/illumina2srf
    export ILLUMINA2SRF=/usr/local/bin/illumina2srf
    
    kohleman's avatar
    kohleman committed
    export LF=`echo $LATEST_FOLDER | cut -d / -f7`
    
    kohleman's avatar
    kohleman committed
    
    [ -d $SRF_DIR ] || mkdir $SRF_DIR
    #for  (( a=1; a<=$NUMBER_OF_LANES; a++ )); do
    #  echo "Starting SRF $a"
    
    kohleman's avatar
    kohleman committed
      $ILLUMINA2SRF -clobber -b -o $SRF_DIR/"ETHZ_BSSE_"$LF"_1.srf" $LATEST_FOLDER/$INTENSITY_FOLDER/BaseCalls/s_1_*_qseq.txt &
      $ILLUMINA2SRF -clobber -b -o $SRF_DIR/"ETHZ_BSSE_"$LF"_2.srf" $LATEST_FOLDER/$INTENSITY_FOLDER/BaseCalls/s_2_*_qseq.txt &
      $ILLUMINA2SRF -clobber -b -o $SRF_DIR/"ETHZ_BSSE_"$LF"_3.srf" $LATEST_FOLDER/$INTENSITY_FOLDER/BaseCalls/s_3_*_qseq.txt &
      $ILLUMINA2SRF -clobber -b -o $SRF_DIR/"ETHZ_BSSE_"$LF"_4.srf" $LATEST_FOLDER/$INTENSITY_FOLDER/BaseCalls/s_4_*_qseq.txt &
      $ILLUMINA2SRF -clobber -b -o $SRF_DIR/"ETHZ_BSSE_"$LF"_5.srf" $LATEST_FOLDER/$INTENSITY_FOLDER/BaseCalls/s_5_*_qseq.txt &
      $ILLUMINA2SRF -clobber -b -o $SRF_DIR/"ETHZ_BSSE_"$LF"_6.srf" $LATEST_FOLDER/$INTENSITY_FOLDER/BaseCalls/s_6_*_qseq.txt &
      $ILLUMINA2SRF -clobber -b -o $SRF_DIR/"ETHZ_BSSE_"$LF"_7.srf" $LATEST_FOLDER/$INTENSITY_FOLDER/BaseCalls/s_7_*_qseq.txt &
      $ILLUMINA2SRF -clobber -b -o $SRF_DIR/"ETHZ_BSSE_"$LF"_8.srf" $LATEST_FOLDER/$INTENSITY_FOLDER/BaseCalls/s_8_*_qseq.txt &
    
    kohleman's avatar
    kohleman committed
      wait $!
    #done
    
    
    
    kohleman's avatar
    kohleman committed
    # clean up
    
    kohleman's avatar
    kohleman committed
    #chmod -R 755 $LATEST_FOLDER
    
    kohleman's avatar
    kohleman committed
    
    echo -e "SRF creation finished for $LATEST_FOLDER :-)" | $MAILX -s "SRF creation finished for $LATEST_FOLDER :-)" $MAIL_LIST