Autoexonerate.sh

#!/bin/bash

# Triar si volem exonerate exhaustiu o no

if [ "$1" = "-exhaustive" ]; then exhaustive="--exhaustive yes" fi

for protein in subseq/*.fa ; do {

protein=`basename $protein`

protein=${protein%.fa}

prot=${protein%_*}

# EXONERATE : Predicció de gens

exonerate -m p2g --showtargetgff -q Libreria/$prot.fa -t subseq/$protein.fa $exhaustive > ./output_exonerate/$protein.gff

# Per extreure el cDNA i traduir-lo a proteïnes

exon=`grep -w exon ./output_exonerate/$protein.gff`

grep -w exon ./output_exonerate/$protein.gff > exon.temp

if [ "$exon" != "" ]; then

./fastaseqfromGFF.pl ./subseq/$protein.fa exon.temp > ./cDNA/$protein.fa

fastatranslate ./cDNA/$protein.fa -F 1 > ./translations/$protein.fa

fi

} done

rm *.temp