wrapper_get_dijen_reports.sh 1.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
#!/bin/bash

### GAD PIPELINE ###
## wrapper_get_dijen_reports.sh
## Description : wrapper for annotate a SJ file with data from  sjdb file generated by star2 2 pass
## Usage : qsub -v INPUTDIR=</path/to/the/input/directory>,OUTPUTDIR=</path/to/the/output/directory>,[LOGFILE=/path/to/the/log/file],[CONFIGFILE=/path/to/the/config/file] wrapper_get_dijen_reports.sh
## Output : a tsv file describing match between dijarn & dijen for each dijarn sample
## Requirements : python 2.7, a valid analyse directory strucure

## Author : yannis.duffourd@u-bourgogne.fr
## Creation Date : 20201019
## last revision date : 20201019
## Known bugs : None

#$ -V
#$ -q batch



# logfile
if [ -z ${LOGFILE} ]
then
    LOGFILE=get_dijen_reports.$(date +"%F_%H-%M-%S").log
fi

# Logging
exec 1>> $LOGFILE 2>&1
echo "$(date +"%F_%H-%M-%S"): START"

# Check if input file exist
if [ -z $INPUTDIR ]
then
    echo "Input directory does not exist"
    echo "$(date +"%F_%H-%M-%S"): END"
    touch get_dijen_reports.failed
    exit 1
fi

# Check if input file exist
if [ -z $OUTPUTDIR ]
then
    echo "Output directory does not exist"
    echo "$(date +"%F_%H-%M-%S"): END"
    touch get_dijen_reports.failed
    exit 1
fi

# Config file path option
if [ -z ${CONFIGFILE} ]
then
   CONFIGFILE=analysis_config.tsv
fi

PYTHONBIN=$(grep "pythonbin" $CONFIGFILE | awk '{print $2}')
PIPELINEBASE=$(grep "pipelinebase" $CONFIGFILE | cut -f2)

echo "Command : $PYTHONBIN $PIPELINEBASE/common/get_dijen_reports_from_dijarnID.py -i $INPUTDIR -o $OUTPUTDIR"
$PYTHONBIN $PIPELINEBASE/common/get_dijen_reports_from_dijarnID.py -i $INPUTDIR -o $OUTPUTDIR
exit_code=$?
echo "wrapper_get_dijen_reports.sh exit code : $exit_code"
if [ $exit_code != 0 ]
then
    echo "$(date +"%F_%H-%M-%S"): END"
    touch get_dijen_reports.failed
    exit 1
fi

echo "$(date +"%F_%H-%M-%S"): END"