2016-04-13 16:51:58 +02:00
|
|
|
#!/usr/bin/env tcsh -f
|
2015-11-08 14:28:05 +01:00
|
|
|
#
|
|
|
|
# Annotate CDS
|
|
|
|
#
|
|
|
|
#========================================================================================
|
|
|
|
#
|
|
|
|
# Annotate CDS
|
|
|
|
#
|
|
|
|
# go_cds.sh <FASTAFILE>
|
|
|
|
#
|
|
|
|
# - <FASTAFILE> : The fasta file containing the genome to annotate
|
|
|
|
#
|
|
|
|
# Results are printed to the standard output
|
|
|
|
#
|
|
|
|
#========================================================================================
|
2015-11-13 22:37:22 +01:00
|
|
|
# usage: go_cds.sh fasta [db_root]
|
2015-11-08 14:28:05 +01:00
|
|
|
#
|
2015-11-09 00:58:50 +01:00
|
|
|
unsetenv ORG_SOURCED
|
2015-11-08 14:28:05 +01:00
|
|
|
|
|
|
|
setenv ORG_HOME `dirname $0`/../../..
|
|
|
|
source $ORG_HOME/scripts/csh_init.sh
|
|
|
|
|
|
|
|
NeedArg 1
|
|
|
|
|
2015-11-13 17:41:18 +01:00
|
|
|
set Fasta = $Argv[1]; Shift
|
2015-11-08 14:28:05 +01:00
|
|
|
|
|
|
|
NeedFile $Fasta
|
|
|
|
|
|
|
|
set Genome = `basename $Fasta:r`
|
|
|
|
|
2015-11-13 22:37:22 +01:00
|
|
|
set DbRoot = $CDS_DATA_DIR/chlorodb
|
2015-11-13 17:41:18 +01:00
|
|
|
|
|
|
|
if ($#Argv > 0) then
|
2015-11-13 22:37:22 +01:00
|
|
|
set DbRoot = $Argv[1]; Shift
|
2015-11-13 17:41:18 +01:00
|
|
|
endif
|
|
|
|
|
2015-11-13 22:37:22 +01:00
|
|
|
NeedDir $DbRoot/core
|
|
|
|
NeedFile $DbRoot/core/Annot.lst
|
|
|
|
|
|
|
|
NeedDir $DbRoot/models
|
2015-11-08 14:28:05 +01:00
|
|
|
|
|
|
|
#
|
|
|
|
# run everything into temporary place
|
|
|
|
#
|
|
|
|
|
|
|
|
set temp = $Genome.tmp
|
|
|
|
if (! -d $temp) then
|
|
|
|
Notify "making directory $temp"
|
|
|
|
mkdir $temp
|
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# pass1: run exonerate
|
|
|
|
#
|
|
|
|
|
2015-11-13 22:37:22 +01:00
|
|
|
foreach dir ("core" "shell" "dust")
|
|
|
|
if (-d $DbRoot/$dir) then
|
2016-10-05 08:01:30 -03:00
|
|
|
set fams = `ls $DbRoot/$dir/*.clean.fst`
|
2015-11-13 22:37:22 +01:00
|
|
|
Notify "running pass1:$dir exonerate of $Genome on $DbRoot"
|
|
|
|
foreach f ($fams)
|
2016-10-05 08:01:30 -03:00
|
|
|
tcsh -f $PROG_DIR/do_exonerate.csh $Fasta $f $DbRoot/models $temp
|
2015-11-13 22:37:22 +01:00
|
|
|
end
|
|
|
|
endif
|
2015-11-08 14:28:05 +01:00
|
|
|
end
|
|
|
|
|
2018-01-24 14:30:00 +01:00
|
|
|
cp $temp/ $Genome.cds.fasta $Genome.cds.fasta
|
|
|
|
|
2015-11-08 14:28:05 +01:00
|
|
|
#
|
|
|
|
# pass2: transsplicing
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# pass3: prokov
|
|
|
|
#
|
|
|
|
|
2018-01-24 14:30:00 +01:00
|
|
|
$PROG_DIR/do_prokov.sh $Fasta $Genome.cds.fasta $temp
|
|
|
|
|
2015-11-08 14:28:05 +01:00
|
|
|
#
|
|
|
|
# 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
|