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

<!-- Example row of columns -->
{% block stuff %}

<div class="container-fluid" id="sample_list">

  <h2>{{ flowcell }}</h2>
  <table class="table table-bordered narrow-headers" id="fc_info">
    <tbody></tbody>
  </table>


  <h3>Lane info</h3>
  <div id="lanes">
  </div>
  
  </div>

<script>

f = d3.format(',g')
fpr = d3.format('.2%')

for (var i = 1; i < 9; i++) {
    $("#lanes").append('<div id="lane_' + i + '"><h4>Lane ' + i + '</h4>');
    $("#lanes").append('<table class="table table-bordered narrow-headers" id="summary_lane_'+i+'""><tbody></tbody></table><br></div>')
    $("#lanes").append('<table class="table table-bordered" id="table_lane_'+i+'""><tbody></tbody></table><br></div>')
};

$.getJSON("/api/v1/flowcell_info2/{{ flowcell }}", function(data) {
    var tbody = "<tr><th>Sequencing done</th><td>" + data["seqdone"]+"</td></tr>";
    tbody += "<tr><th>Demultiplex</th>";
    if(data.hasOwnProperty("demuldone")){
        tbody+="<td class='text-success'>Done</td>"
        tbody += "</tr><tr>"
        tbody += "<th>Projects :</th><td>";
        tbody += data["plist"].join(", ")
        tbody += "</td></tr>";
        for (lid=1;lid<9;lid++){
            if (data['yields'][lid] !== 0){
                var sbody="<tr><th>Total Yield :</th><td>";
                sbody+=data['yields'][lid];
                sbody+="</td></tr>";
            }
            if (data['seq_qc'][lid] !== 0){
            sbody+="<tr><th>Sequencing QC:</th><td>";
            sbody+=data['seq_qc'][lid];
            sbody+="</td></tr>";
            }
            for(i=1;i<4;i++){
                sbody+="<tr>";
                sbody+="<th>Read "+i+" Error rate :</th>";
                if(data.hasOwnProperty('err'+i)){
                    sbody+="<td>"+data['err'+i][lid]+"</td>";
                }else{
                    sbody+="<td>Not found in the DB</td>";
                }
                sbody+="</tr>"

            }
            $("#summary_lane_"+lid+" tbody").html(sbody);
        }
        for (lid in data['lane']){
            var lbody="";
            lbody+="<tr><th>Project Name</th><th>Sample Name</th><th>Yield (Mbases)</th><th># Reads</th><th>% >Q30</th><th>Barcode</th><th>Index description</th></tr>";
            for (samplerunid in data['lane'][lid]){
                lbody+="<tr><td>"+data['lane'][lid][samplerunid]['Project']+"</td>";
                lbody+="<td>"+data['lane'][lid][samplerunid]['SampleName']+"</td>";
                lbody+="<td>"+data['lane'][lid][samplerunid]['yield']+"</td>";
                lbody+="<td>"+data['lane'][lid][samplerunid]['readsnb']+"</td>";
                if(parseFloat(data['lane'][lid][samplerunid]['overthirty']) < 30){
                    lbody+="<td class='label-danger'>"
                }else if(parseFloat(data['lane'][lid][samplerunid]['overthirty']) < 80){
                    lbody+="<td class='label-warning'>"
                }else if(parseFloat(data['lane'][lid][samplerunid]['overthirty']) < 100){
                    lbody+="<td class='label-success'>"
                }else{
                    lbody+="<td>"
                }
                lbody+=data['lane'][lid][samplerunid]['overthirty']+"</td>";
                lbody+="<td>"+data['lane'][lid][samplerunid]['barcode']+"</td>";
                lbody+="<td>"+data['lane'][lid][samplerunid]['desc']+"</td>";
                lbody+="</tr>";
            }
            $("#table_lane_"+lid+" tbody").html(lbody);
            
        }

      }else{

      tbody+="<td class ='text-warning'>Pending</td></tr>"
    
  }

  $("#fc_info tbody").html(tbody);

  console.log(data)
});

</script>

{% end %}<commit_msg>flowcell_samples.html cleanup<commit_after>{% extends "base_new.html" %}

<!-- 
Template file: flowcell_samples.html
URL: /flowcells/[flowcell]
Title: Individual Flowcell Page 
Description: Shows information about a specific flow cell
-->

{% block stuff %}

<div class="container-fluid" id="sample_list">

    <h2>Flow Cell {{ flowcell }}</h2>
    <table class="table table-bordered narrow-headers" id="fc_info">
        <tbody></tbody>
    </table>


    <h3>Lane Information</h3>
    <div id="lanes"></div>
  
</div>

<script>

for (var i = 1; i < 9; i++) {
    $("#lanes").append('<div id="lane_' + i + '"> \
        <h4>Lane ' + i + '</h4> \
        <table class="table table-bordered narrow-headers" id="summary_lane_'+i+'""> \
            <tbody></tbody> \
        </table> \
    </div>')
};

$.getJSON("/api/v1/flowcell_info2/{{ flowcell }}", function(data) {
    var tbody = '<tr> \
                     <th>Sequencing done</th> \
                     <td>' + data['seqdone'] + '</td> \
                 </tr> \
                 <tr> \
                     <th>Demultiplex</th>';
    if(data.hasOwnProperty("demuldone")){
        tbody+="<td><span class='label label-success'>Done</label></td> \
        </tr>\
        <tr> \
            <th>Projects :</th>\
            <td>" + data["plist"].join(", ") + "</td>\
        </tr>";
        for (lid=1;lid<9;lid++){
            if (data['yields'][lid] !== 0){
                var sbody="<tr> \
                    <th>Total Yield :</th> \
                    <td>" + data['yields'][lid] + "</td> \
                </tr>";
            }
            if (data['seq_qc'][lid] !== 0){
                sbody+="<tr> \
                    <th>Sequencing QC:</th> \
                    <td>" + data['seq_qc'][lid] + "</td> \
                </tr>";
            }
            for(i=1;i<4;i++){
                if(data.hasOwnProperty('err'+i)){
                    sbody+="<tr> \
                        <th>Read "+i+" Error rate :</th> \
                        <td>"+data['err'+i][lid]+"</td> \
                    </tr>";
                }
            }
            $("#summary_lane_"+lid+" tbody").html(sbody);
        }
        for (lid in data['lane']){
            if(data['lane'][lid].length == 0){
                continue;
            }
            var lbody='<table class="table table-bordered" id="table_lane_' + i + '"> \
                        <tbody> \
                            <tr> \
                                <th>Project Name</th> \
                                <th>Sample Name</th> \
                                <th>Yield (<abbr title="Megabases">Mb</abbr>)</th> \
                                <th># Reads</th> \
                                <th>% &gt; Q30</th> \
                                <th>Barcode</th> \
                                <th>Index description</th> \
                            </tr>';
            for (samplerunid in data['lane'][lid]){
                var q30 = parseFloat(data['lane'][lid][samplerunid]['overthirty']);
                lbody += "<tr> \
                    <td>" + data['lane'][lid][samplerunid]['Project'] + "</td> \
                    <td>" + data['lane'][lid][samplerunid]['SampleName'] + '</td> \
                    <td class="text-right">' + data['lane'][lid][samplerunid]['yield'] + '</td> \
                    <td class="text-right">' + data['lane'][lid][samplerunid]['readsnb'] + '</td> \
                    <td class="text-right ';
                    if (q30 < 30) lbody += 'danger';
                    else if(q30 < 80) lbody += 'warning';
                    else if(q30 < 100) lbody += 'success';
                lbody += '">' + data['lane'][lid][samplerunid]['overthirty'] + "</td>\
                    <td>" + data['lane'][lid][samplerunid]['barcode'] + "</td> \
                    <td>" + data['lane'][lid][samplerunid]['desc'] + "</td> \
                </tr>";
            }
            lbody += '</tbody></table>';
            $("#lane_"+lid).append(lbody);
            
        }

    } else {
        tbody+="<td class ='label label-warning'>Pending</td></tr>"
    }

    $("#fc_info tbody").html(tbody);

    // console.log(data)
});

</script>

{% end %}
{'fraction_non_alphanumeric': 0.22720950815526617, 'fraction_numerical': 0.00783917056517891, 'mean_word_length': 1.7163461538461537, 'pattern_counts': {'":': 0, '<': 223, '<?xml version=': 0, '>': 212, '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': '2960463', 'n_tokens_mistral': 2701, 'n_tokens_neox': 2591, 'n_words': 385}