Autoblast.sh
#!/bin/bash
# Detectar quines proteines hi ha a la carpeta Llibreria
for proteines_fa in ./Llibreria/*.fa; do {
basename_fa='basename $proteines_fa'
proteina=${basename_fa%.fa}
proteines=$proteines" $proteina"
} done
# Fer el blast i classificar els hits.
echo $proteina
echo "" > resultats_blast.txt
for protein in $proteines; do {
patroalfa='cat ./Libreria/$protein.fa | egrep ^"<"'
patrobeta=${patroalfa#*>}
echo $patrobeta > temppatro
patro='cut -f 1 -d " " temppatro'
rm temppatro
blastall -p tblastn -e 1e-4 -i ./Llibreria/$protein.fa -d
/cursos/BI/genomes/project_2014/Chrysochloris_asiatica/genome.fa -o output_blast/$protein.fa -m 8
./hits.pl $protein < ./output_blast/$protein.fa >> resultats_blast.txt
} done