#!/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/green_proteins/allblastsgreen	#Output's directory
PATH_proteins="~/Escriptori/vipera/green_proteins/allseqgreen"	#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="eEFsec(1) eEFsec(2) eEFsec(3) GPx GPx4 GPx8 MsrA PSTK SBP2(1) SBP2(2) SECp43 SecS Sel0(1) Sel0(2) SelI SelR2 SelR3 SelU2 SelW SPS1"

#Make the output directory
mkdir $PATH_output #~/Escriptori/vipera/green_proteins/allblastsgreen

#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!"
