<commit_before>{% extends "layout.html" %}


{% block in_head %}
<script type="text/javascript">
  window.pheno = {{ pheno|tojson|safe }};
  window.significant_phenos = {{ significant_phenos|tojson|safe }};
  window.gene_symbol = {{ gene_symbol|tojson|safe }};
</script>
<script src="{{ url_for('static', filename='vendor/locuszoom.vendor.min.js') }}" type="text/javascript"></script>
<script src="{{ url_for('static', filename='vendor/locuszoom-0.4.9.app.js') }}" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='vendor/locuszoom.css') }}">
<script type="text/javascript" src="{{ url_for('static', filename='vendor/stream_table.min.js') }}"></script>
<script src="{{ url_for('static', filename='region.js') }}"></script>
<script src="{{ url_for('static', filename='gene.js') }}"></script>
{% endblock %}


{% block contained %}
{% for key in ['num_cases', 'num_controls', 'num_samples'] %}
 {% if key in pheno %}
  {% if '<' in pheno[key]|string %}
    <div class="alert alert-danger" role="alert"><b>Warning:</b> This phenotype has {{ pheno[key] }} {{ key.replace('num_','') }}.</div>
  {% elif pheno[key]|int < 200 %}
    <div class="alert alert-danger" role="alert"><b>Warning:</b> This phenotype only has {{ pheno[key] }} {{ key.replace('num_', '') }}.</div>
  {% endif %}
 {% endif %}
{% endfor %}
<div class="row">
  <div class="col-xs-12">
    <h1 style="margin-top:0">{{ gene_symbol }}</h1>
  </div>
</div>
<div class="row">
    <div class="pheno-info col-xs-12">
        {% if 'num_cases' in pheno %}
          <p><b>{{ pheno.num_cases }}</b> cases, <b>{{ pheno.num_controls }}</b> controls.</p>
        {% elif 'num_samples' in pheno %}
          <p><b>{{ pheno.num_samples }}</b> samples</p>
        {% endif %}
        {% if pheno.category %}
          <p>Category: <b>{{ pheno.category}}</b></p>
        {% endif %}
    </div>
</div>
<br>
{% if significant_phenos %}
<div class="row">
  <div class="col-md-10 col-lg-10 col-sm-10 col-xs-10">
    <h4>Phenotypes with the most-significant associations for this gene:</h4>

      <div class="row stream_table_row">
        <div class="col-xs-12">
          <table id="stream_table" class="table table-striped table-bordered">
            <thead>
              <tr>
                <th>Top p-value in gene</th>
                <th>Phenotype</th>
              </tr>
            </thead>
            <tbody>
            </tbody>
          </table>
        </div>
      </div>

  </div>
</div>
<br/>
{% endif %}
<div class="row">
  <div class="col-xs-12">
    <a href="/pheno/{{ pheno['phenocode'] }}" class="btn btn-default">Go to Manhattan Plot</a>
    <button id="move-left-fast" type="button" class="btn btn-default" title="move 3/4 screen left">
      <span class="glyphicon glyphicon-arrow-left"></span><span class="glyphicon glyphicon-arrow-left"></span></button>
    <button id="move-left" type="button" class="btn btn-default" title="move 1/4 scren left">
      <span class="glyphicon glyphicon-arrow-left"></span></button>
    <button id="zoom-in" type="button" class="btn btn-default" title="zoom in 2x">
      <span class="glyphicon glyphicon-zoom-in"></span></button>
    <button id="zoom-out" type="button" class="btn btn-default" title="zoom out 2x">
      <span class="glyphicon glyphicon-zoom-out"></span></button>
    <button id="move-right" type="button" class="btn btn-default" title="move right 1/4 screen">
      <span class="glyphicon glyphicon-arrow-right"></span></button>
    <button id="move-right-fast" type="button" class="btn btn-default" title="move right 3/4 screen">
      <span class="glyphicon glyphicon-arrow-right"></span><span class="glyphicon glyphicon-arrow-right"></span></button>
    <br>
  </div>
</div>
<div class="row">
  <div class="col-md-10 col-lg-10 col-sm-10 col-xs-10">
    <div id="lz-1" class="lz-locuszoom-container lz-container-responsive" data-region={{ region }}></div>
  </div>
</div>

<script type="text/template" id="streamtable-template">
  <% if (p.pheno.phenocode === pheno.phenocode) { %>
  <tr style="background-color:lightblue">
    <td><%= p.assoc.pval.toExponential(1) %></td>
    <td><%= p.pheno.phenostring || p.pheno.phenocode %></td>
  </tr>
  <% } else { %>
  <tr onclick="window.location='/region/<%= p.pheno.phenocode %>/gene/<%= gene_symbol %>'" style="cursor:pointer">
    <td><%= p.assoc.pval.toExponential(1) %></td>
    <td><a style="color:black" href="/region/<%= p.pheno.phenocode %>/gene/<%= gene_symbol %>">
        <%= p.pheno.phenostring || p.pheno.phenocode %>
    </a></td>
  </tr>
  <% } %>
</script>

{% endblock %}
<commit_msg>Improve gene table a little<commit_after>{% extends "layout.html" %}


{% block in_head %}
<script type="text/javascript">
  window.pheno = {{ pheno|tojson|safe }};
  window.significant_phenos = {{ significant_phenos|tojson|safe }};
  window.gene_symbol = {{ gene_symbol|tojson|safe }};
</script>
<script src="{{ url_for('static', filename='vendor/locuszoom.vendor.min.js') }}" type="text/javascript"></script>
<script src="{{ url_for('static', filename='vendor/locuszoom-0.4.9.app.js') }}" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='vendor/locuszoom.css') }}">
<script type="text/javascript" src="{{ url_for('static', filename='vendor/stream_table.min.js') }}"></script>
<script src="{{ url_for('static', filename='region.js') }}"></script>
<script src="{{ url_for('static', filename='gene.js') }}"></script>
{% endblock %}


{% block contained %}
<div class="row">
  <div class="col-xs-12">
    <h1 style="margin-top:0">{{ gene_symbol }}</h1>
  </div>
</div>
{% if significant_phenos %}
<div class="row">
  <div class="col-md-10 col-lg-10 col-sm-10 col-xs-10">
    <p>Phenotypes with the most-significant associations for this locus:</p>

      <div class="row stream_table_row">
        <div class="col-xs-12">
          <table id="stream_table" class="table table-striped table-bordered">
            <thead>
              <tr>
                <th>Top p-value in gene</th>
                <th>Phenotype</th>
              </tr>
            </thead>
            <tbody>
            </tbody>
          </table>
        </div>
      </div>

  </div>
</div>
<br/>
{% endif %}
{% for key in ['num_cases', 'num_controls', 'num_samples'] %}
 {% if key in pheno %}
  {% if '<' in pheno[key]|string %}
    <div class="alert alert-danger" role="alert"><b>Warning:</b> This phenotype has {{ pheno[key] }} {{ key.replace('num_','') }}.</div>
  {% elif pheno[key]|int < 200 %}
    <div class="alert alert-danger" role="alert"><b>Warning:</b> This phenotype only has {{ pheno[key] }} {{ key.replace('num_', '') }}.</div>
  {% endif %}
 {% endif %}
{% endfor %}
<div class="row">
    <div class="pheno-info col-xs-12">
        {% if 'num_cases' in pheno %}
          <p><b>{{ pheno.num_cases }}</b> cases, <b>{{ pheno.num_controls }}</b> controls.</p>
        {% elif 'num_samples' in pheno %}
          <p><b>{{ pheno.num_samples }}</b> samples</p>
        {% endif %}
        {% if pheno.category %}
          <p>Category: <b>{{ pheno.category}}</b></p>
        {% endif %}
    </div>
</div>
<br>

<div class="row">
  <div class="col-xs-12">
    <a href="/pheno/{{ pheno['phenocode'] }}" class="btn btn-default">Go to Manhattan Plot</a>
    <button id="move-left-fast" type="button" class="btn btn-default" title="move 3/4 screen left">
      <span class="glyphicon glyphicon-arrow-left"></span><span class="glyphicon glyphicon-arrow-left"></span></button>
    <button id="move-left" type="button" class="btn btn-default" title="move 1/4 scren left">
      <span class="glyphicon glyphicon-arrow-left"></span></button>
    <button id="zoom-in" type="button" class="btn btn-default" title="zoom in 2x">
      <span class="glyphicon glyphicon-zoom-in"></span></button>
    <button id="zoom-out" type="button" class="btn btn-default" title="zoom out 2x">
      <span class="glyphicon glyphicon-zoom-out"></span></button>
    <button id="move-right" type="button" class="btn btn-default" title="move right 1/4 screen">
      <span class="glyphicon glyphicon-arrow-right"></span></button>
    <button id="move-right-fast" type="button" class="btn btn-default" title="move right 3/4 screen">
      <span class="glyphicon glyphicon-arrow-right"></span><span class="glyphicon glyphicon-arrow-right"></span></button>
    <br>
  </div>
</div>
<div class="row">
  <div class="col-md-10 col-lg-10 col-sm-10 col-xs-10">
    <div id="lz-1" class="lz-locuszoom-container lz-container-responsive" data-region={{ region }}></div>
  </div>
</div>

<script type="text/template" id="streamtable-template">
  <% if (p.pheno.phenocode === pheno.phenocode) { %>
  <tr style="background-color:lightblue">
    <td><%= p.assoc.pval.toExponential(1) %></td>
    <td><%= p.pheno.phenostring || p.pheno.phenocode %></td>
  </tr>
  <% } else { %>
  <tr onclick="window.location='/region/<%= p.pheno.phenocode %>/gene/<%= gene_symbol %>'" style="cursor:pointer">
    <td><%= p.assoc.pval.toExponential(1) %></td>
    <td><a style="color:black" href="/region/<%= p.pheno.phenocode %>/gene/<%= gene_symbol %>">
        <%= p.pheno.phenostring || p.pheno.phenocode %>
    </a></td>
  </tr>
  <% } %>
</script>

{% endblock %}

{'fraction_non_alphanumeric': 0.2216716932356743, 'fraction_numerical': 0.010124946143903489, 'mean_word_length': 3.601090188305253, 'pattern_counts': {'":': 0, '<': 281, '<?xml version=': 0, '>': 277, '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': '6253016', 'n_tokens_mistral': 3479, 'n_tokens_neox': 3184, 'n_words': 648}