#!/bin/bash

mkdir -p ../Genewise
mkdir -p ../Genewise/genewiseexit 2> error.temp

for year_d in ../fastasubseq/fastasubseqexit/*; do {
		year=`basename $year_d`	
	
		mkdir ../Genewise/genewiseexit/$year

for genome_d in ../fastasubseq/fastasubseqexit/$year/*; do {

		genome=`basename $genome_d`

		mkdir -p ../Genewise/genewiseexit/$year/$genome 2> error.temp
		
			for query_donanom in ../fastasubseq/fastasubseqexit/$year/$genome/*; do {
			
				query=`basename $query_donanom`
					
				mkdir -p ../Genewise/genewiseexit/$year/$genome/$query 2> error.temp
									
					for hit_carpetes in ../fastasubseq/fastasubseqexit/$year/$genome/$query/*; do {

						hitcarpetes=`basename $hit_carpetes`
						echo $hitcarpetes						
					
						mkdir -p ../Genewise/genewiseexit/$year/$genome/$query/$hitcarpetes 2> error.temp
						
							for hit_bo in ../fastasubseq/fastasubseqexit/$year/$genome/$query/$hitcarpetes/*; do {
						
								hitbo=`basename $hit_bo`
echo $hitbo
genewise -pep -pretty -cdna -gff -both ../Exonerate/querysambX/$query.fa $hit_bo > ../Genewise/genewiseexit/$year/$genome/$query/$hitcarpetes/genewise_$hitbo

							} done

					} done

			} done

	} done

} done


