#include <ncbi.h>
#include <gishlib.h>
#include "blastapp.h"

ckseqtype(seqtype, seq, seqlen)
	int	seqtype;
	char	*seq;
	Coord_t	seqlen;
{
	long	cnt;
	double	ratio;

	cnt = str_cnt(seq, "ACGTUNacgtun-");
	ratio = cnt / (double)seqlen;

	if (ratio < 0.85) {
		if (seqtype == NUCLEIC_ACID_SEQTYPE) {
			warning("QUERY SEQUENCE APPEARS TO BE PROTEIN WHEN NUCLEIC ACID IS EXPECTED.");
			return -1;
		}
	}
	else
		if (seqtype == AMINO_ACID_SEQTYPE) {
			warning("QUERY SEQUENCE APPEARS TO BE NUCLEIC ACID WHEN PROTEIN IS EXPECTED.");
			return -1;
		}

	return 0;
}
