#!/bin/bash
makenucseq -amount "$1" -length "$2" -outseq query.fasta -auto -filter
seqret "$3" outseq.fasta -auto -filter
makeblastdb -in outseq.fasta -dbtype nucl
blastn -task blastn -query query.fasta -db outseq.fasta -out blast.out -outfmt "7 evalue" -evalue 0.1
sed '/#/d' blast.out >> blast.txt
wc blast.txt -l | awk '{print $1}' > text.txt
d=$(cat text.txt)
c=$(echo "scale=2;$d/$1" |bc)
echo "Среднее количество находок с E-value не больше 0.1 при данных параметрах равно $c"
rm query.fasta outseq.fasta blast.out blast.txt outseq.fasta.nin outseq.fasta.nhr outseq.fasta.nsq text.txt