<commit_before><!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>GWAS Curation Demo</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css"/>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>

    <!--Select2: http://ivaynberg.github.io/select2/-->
    <!-- Include Select2 CSS -->
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/select2/3.5.0/select2.min.css"/>

    <!-- CSS to make Select2 fit in with Bootstrap 3.x -->
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/select2/3.5.0/select2-bootstrap.min.css"/>

    <!-- Include Select2 JS -->
    <script src="//cdnjs.cloudflare.com/ajax/libs/select2/3.5.0/select2.min.js"></script>

    <!--Tags input http://timschlechter.github.io/bootstrap-tagsinput/examples/-->
    <link rel="stylesheet" href="//cdn.jsdelivr.net/bootstrap.tagsinput/0.4.2/bootstrap-tagsinput.css"/>
    <script src="//cdn.jsdelivr.net/bootstrap.tagsinput/0.4.2/bootstrap-tagsinput.min.js"></script>

</head>
<body>

<!--TODO
- REIMPLEMENTED LOGIN
- COUNT -->

<nav role="navigation" class="navbar navbar-default">
    <div class="navbar-header">
        <button type="button" data-target="#navbarCollapse" data-toggle="collapse" class="navbar-toggle">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        <a href="http://www.ebi.ac.uk/gwas" class="navbar-brand">GWAS</a>
    </div>

    <div id="navbarCollapse" class="collapse navbar-collapse">
        <ul class="nav navbar-nav">
            <li><a th:href="@{/studies}">Home</a></li>
            <li><a th:href="@{/studies/new}">Add Study</a></li>
            <li><a th:href="@{/diseasetraits}">Update Disease / Traits</a></li>
            <!--<li><a href="#">Count Data</a></li>-->
        </ul>
        <!-- <ul class="nav navbar-nav navbar-right">
             <li>
                 <form th:action="@{/logout}" method="post">
                     <input type="submit" value="Sign Out"/>
                 </form>
             </li>
         </ul>-->
    </div>
</nav>

<div class="container-fluid" th:object="${study}">
    <div class="row">
        <ul class="nav nav-tabs">
            <li><a th:href="@{/studies/{studyId}(studyId=*{id})}">Study Details</a></li>
            <li><a th:href="@{/studies/{studyId}/sampledescription(studyId=*{id})}">Sample Information</a></li>
            <li class="active"><a href="#">SNP Associations</a></li>
            <li><a th:href="@{/studies/{studyId}/housekeeping(studyId=*{id})}">Curator Information</a></li>
        </ul>
    </div>
</div>

<br/>

<div class="container-fluid">
    <table id="mainTable" class="table table-hover table-bordered">
        <caption>Existing SNP information</caption>
        <thead>
        <tr>
            <th></th>
            <th>Region</th>
            <th>Genes (author reported)</th>
            <th>Strongest Allele</th>
            <th>SNP</th>
            <th>Risk Frequency</th>
            <th>p-Value Float</th>
            <th>p-Value Text</th>
            <th>OR per Copy Num</th>
            <th>OR entered (reciprocal)</th>
            <th>OR-Type</th>
            <th>OR per Copy Range</th>
            <th>OR per Copy Unit Description</th>
            <th>Std Error</th>
            <th>SNP Type</th>
            <th>Multi-SNP haplotype</th>
            <th>SNP:SNP interaction</th>

        </tr>
        </thead>
        <tbody>
        <tr th:each="snpAssociationForm: ${snpAssociationForms}">
            <td><a th:href="@{/associations/{associationId}(associationId=${snpAssociationForm.associationId})}">Edit</a></td>

            <!--Region-->
            <td>N/A</td>

            <!--Gene-->
            <td>
                <span th:each="gene : ${snpAssociationForm.authorReportedGenes}"
                      th:text="${gene} ?: 'null'"></span>
            </td>

            <!--Strongest risk allele-->
            <td>
                <span th:each="row : ${snpAssociationForm.snpFormRows}"
                      th:text="${row.strongestRiskAllele} ?: 'null'"></span>
            </td>

            <!--SNPs-->
            <td>
                     <span th:each="row : ${snpAssociationForm.snpFormRows}"
                           th:text="${row.snp} ?: 'null'"></span>
            </td>

            <td th:text="${snpAssociationForm.riskFrequency}?: 'null' "></td>
            <td th:text="${snpAssociationForm.pvalueFloat} ?: 'null'"></td>
            <td th:text="${snpAssociationForm.pvalueText} ?: 'null'"></td>
            <td th:text="${snpAssociationForm.orPerCopyNum} ?: 'null'"></td>
            <td th:text="${snpAssociationForm.orPerCopyRecip} ?: 'null'"></td>
            <td th:switch="${snpAssociationForm.orType}">
                <p th:case="'null'">null</p>

                <p th:case="'0'">No</p>

                <p th:case="'1'">Yes</p>
            </td>

            <td th:text="${snpAssociationForm.orPerCopyRange} ?: 'null'"></td>
            <td th:text="${snpAssociationForm.orPerCopyUnitDescr} ?: 'null'"></td>
            <td th:text="${snpAssociationForm.orPerCopyStdError} ?: 'null'"></td>
            <td th:text="${snpAssociationForm.SnpType}"></td>
            <td th:switch="${snpAssociationForm.multiSnpHaplotype}">
                <p th:case="'null'">null</p>

                <p th:case="'0'">No</p>

                <p th:case="'1'">Yes</p>
            </td>
            <td th:switch="${snpAssociationForm.snpInteraction}">
                <p th:case="'null'">null</p>

                <p th:case="'0'">No</p>

                <p th:case="'1'">Yes</p>
            </td>

        </tr>
        </tbody>
    </table>
</div>

<br/>


<div class="container-fluid" th:object="${study}">
    <div class="row">
        <div class="col-md-10">
            <!--Button-->
            <input type="button" class="btn btn-primary" value="Add SNPs from spreadsheet" data-toggle="collapse"
                   data-target="#uploadSNPsForn"/>
            <a th:href="@{/studies/{studyId}/associations/add(studyId=*{id})}" class="btn btn-primary">Add
                standard SNP or multi-SNP haplotype</a>
            <a th:href="@{/studies/{studyId}/associations/add(studyId=*{id})}"
               class="btn btn-primary">Add SNP:SNP interaction</a>

        </div>
    </div>
</div><commit_msg>Fixed bug in table when displaying checkbox values<commit_after><!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>GWAS Curation Demo</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css"/>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>

    <!--Select2: http://ivaynberg.github.io/select2/-->
    <!-- Include Select2 CSS -->
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/select2/3.5.0/select2.min.css"/>

    <!-- CSS to make Select2 fit in with Bootstrap 3.x -->
    <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/select2/3.5.0/select2-bootstrap.min.css"/>

    <!-- Include Select2 JS -->
    <script src="//cdnjs.cloudflare.com/ajax/libs/select2/3.5.0/select2.min.js"></script>

    <!--Tags input http://timschlechter.github.io/bootstrap-tagsinput/examples/-->
    <link rel="stylesheet" href="//cdn.jsdelivr.net/bootstrap.tagsinput/0.4.2/bootstrap-tagsinput.css"/>
    <script src="//cdn.jsdelivr.net/bootstrap.tagsinput/0.4.2/bootstrap-tagsinput.min.js"></script>

</head>
<body>

<!--TODO
- REIMPLEMENTED LOGIN
- COUNT -->

<nav role="navigation" class="navbar navbar-default">
    <div class="navbar-header">
        <button type="button" data-target="#navbarCollapse" data-toggle="collapse" class="navbar-toggle">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </button>
        <a href="http://www.ebi.ac.uk/gwas" class="navbar-brand">GWAS</a>
    </div>

    <div id="navbarCollapse" class="collapse navbar-collapse">
        <ul class="nav navbar-nav">
            <li><a th:href="@{/studies}">Home</a></li>
            <li><a th:href="@{/studies/new}">Add Study</a></li>
            <li><a th:href="@{/diseasetraits}">Update Disease / Traits</a></li>
            <!--<li><a href="#">Count Data</a></li>-->
        </ul>
        <!-- <ul class="nav navbar-nav navbar-right">
             <li>
                 <form th:action="@{/logout}" method="post">
                     <input type="submit" value="Sign Out"/>
                 </form>
             </li>
         </ul>-->
    </div>
</nav>

<div class="container-fluid" th:object="${study}">
    <div class="row">
        <ul class="nav nav-tabs">
            <li><a th:href="@{/studies/{studyId}(studyId=*{id})}">Study Details</a></li>
            <li><a th:href="@{/studies/{studyId}/sampledescription(studyId=*{id})}">Sample Information</a></li>
            <li class="active"><a href="#">SNP Associations</a></li>
            <li><a th:href="@{/studies/{studyId}/housekeeping(studyId=*{id})}">Curator Information</a></li>
        </ul>
    </div>
</div>

<br/>

<div class="container-fluid">
    <table id="mainTable" class="table table-hover table-bordered">
        <caption>Existing SNP information</caption>
        <thead>
        <tr>
            <th></th>
            <th>Region</th>
            <th>Genes (author reported)</th>
            <th>Strongest Allele</th>
            <th>SNP</th>
            <th>Risk Frequency</th>
            <th>p-Value Float</th>
            <th>p-Value Text</th>
            <th>OR per Copy Num</th>
            <th>OR entered (reciprocal)</th>
            <th>OR-Type</th>
            <th>OR per Copy Range</th>
            <th>OR per Copy Unit Description</th>
            <th>Std Error</th>
            <th>SNP Type</th>
            <th>Multi-SNP haplotype</th>
            <th>SNP:SNP interaction</th>

        </tr>
        </thead>
        <tbody>
        <tr th:each="snpAssociationForm: ${snpAssociationForms}">
            <td>
                <a th:href="@{/associations/{associationId}(associationId=${snpAssociationForm.associationId})}">Edit</a>
            </td>

            <!--Region-->
            <td>N/A</td>

            <!--Gene-->
            <td>
                <span th:each="gene : ${snpAssociationForm.authorReportedGenes}"
                      th:text="${gene} ?: 'null'"></span>
            </td>

            <!--Strongest risk allele-->
            <td>
                <span th:each="row : ${snpAssociationForm.snpFormRows}"
                      th:text="${row.strongestRiskAllele} ?: 'null'"></span>
            </td>

            <!--SNPs-->
            <td>
                     <span th:each="row : ${snpAssociationForm.snpFormRows}"
                           th:text="${row.snp} ?: 'null'"></span>
            </td>

            <td th:text="${snpAssociationForm.riskFrequency}?: 'null' "></td>
            <td th:text="${snpAssociationForm.pvalueFloat} ?: 'null'"></td>
            <td th:text="${snpAssociationForm.pvalueText} ?: 'null'"></td>
            <td th:text="${snpAssociationForm.orPerCopyNum} ?: 'null'"></td>
            <td th:text="${snpAssociationForm.orPerCopyRecip} ?: 'null'"></td>
            <td th:switch="${snpAssociationForm.orType}">
                <p th:case="'null'">null</p>

                <p th:case="'0'">No</p>

                <p th:case="'1'">Yes</p>
            </td>

            <td th:text="${snpAssociationForm.orPerCopyRange} ?: 'null'"></td>
            <td th:text="${snpAssociationForm.orPerCopyUnitDescr} ?: 'null'"></td>
            <td th:text="${snpAssociationForm.orPerCopyStdError} ?: 'null'"></td>
            <td th:text="${snpAssociationForm.SnpType}"></td>
            <td th:switch="${snpAssociationForm.multiSnpHaplotype}">
                <p th:case="'null'">null</p>

                <p th:case="false">No</p>

                <p th:case="true">Yes</p>
            </td>
            <td th:switch="${snpAssociationForm.snpInteraction}">
                <p th:case="'null'">null</p>

                <p th:case="false">No</p>

                <p th:case="true">Yes</p>
            </td>

        </tr>
        </tbody>
    </table>
</div>

<br/>


<div class="container-fluid" th:object="${study}">
    <div class="row">
        <div class="col-md-10">
            <!--Button-->
            <input type="button" class="btn btn-primary" value="Add SNPs from spreadsheet" data-toggle="collapse"
                   data-target="#uploadSNPsForn"/>
            <a th:href="@{/studies/{studyId}/associations/add(studyId=*{id})}" class="btn btn-primary">Add
                standard SNP or multi-SNP haplotype</a>
            <a th:href="@{/studies/{studyId}/associations/add(studyId=*{id})}"
               class="btn btn-primary">Add SNP:SNP interaction</a>

        </div>
    </div>
</div>
{'fraction_non_alphanumeric': 0.20282579071935739, 'fraction_numerical': 0.00760238112314423, 'mean_word_length': 2.1923076923076925, 'pattern_counts': {'":': 0, '<': 445, '<?xml version=': 0, '>': 445, 'https://': 8, 'lorem ipsum': 0, 'www.': 6, 'xml': 4}, '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': '379533', 'n_tokens_mistral': 4796, 'n_tokens_neox': 4452, 'n_words': 678}