text: user734: I'm attempting to come up with a statistical model to determine the p-value for the similarity value $ 0 \le s \le 1 $ of two DNA contigs.
  The idea is to get a numerical measure to estimate if two contigs are homologous.
  I want to account for base composition (and/or other structural features) if possible, but not necessarily because I might want to do the analysis only from the information about the length of the sequences/contigs and largest overlaps. Maybe something inspired from other statistical significance in bioinformatics .
  Assume we have two DNA sequences: $a$ and $b$ with the basepair lengths $a_{\text{len}}$, $b_{\text{len}}$. Their overlap $o_{a-b}$ is the number of contiguous bases that appears in both sequences. If we define the similarity $s = \frac{o_{a-b}}{\min{(a_{\text{len}}, b_{\text{len}})}}$ how can we define a p-value for $s$?
  
  user729: Well, here my thoughts:
  The equation $s$ somehow tries to represent the ratio $\frac{equality}{equality+inequality}$. But $s$ returns only a value. And to assing the p-value to a single value... is complicated.
  How could you approach this?
  
  Using some kind of Hamming distance for each base pair at the position $n$ ($1 \leqslant n \leqslant len$) between the sequence i ($s_{i}$) and sequence j ($s_{j}$) in order to get a set of binary data:
  
  $$s_{ij} = \begin{Bmatrix} 1\ if\ seq_{i_{n}}=seq_{j_{n}} \\ 0\ if\ seq_{i_{n}}\neq seq_{j_{n}}   \end{Bmatrix}$$
  With this, you get a set of binomial data (eg $\{0,1,0,1,0,1,1,1,0,1,1,1,0,...\}$). Now, you should be able to perform some (Binary?) test and get the p-value.
  PD: Consider aligning the two sequences if there is interest in discussing base pair homology.
  
original_text: 734: <p>I'm attempting to come up with a statistical model to determine the p-value for the similarity value <span class="math-container">$ 0 \le s \le 1 $</span> of two DNA contigs.
  The idea is to get a numerical measure to estimate if two contigs are homologous.</p>
  <p>I want to account for base composition (and/or other structural features) if possible, but not necessarily because I might want to do the analysis only from the information about the length of the sequences/contigs and largest overlaps. Maybe something inspired from other <a href="https://academic.oup.com/bib/article/7/1/2/262762" rel="nofollow noreferrer">statistical significance in bioinformatics </a>.</p>
  <p>Assume we have two DNA sequences: <span class="math-container">$a$</span> and <span class="math-container">$b$</span> with the basepair lengths <span class="math-container">$a_{\text{len}}$</span>, <span class="math-container">$b_{\text{len}}$</span>. Their overlap <span class="math-container">$o_{a-b}$</span> is the number of contiguous bases that appears in both sequences. If we define the similarity <span class="math-container">$s = \frac{o_{a-b}}{\min{(a_{\text{len}}, b_{\text{len}})}}$</span> how can we define a p-value for <span class="math-container">$s$</span>?</p>
   729: <p>Well, here my thoughts:</p>
  <p>The equation <span class="math-container">$s$</span> somehow tries to represent the ratio <span class="math-container">$\frac{equality}{equality+inequality}$</span>. But <span class="math-container">$s$</span> returns only a value. And to assing the p-value to a single value... is complicated.</p>
  <p>How could you approach this?</p>
  <ul>
  <li>Using some kind of Hamming distance for each base pair at the position <span class="math-container">$n$</span> (<span class="math-container">$1 \leqslant n \leqslant len$</span>) between the <code>sequence i</code> (<span class="math-container">$s_{i}$</span>) and <code>sequence j</code> (<span class="math-container">$s_{j}$</span>) in order to get a set of binary data:</li>
  </ul>
  <p><span class="math-container">$$s_{ij} = \begin{Bmatrix} 1\ if\ seq_{i_{n}}=seq_{j_{n}} \\ 0\ if\ seq_{i_{n}}\neq seq_{j_{n}}   \end{Bmatrix}$$</span></p>
  <p>With this, you get a set of binomial data (eg <span class="math-container">$\{0,1,0,1,0,1,1,1,0,1,1,1,0,...\}$</span>). Now, you should be able to perform some (Binary?) test and get the p-value.</p>
  <p>PD: Consider aligning the two sequences if there is interest in discussing base pair homology.</p>
  