#!/bin/bash

##THIS SCRIPT BLASTS ALL THE PROTEIN QUERIES FROM ANOLE LIZARD TO THE VIPERA BERUS GENOME

#To export the blast software and to define the paths of the inputs and outputs:
export PATH=/cursos/BI/bin/ncbiblast/x64/bin:$PATH	#Blast
PATH_db=/cursos/BI/genomes/2015/Vipera_berus_berus/genome.fa	#Vipera berus genome database
PATH_output=~/Escriptori/vipera/red_proteins/allblastsred	#Output's directory
PATH_proteins="~/Escriptori/vipera/red_proteins/allseqred"	#Directory of Anole lizard Selenoproteins from SelenoDB

#To change directory to the protein's path and to define the proteins variable
cd $PATH_proteins
proteins="DI1 GPx SelK SelP2 SelU1 TR DI2 Sel15 SelM SelR1 SelW GPx2 SelH  SelN SelS SPS GPx3 SelI SelP1 SelT TR3"

#Make the output directory
mkdir $PATH_output	#~/Escriptori/allblastsred 

#To enter a loop for each protein
for protein in $proteins
do
	#To run the blastall software for each protein (-i) to the genome database(-d)
	blastall -p tblastn -i $protein -d $PATH_db -o $PATH_output/$protein.blast  
done

echo "Blast finished!"



