Files
annotate/detectors/cds/bin/go_cds.sh
Eric Coissac 536a451510 call explicitely tcsh to workaround a path bug
Former-commit-id: e6c05a695a6872dd5fb8acd96ee031844dd21fa0
Former-commit-id: 7740135e0861b796e85fce0c9c62a4793f836c2b
2016-04-13 17:32:10 +02:00

90 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env tcsh -f
#
# Annotate CDS
#
#========================================================================================
#
# Annotate CDS
#
# go_cds.sh <FASTAFILE>
#
# - <FASTAFILE> : The fasta file containing the genome to annotate
#
# Results are printed to the standard output
#
#========================================================================================
# usage: go_cds.sh fasta [db_root]
#
unsetenv ORG_SOURCED
setenv ORG_HOME `dirname $0`/../../..
source $ORG_HOME/scripts/csh_init.sh
NeedArg 1
set Fasta = $Argv[1]; Shift
NeedFile $Fasta
set Genome = `basename $Fasta:r`
set DbRoot = $CDS_DATA_DIR/chlorodb
if ($#Argv > 0) then
set DbRoot = $Argv[1]; Shift
endif
NeedDir $DbRoot/core
NeedFile $DbRoot/core/Annot.lst
NeedDir $DbRoot/models
#
# run everything into temporary place
#
set temp = $Genome.tmp
if (! -d $temp) then
Notify "making directory $temp"
mkdir $temp
endif
#
# pass1: run exonerate
#
foreach dir ("core" "shell" "dust")
if (-d $DbRoot/$dir) then
set fams = `ls $DbRoot/$dir/*.fst`
Notify "running pass1:$dir exonerate of $Genome on $DbRoot"
foreach f ($fams)
tcsh -f $PROG_DIR/do_exonerate.sh $Fasta $f $DbRoot/models $temp
end
endif
end
#
# pass2: transsplicing
#
#
# pass3: prokov
#
#
# end : output on stdout
#
cat $temp/*.res
# cleanup everything
AssignUndef TMP_CLEANUP 1
if ($TMP_CLEANUP != 0) then
Notify " cleanup $temp"
(\rm -r $temp) >& /dev/null
endif
Exit 0