<commit_before><div
  class="page-header">
  <h2>Results</h2>
</div>

<div
  class="row">
  <div
    class="col-md-3">
    <ul
      class="nav nav-stacked index">
      <% report.queries.each do |query| %>
        <li>
          <a
            href="<%="#Query_#{query.number}"%>"
            title="<%= "Query= #{query.id}" %>">
            <%= "Query= #{query.id}"[0, 30] + (query.id.length > 30 ? ' ...' : '')%>
          </a>
        </li>
      <% end %>
    </ul>
  </div>

  <div
    class="col-md-9">
    <% report.queries.each do |query| %>
      <div
          class="resultn" id="<%="Query_#{query.number}"%>" data-query-len="<%= query.len %>"
          data-graphit="overview">
        <div
          class="page-header">
          <div
            class="row">
            <div
              class="col-md-10">
              <h3>
                Query= <%= query.id %>
                <small>
                  <%= query.meta %>
                </small>
              </h3>
            </div>
            <div
              class="col-md-2 text-right">
              <a
                href="<%= "/get_sequence/?sequence_ids=#{query.hits.map(&:id).join(' ')}&database_ids=#{database_ids.join(' ')}" %>"
                class="link-fasta link-fasta-query">
                [FASTA]
              </a>
            </div>
          </div>
        </div>

        <div
          class="page-content">
          <p
            class="text-monospace">
            Query length: <%= query.len %>, Number of Hit(s): <%= query.hits.count %>
          </p>
          <% if query.hits.empty? %>
            <br>
            <br>
            <p
              class="text-monospace">
              <strong> <%= "****** No hits found ******" %> </strong>
            </p>
          <% else %>
            <div
              class="tabular-view text-monospace">
              <div class="row">
                <div class="col-md-7">
                  <p> Sequences producing significant alignments: </p>
                </div>
                <div class="col-md-2 text-right"> Total Score </div>
                <div class="col-md-3 text-right"> E value </div>
              </div>
              <% query.hits.each do |hit| %>
                <div class="row">
                  <div class="col-md-7"> <%= "#{hit.id}" %> </div>
                  <div
                    class="col-md-2 text-right">
                    <a href="<%="#Query_#{query.number}_hit_#{hit.number}"%>">
                      <%= "#{hit.total_score.round(2)}" %>
                    </a>
                  </div>
                  <div class="col-md-3 text-right"> <%= hit.evalue.to_s.sub(/(\d*\.\d*)e?([+-]\d*)?/) {|l| s = '%.3f' % $1; s << " x 10<sup>#{$2}</sup>" if $2; s} %> </div>
                </div>
              <% end %>
            </div>
            <% query.hits.each do |hit| %>
              <div
                class="hitn" id="<%="Query_#{query.number}_hit_#{hit.number}"%>">
                <div
                  class="page-header">
                  <div
                    class="row">
                    <div
                      class="col-md-10">
                      <h4
                        data-toggle="collapse" data-target="#<%= "Query_#{query.number}_hit_#{hit.number}_alignment" %>">
                        <%= hit.id %>
                        <small>
                          <%= hit.def %>
                        </small>
                      </h4>
                    </div>
                    <div
                      class="col-md-2 text-right">
                      <a
                        href="<%= "/get_sequence/?sequence_ids=#{hit.id}&database_ids=#{database_ids.join(' ')}" %>"
                        class="link-fasta link-fasta-hit">
                        [FASTA]
                      </a>
                    </div>
                  </div>
                </div>

                <div
                  class="page-content text-monospace collapse in"
                  id="<%="Query_#{query.number}_hit_#{hit.number}_alignment"%>">
                  Hit length: <%= hit.length %>
                  Number of HSP(s): <%= hit.hsps.length %>
                  <br>
                  <br>
                  <% hit.hsps.each do |hsp| %>
                  <div
                      class="hsps" id="<%="Query_#{query.number}_hit_#{hit.number}_#{hsp.number}"%>"
                      data-hsp-evalue="<%= hsp.evalue %>" data-hsp-start="<%= hsp.qstart %>"
                      data-hsp-end="<%= hsp.qend %>" data-hsp-frame="<%= hsp.hframe %>">
                      <div class="row">
                        <div class="col-md-2"> Score </div>
                        <div class="col-md-2"> Expect </div>
                        <div class="col-md-2"> Identities </div>
                        <div class="col-md-2"> Positives </div>
                        <div class="col-md-2"> Gaps </div>
                        <div class="col-md-2"> Strand </div>
                      </div>
                      <div class="row">
                        <div class="col-md-2"> <%= hsp.bit_score.round(2) %> (<%= hsp.score %>)</div>
                        <div class="col-md-2"> <%= hsp.evalue.to_s.sub(/(\d*\.\d*)e?([+-]\d*)?/) {|l| s = '%.3f' % $1; s << " x 10<sup>#{$2}</sup>" if $2; s} %></div>
                        <div class="col-md-2"> <%= hsp.identity%>/<%= hsp.len %></div>
                        <div class="col-md-2"> <%= hsp.positives %>/<%= hsp.len %></div>
                        <div class="col-md-2"> <%= hsp.gaps %>/<%= hsp.len %></div>
                        <div class="col-md-2"> (<%= hsp.qframe>0?"Plus":"Minus"%>/<%= hsp.hframe>0?"Plus":"Minus"%>)</div>
                      </div>
                      <br>
                      <% if hsp.len > 60 %>
                        <% 0.upto(hsp.len.div(61)) do |x| %>
                          <div class="row alignment">
                            <div class="col-md-1"> Query </div>
                            <div class="col-md-1"> <%= hsp.qstart+60*x %> </div>
                            <div class="col-md-9"> <%= hsp.qseq[60*x,60] %> </div>
                            <div class="col-md-1"> <%= hsp.qstart+60*(x+1)-1 %> </div>
                          </div>
                          <div class="row alignment">
                            <div class="col-md-1"></div>
                            <div class="col-md-1"></div>
                            <div class="col-md-9"> <%= hsp.midline[60*x, 60] %></div>
                            <div class="col-md-1"></div>
                          </div>
                          <div class="row alignment">
                            <div class="col-md-1"> Subject </div>
                            <% if hsp.hframe > 0 %>
                              <div class="col-md-1"> <%= hsp.start+60*x %> </div>
                              <div class="col-md-9"> <%= hsp.hseq[60*x, 60] %> </div>
                              <div class="col-md-1"> <%= hsp.start+60*(x+1)-1 %> </div>
                            <% else %>
                              <div class="col-md-1"> <%= hsp.start+60*x %> </div>
                              <div class="col-md-9"> <%= hsp.hseq[60*x, 60] %> </div>
                              <div class="col-md-1"> <%= hsp.start-60*(x+1)+1 %> </div>
                            <% end %>
                          </div>
                          <br>
                        <% end %>
                      <% else %>
                        <div class="row alignment">
                          <div class="col-md-1"> Query </div>
                          <div class="col-md-1"> <%= hsp.qstart %> </div>
                          <div class="col-md-9"> <%= hsp.qseq %> </div>
                          <div class="col-md-1"> <%= hsp.qend %> </div>
                        </div>
                        <div class="row alignment">
                          <div class="col-md-1"></div>
                          <div class="col-md-1"></div>
                          <div class="col-md-9"> <%= hsp.midline %></div>
                          <div class="col-md-1"></div>
                        </div>
                        <div class="row alignment">
                          <div class="col-md-1"> Subject </div>
                          <div class="col-md-1"> <%= hsp.start %> </div>
                          <div class="col-md-9"> <%= hsp.hseq %> </div>
                          <div class="col-md-1"> <%= hsp.send %> </div>
                        </div>
                      <% end %>
                      <br><br>
                    </div>
                    <% end %>
                </div>
              </div>
            <% end %>
          <% end %>
          <br>
          <br>
          <p
            class="text-monospace">
            Lambda:  <%= query.stats["Statistics_lambda"] %>
            <br>
            Kappa:   <%= query.stats["Statistics_kappa"] %>
            <br>
            Entropy: <%= query.stats["Statistics_entropy"] %>
            <br>
            Effective search space used: <%= query.stats["Statistics_eff-space"] %>
            <br>
            Databases: <%= report.querydb.split.map{|db| File.basename(db)}.join(', ') %>
          </p>
        </div>
      </div>
    <% end %>
  </div>
</div>
<commit_msg>Fixed critical bug showing qend, send erroneously<commit_after><div
  class="page-header">
  <h2>Results</h2>
</div>

<div
  class="row">
  <div
    class="col-md-3">
    <ul
      class="nav nav-stacked index">
      <% report.queries.each do |query| %>
        <li>
          <a
            href="<%="#Query_#{query.number}"%>"
            title="<%= "Query= #{query.id}" %>">
            <%= "Query= #{query.id}"[0, 30] + (query.id.length > 30 ? ' ...' : '')%>
          </a>
        </li>
      <% end %>
    </ul>
  </div>

  <div
    class="col-md-9">
    <% report.queries.each do |query| %>
      <div
          class="resultn" id="<%="Query_#{query.number}"%>" data-query-len="<%= query.len %>"
          data-graphit="overview">
        <div
          class="page-header">
          <div
            class="row">
            <div
              class="col-md-10">
              <h3>
                Query= <%= query.id %>
                <small>
                  <%= query.meta %>
                </small>
              </h3>
            </div>
            <div
              class="col-md-2 text-right">
              <a
                href="<%= "/get_sequence/?sequence_ids=#{query.hits.map(&:id).join(' ')}&database_ids=#{database_ids.join(' ')}" %>"
                class="link-fasta link-fasta-query">
                [FASTA]
              </a>
            </div>
          </div>
        </div>

        <div
          class="page-content">
          <p
            class="text-monospace">
            Query length: <%= query.len %>, Number of Hit(s): <%= query.hits.count %>
          </p>
          <% if query.hits.empty? %>
            <br>
            <br>
            <p
              class="text-monospace">
              <strong> <%= "****** No hits found ******" %> </strong>
            </p>
          <% else %>
            <div
              class="tabular-view text-monospace">
              <div class="row">
                <div class="col-md-7">
                  <p> Sequences producing significant alignments: </p>
                </div>
                <div class="col-md-2 text-right"> Total Score </div>
                <div class="col-md-3 text-right"> E value </div>
              </div>
              <% query.hits.each do |hit| %>
                <div class="row">
                  <div class="col-md-7"> <%= "#{hit.id}" %> </div>
                  <div
                    class="col-md-2 text-right">
                    <a href="<%="#Query_#{query.number}_hit_#{hit.number}"%>">
                      <%= "#{hit.total_score.round(2)}" %>
                    </a>
                  </div>
                  <div class="col-md-3 text-right"> <%= hit.evalue.to_s.sub(/(\d*\.\d*)e?([+-]\d*)?/) {|l| s = '%.3f' % $1; s << " x 10<sup>#{$2}</sup>" if $2; s} %> </div>
                </div>
              <% end %>
            </div>
            <% query.hits.each do |hit| %>
              <div
                class="hitn" id="<%="Query_#{query.number}_hit_#{hit.number}"%>">
                <div
                  class="page-header">
                  <div
                    class="row">
                    <div
                      class="col-md-10">
                      <h4
                        data-toggle="collapse" data-target="#<%= "Query_#{query.number}_hit_#{hit.number}_alignment" %>">
                        <%= hit.id %>
                        <small>
                          <%= hit.def %>
                        </small>
                      </h4>
                    </div>
                    <div
                      class="col-md-2 text-right">
                      <a
                        href="<%= "/get_sequence/?sequence_ids=#{hit.id}&database_ids=#{database_ids.join(' ')}" %>"
                        class="link-fasta link-fasta-hit">
                        [FASTA]
                      </a>
                    </div>
                  </div>
                </div>

                <div
                  class="page-content text-monospace collapse in"
                  id="<%="Query_#{query.number}_hit_#{hit.number}_alignment"%>">
                  Hit length: <%= hit.length %>
                  Number of HSP(s): <%= hit.hsps.length %>
                  <br>
                  <br>
                  <% hit.hsps.each do |hsp| %>
                  <div
                      class="hsps" id="<%="Query_#{query.number}_hit_#{hit.number}_#{hsp.number}"%>"
                      data-hsp-evalue="<%= hsp.evalue %>" data-hsp-start="<%= hsp.qstart %>"
                      data-hsp-end="<%= hsp.qend %>" data-hsp-frame="<%= hsp.hframe %>">
                      <div class="row">
                        <div class="col-md-2"> Score </div>
                        <div class="col-md-2"> Expect </div>
                        <div class="col-md-2"> Identities </div>
                        <div class="col-md-2"> Positives </div>
                        <div class="col-md-2"> Gaps </div>
                        <div class="col-md-2"> Strand </div>
                      </div>
                      <div class="row">
                        <div class="col-md-2"> <%= hsp.bit_score.round(2) %> (<%= hsp.score %>)</div>
                        <div class="col-md-2"> <%= hsp.evalue.to_s.sub(/(\d*\.\d*)e?([+-]\d*)?/) {|l| s = '%.3f' % $1; s << " x 10<sup>#{$2}</sup>" if $2; s} %></div>
                        <div class="col-md-2"> <%= hsp.identity%>/<%= hsp.len %></div>
                        <div class="col-md-2"> <%= hsp.positives %>/<%= hsp.len %></div>
                        <div class="col-md-2"> <%= hsp.gaps %>/<%= hsp.len %></div>
                        <div class="col-md-2"> (<%= hsp.qframe>0?"Plus":"Minus"%>/<%= hsp.hframe>0?"Plus":"Minus"%>)</div>
                      </div>
                      <br>
                      <% if hsp.len > 60 %>
                        <% 0.upto(hsp.len.div(61)) do |x| %>
                          <div class="row alignment">
                            <div class="col-md-1"> Query </div>
                            <div class="col-md-1"> <%= hsp.qstart+60*x %> </div>
                            <div class="col-md-9"> <%= hsp.qseq[60*x,60] %> </div>
                            <div class="col-md-1"> <%= hsp.qstart+60*(x+1)-1 > hsp.qend ? hsp.qend : hsp.qstart+60*(x+1) %> </div>
                          </div>
                          <div class="row alignment">
                            <div class="col-md-1"></div>
                            <div class="col-md-1"></div>
                            <div class="col-md-9"> <%= hsp.midline[60*x, 60] %></div>
                            <div class="col-md-1"></div>
                          </div>
                          <div class="row alignment">
                            <div class="col-md-1"> Subject </div>
                            <% if hsp.hframe > 0 %>
                              <div class="col-md-1"> <%= hsp.start+60*x %> </div>
                              <div class="col-md-9"> <%= hsp.hseq[60*x, 60] %> </div>
                              <div class="col-md-1"> <%= hsp.start+60*(x+1)-1 > hsp.send ? hsp.send : hsp.start+60*(x+1) %> </div>
                            <% else %>
                              <div class="col-md-1"> <%= hsp.start+60*x %> </div>
                              <div class="col-md-9"> <%= hsp.hseq[60*x, 60] %> </div>
                              <div class="col-md-1"> <%= hsp.start-60*(x+1)+1 < hsp.send ? hsp.send : hsp.start-60*(x+1) %> </div>
                            <% end %>
                          </div>
                          <br>
                        <% end %>
                      <% else %>
                        <div class="row alignment">
                          <div class="col-md-1"> Query </div>
                          <div class="col-md-1"> <%= hsp.qstart %> </div>
                          <div class="col-md-9"> <%= hsp.qseq %> </div>
                          <div class="col-md-1"> <%= hsp.qend %> </div>
                        </div>
                        <div class="row alignment">
                          <div class="col-md-1"></div>
                          <div class="col-md-1"></div>
                          <div class="col-md-9"> <%= hsp.midline %></div>
                          <div class="col-md-1"></div>
                        </div>
                        <div class="row alignment">
                          <div class="col-md-1"> Subject </div>
                          <div class="col-md-1"> <%= hsp.start %> </div>
                          <div class="col-md-9"> <%= hsp.hseq %> </div>
                          <div class="col-md-1"> <%= hsp.send %> </div>
                        </div>
                      <% end %>
                      <br><br>
                    </div>
                    <% end %>
                </div>
              </div>
            <% end %>
          <% end %>
          <br>
          <br>
          <p
            class="text-monospace">
            Lambda:  <%= query.stats["Statistics_lambda"] %>
            <br>
            Kappa:   <%= query.stats["Statistics_kappa"] %>
            <br>
            Entropy: <%= query.stats["Statistics_entropy"] %>
            <br>
            Effective search space used: <%= query.stats["Statistics_eff-space"] %>
            <br>
            Databases: <%= report.querydb.split.map{|db| File.basename(db)}.join(', ') %>
          </p>
        </div>
      </div>
    <% end %>
  </div>
</div>

{'fraction_non_alphanumeric': 0.1899163224234721, 'fraction_numerical': 0.013187162376866858, 'mean_word_length': 1.0030762702874723, 'pattern_counts': {'":': 4, '<': 568, '<?xml version=': 0, '>': 571, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1600151', 'n_tokens_mistral': 6111, 'n_tokens_neox': 5501, 'n_words': 941}