I am looking for a statistical test to compare frequencies in a particular dataset. In a long string, a particular sequence of characters occurs at a frequency of x per 1000 characters. In some portions of the string, the frequency is higher at y per 1000 characters. Can we tell if y and x are significantly different or not?
This might be a good question for BioStar as well.
In a region of $N$ base pairs, you have $2(N-(L-1))$ possible positions for $L$ base pair binding sites ($L-1$ is the number of overhanging positions past the left, $N-(L-1)$ is the number of leftmost positions, and there are 2 strands). $k$ of them are real binding sites. If the underlying probability of a position being a binding site is $q$, then $k$ followed a binomial distribution with parameter $q$ and number of trials $2(N-(L-1))$
If what you want is a $p$-value, then you would take the parameter $q$ you calculated from the genome outside of the regions you found, and calculate the probability of a binomial distribution with that $q$ producing at least as many binding sites as you see.