#!/bin/bash

mkdir -p ../blastp
mkdir -p ../blastp/Exonerate


for year_d in ../t_coffee/res_unic_exo/*; do {
	year=`basename $year_d`
	mkdir -p ../blastp/Exonerate/$year

for genome_d in ../t_coffee/res_unic_exo/$year/*; do {
	
	genome=`basename $genome_d`

	mkdir -p ../blastp/Exonerate/$year/$genome
	
	for query_d in ../t_coffee/res_unic_exo/$year/$genome/*; do {
		
		query=`basename $query_d`
		
		mkdir -p ../blastp/Exonerate/$year/$genome/$query		
echo $query_d
	for hit_carpetes in ../t_coffee/res_unic_exo/$year/$genome/$query/*; do {
		hitcarpetes=`basename $hit_carpetes`

		mkdir -p ../blastp/Exonerate/$year/$genome/$query/$hitcarpetes
			
		for resultat_d in ../t_coffee/res_unic_exo/$year/$genome/$query/$hitcarpetes/*; do {
	
			resultat=`basename $resultat_d`
			ordena=${resultat#tcoffee_}
echo $ordena
blastcl3 -p blastp -i ../t_coffee/hits_exon_tcof/$year/$genome/$query/$hitcarpetes/$ordena -d nr > ../blastp/Exonerate/$year/$genome/$query/$hitcarpetes/$ordena

		} done
	} done
} done
} done
} done


