#!/bin/bash
mkdir -p ../SECIS 2> error.temp
mkdir -p ../SECIS/SECISexit 2> error.temp



for what_d in ../fastasubseq/fastasubseqexit/*; do {
	what=`basename $what_d`
	
	mkdir -p ../SECIS/SECISexit/$what

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

echo $genome_d

	genome=`basename $genome_d`
	
	mkdir -p ../SECIS/SECISexit/$what/$genome 2> error.temp
	

		for query_donanom in ../fastasubseq/fastasubseqexit/$what/$genome/*; do {
			
			query=`basename $query_donanom`
				mkdir -p ../SECIS/SECISexit/$what/$genome/$query	
						

				for hit_carpetes in ../fastasubseq/fastasubseqexit/$what/$genome/$query/*; do {

				hitnom=`basename $hit_carpetes`
					
				mkdir -p ../SECIS/SECISexit/$what/$genome/$query/$hitnom 2> error.temp
				


				for sortintfastasubseq in ../fastasubseq/fastasubseqexit/$what/$genome/$query/$hitnom/*; do {
					sortint=`basename $sortintfastasubseq`
					sordena=${sortint%.fa}

SECISearch.pl < ../fastasubseq/fastasubseqexit/$what/$genome/$query/$hitnom/$sortint > ../SECIS/SECISexit/$what/$genome/$query/$hitnom/SECIS_${query}_$sortint 2> ../SECIS/SECISexit/$what/$genome/$query/error_SECIS_${query}_${hitnom}.temp


} done
} done
} done 
} done
} done
rm ./*.temp
rm ../SECIS/*/*/*/*/*.temp
