{#-  joint_calling.html

    Template for the report content for the joint calling.
#}
{%- extends 'base.html' %}

{%- block title %}
  {{ module.title }}
{%- endblock %}

{%- block content %}
<h2>Filters Parameters</h2>
<p>All filters parameters used is presented in this list:</p>
<ul>
  <li>freebayes_score: {{ module.vcf.vcf.filters_params['freebayes_score'] }}</li>
  <li>min_depth: {{ module.vcf.vcf.filters_params['min_depth'] }}</li>
</ul>
<p>Note:</p>
<ul>
  <li>freebayes_score: can be understood as 1-P(locus is homozygous given the data)</li>
  <li>min_depth: minimum alternate allele present</li>
</ul>
<h2>Variants Detected</h2>
<p>Show/Hide samples:</p>
<div class="btn-group" data-toggle="buttons" style="padding-bottom: 1em;">
  {%- for sample in module.vcf.vcf.samples %}
    <label class="myCheckbox btn btn-primary active">
      <input type="checkbox" checked autocomplete="off">{{ sample }}</input>
    </label> 
  {%- endfor %}
</div>

<script type="text/javascript">
  function parseCsv_jc(csv, id) {
    var table;
    Papa.parse(csv, {
      comments: '#',
      delimiter: ',',
      header: true,
      dynamicTyping: true,
      error: function(reason){
        console.log(reason);
      },
      complete: function(results){
        table = {{ module.table_options }}
      },
    });
    return table;
  };
</script>

<script type="text/javascript">
  $(document).ready(function(){
    var jc = document.getElementById('csv_jc').innerText;
    var table = parseCsv_jc(jc, '#table_jc');
    jc = null;
    $(".myCheckbox").click(function(){
      var column = table.column(':contains(' + $(this).text().replace(/^\s+|\s+$/g, '') + ')');
      column.visible( ! column.visible() );
    });
  });
</script>
{{ module.table_html }}
<p class="bg-info">Note: tooltips show GT:DP:GL tags of VCF format.</p>
{%- endblock %}
