<commit_before>{% extends "layout.html" %}
{% block body %}
    <!-- Render context vars in JS here -->
    <script type="text/javascript">
        window.gene = {{ gene|tojson|safe }};
        window.transcript = {{ transcript|tojson|safe }};
        window.table_variants = {{ variants_in_gene|tojson|safe }};
        window.variants_in_transcript = {{ variants_in_transcript|tojson|safe }};
        window.transcripts_in_gene = {{ transcripts_in_gene|tojson|safe }};
        window.coverage_stats = {{ coverage_stats|tojson|safe }};
        window.page_name = window.gene.gene_id;
    </script>
    <style>

    </style>
    <script>
        $(document).ready(function() {
            $("#variants_loading").hide();
            $("#variants_table_container").show();
        });
    </script>
    <div class="container-fluid">
        <div class="col-md-10 col-xs-offset-1 col-md-offset-1">
            <h1>Gene: {{ gene.gene_name }}</h1>
            <hr/>
        </div>
        <div class="row">
            <div class="col-md-4 col-xs-10 col-xs-offset-1 col-md-offset-0">
                <dl class="dl-horizontal">
                    {% if gene.full_gene_name %}
                        <dt>{{ gene.gene_name }}</dt>
                        <dd>{{ gene.full_gene_name }}</dd>
                    {% endif %}
                    <dt>Number of variants</dt>
                    <dd><span id="number_of_variants"></span> (Including filtered: {{ variants_in_gene|length }})</dd>
{#                    <dt>Number of LoF variants</dt>#}
{#                    <dd><span id="number_of_lof_variants"></span> (Including filtered: {{ lof_variants_in_gene|length }})</dd>#}
                    <script>
                        filtered_variants = _.filter(window.table_variants, function(d) {
                            return d.filter == 'PASS';
                        });
                        $('#number_of_variants').replaceWith(filtered_variants.length);
                        lof_filtered_variants = _.filter(window.table_variants, function(d) {
                            return d.filter == 'PASS' && d.category == 'lof_variant';
                        });
                        $('#number_of_lof_variants').replaceWith(lof_filtered_variants.length);
                    </script>
{#                    <dt>LoF rate</dt>#}
{#                    <dd>{{ '%0.4g' % composite_lof_frequency }}</dd>#}
                    <dt class="hidden-xs">UCSC Browser</dt>
                    <dd class="hidden-xs">
                        <a href="http://genome.ucsc.edu/cgi-bin/hgTracks?db=hg19&position=chr{{ gene.chrom }}%3A{{ gene.start - 1 }}-{{ gene.stop - 1 }}" target="_blank">
                            {{ gene.chrom }}:{{ gene.start - 1 }}-{{ gene.stop - 1 }}
                            <i class="fa fa-external-link"></i>
                        </a>
                    </dd>
                    <dt class="hidden-xs">GeneCards</dt>
                    <dd class="hidden-xs">
                        <a href="http://www.genecards.org/cgi-bin/carddisp.pl?gene={{ gene.gene_name }}" target="_blank">
                            {{ gene.gene_name }}
                            <i class="fa fa-external-link"></i>
                        </a>
                    </dd>
                    {% if gene.omim_accession %}
                        <dt>OMIM</dt>
                        <dd>
                            <a href="http://omim.org/entry/{{ gene.omim_accession }}" target="_blank">
                                {{ gene.gene_name }}
                                <i class="fa fa-external-link"></i>
                            </a>
                        </dd>
                    {% endif %}
                    <dt>Other</dt>
                    <dd>
                        <div class="dropdown">
                            <button class="btn btn-default dropdown-toggle" type="button" id="external_ref_dropdown" data-toggle="dropdown">
                                External References
                                <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu" role="menu" aria-labelledby="external_ref_dropdown">
                                <li role="presentation" class="visible-xs-block">
                                    <a href="http://genome.ucsc.edu/cgi-bin/hgTracks?db=hg19&position=chr{{ gene.chrom }}%3A{{ gene.start - 1 }}-{{ gene.stop - 1 }}" target="_blank">
                                        UCSC Browser
                                        <i class="fa fa-external-link"></i>
                                    </a>
                                </li>
                                <li role="presentation" class="visible-xs-block">
                                    <a href="http://www.genecards.org/cgi-bin/carddisp.pl?gene={{ gene.gene_name }}" target="_blank">
                                        GeneCards
                                        <i class="fa fa-external-link"></i>
                                    </a>
                                </li>
                                <li role="presentation">
                                    <a role="menuitem" tabindex="-1" href="http://grch37.ensembl.org/Homo_sapiens/Gene/Summary?g={{ gene.gene_id }}" target="_blank">
                                        Ensembl <i class="fa fa-external-link"></i>
                                    </a>
                                </li>
                                <li role="presentation">
                                    <a role="menuitem" tabindex="-1" href="http://en.wikipedia.org/{{ gene.gene_name }}" target="_blank">
                                        Wikipedia <i class="fa fa-external-link"></i>
                                    </a>
                                </li>
                                <li role="presentation"><commit_msg>Fixing wiki link (fixes #251)<commit_after>{% extends "layout.html" %}
{% block body %}
    <!-- Render context vars in JS here -->
    <script type="text/javascript">
        window.gene = {{ gene|tojson|safe }};
        window.transcript = {{ transcript|tojson|safe }};
        window.table_variants = {{ variants_in_gene|tojson|safe }};
        window.variants_in_transcript = {{ variants_in_transcript|tojson|safe }};
        window.transcripts_in_gene = {{ transcripts_in_gene|tojson|safe }};
        window.coverage_stats = {{ coverage_stats|tojson|safe }};
        window.page_name = window.gene.gene_id;
    </script>
    <style>

    </style>
    <script>
        $(document).ready(function() {
            $("#variants_loading").hide();
            $("#variants_table_container").show();
        });
    </script>
    <div class="container-fluid">
        <div class="col-md-10 col-xs-offset-1 col-md-offset-1">
            <h1>Gene: {{ gene.gene_name }}</h1>
            <hr/>
        </div>
        <div class="row">
            <div class="col-md-4 col-xs-10 col-xs-offset-1 col-md-offset-0">
                <dl class="dl-horizontal">
                    {% if gene.full_gene_name %}
                        <dt>{{ gene.gene_name }}</dt>
                        <dd>{{ gene.full_gene_name }}</dd>
                    {% endif %}
                    <dt>Number of variants</dt>
                    <dd><span id="number_of_variants"></span> (Including filtered: {{ variants_in_gene|length }})</dd>
{#                    <dt>Number of LoF variants</dt>#}
{#                    <dd><span id="number_of_lof_variants"></span> (Including filtered: {{ lof_variants_in_gene|length }})</dd>#}
                    <script>
                        filtered_variants = _.filter(window.table_variants, function(d) {
                            return d.filter == 'PASS';
                        });
                        $('#number_of_variants').replaceWith(filtered_variants.length);
                        lof_filtered_variants = _.filter(window.table_variants, function(d) {
                            return d.filter == 'PASS' && d.category == 'lof_variant';
                        });
                        $('#number_of_lof_variants').replaceWith(lof_filtered_variants.length);
                    </script>
{#                    <dt>LoF rate</dt>#}
{#                    <dd>{{ '%0.4g' % composite_lof_frequency }}</dd>#}
                    <dt class="hidden-xs">UCSC Browser</dt>
                    <dd class="hidden-xs">
                        <a href="http://genome.ucsc.edu/cgi-bin/hgTracks?db=hg19&position=chr{{ gene.chrom }}%3A{{ gene.start - 1 }}-{{ gene.stop - 1 }}" target="_blank">
                            {{ gene.chrom }}:{{ gene.start - 1 }}-{{ gene.stop - 1 }}
                            <i class="fa fa-external-link"></i>
                        </a>
                    </dd>
                    <dt class="hidden-xs">GeneCards</dt>
                    <dd class="hidden-xs">
                        <a href="http://www.genecards.org/cgi-bin/carddisp.pl?gene={{ gene.gene_name }}" target="_blank">
                            {{ gene.gene_name }}
                            <i class="fa fa-external-link"></i>
                        </a>
                    </dd>
                    {% if gene.omim_accession %}
                        <dt>OMIM</dt>
                        <dd>
                            <a href="http://omim.org/entry/{{ gene.omim_accession }}" target="_blank">
                                {{ gene.gene_name }}
                                <i class="fa fa-external-link"></i>
                            </a>
                        </dd>
                    {% endif %}
                    <dt>Other</dt>
                    <dd>
                        <div class="dropdown">
                            <button class="btn btn-default dropdown-toggle" type="button" id="external_ref_dropdown" data-toggle="dropdown">
                                External References
                                <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu" role="menu" aria-labelledby="external_ref_dropdown">
                                <li role="presentation" class="visible-xs-block">
                                    <a href="http://genome.ucsc.edu/cgi-bin/hgTracks?db=hg19&position=chr{{ gene.chrom }}%3A{{ gene.start - 1 }}-{{ gene.stop - 1 }}" target="_blank">
                                        UCSC Browser
                                        <i class="fa fa-external-link"></i>
                                    </a>
                                </li>
                                <li role="presentation" class="visible-xs-block">
                                    <a href="http://www.genecards.org/cgi-bin/carddisp.pl?gene={{ gene.gene_name }}" target="_blank">
                                        GeneCards
                                        <i class="fa fa-external-link"></i>
                                    </a>
                                </li>
                                <li role="presentation">
                                    <a role="menuitem" tabindex="-1" href="http://grch37.ensembl.org/Homo_sapiens/Gene/Summary?g={{ gene.gene_id }}" target="_blank">
                                        Ensembl <i class="fa fa-external-link"></i>
                                    </a>
                                </li>
                                <li role="presentation">
                                    <a role="menuitem" tabindex="-1" href="http://en.wikipedia.org/wiki/{{ gene.gene_name }}" target="_blank">
                                        Wikipedia <i class="fa fa-external-link"></i>
                                    </a>
                                </li>
                                <li role="presentation">
{'fraction_non_alphanumeric': 0.14388004380422878, 'fraction_numerical': 0.0051385729930081715, 'mean_word_length': 1.1538461538461537, 'pattern_counts': {'":': 0, '<': 195, '<?xml version=': 0, '>': 195, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 48, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '725838', 'n_tokens_mistral': 3304, 'n_tokens_neox': 3015, 'n_words': 487}