<commit_before>/*
File: flowcell_samples.js
URL: /static/js/flowcell_samples.js
Powers /flowcells/[FcID] - template is run_dir/design/flowcell_samples.html
*/

// Get data attributes
var flowcell = $('#flowcells-js').attr('data-flowcell');


for (var i = 1; i < 9; i++) {
    $("#lanes").append('<div id="lane_' + i + '" class="hidden"><h4>Lane ' + i + '</h4></div>')
};

$.getJSON("/api/v1/flowcell_info2/"+flowcell, function(data) {

    load_running_notes()
    load_links()
    
    // Fill in the main table with summary information
    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>';
    } else {
        tbody += '<td><span class="label label-warning"">Pending</span></td></tr>';
    }
    tbody += "</tr>";
    if(data.hasOwnProperty("plist")){
        tbody += "<tr> \
            <th>Projects :</th>\
            <td>" + data["plist"].join(", ") + "</td>\
        </tr>";
    }
    $("#fc_info tbody").html(tbody);
    
    // If demultiplexed, get additional information for each lane
    if(data.hasOwnProperty("demuldone")){
        
        // First table - Overall lane stats
        for (lid=1; lid<9; lid++){
            var sbody = '';
            if ('lanedata'in data && lid in data['lanedata']){
                sbody = '<tr> \
                    <th>Total Yield (<abbr title="Megabases">Mb</abbr>):</th> \
                    <td class="text-right" >' + data['lanedata'][lid]['yield'] + '</td> \
                    <th>Total clusters :</th> \
                    <td class="text-right">' + data['lanedata'][lid]['clustersnb'] + '</td> \
                    <th>% bases > Q30:</th> \
                    <td class="text-right ';
                q30=data['lanedata'][lid]['overthirty']
                if (q30 < 30) sbody += 'danger';
                else if(q30 < 80) sbody += 'warning';
                else if(q30 < 100) sbody += 'success';
                sbody+='">' + q30 + '</td> \
                    <th>Mean Quality Score:</th> \
                    <td class="text-right">' + data['lanedata'][lid]['mqs'] + '</td> \
                    <th>% perfect barcode :</th> \
                    <td class="text-right">' + data['lanedata'][lid]['perf'] + '</td> \
                </tr>';
            } else if (data['yields'][lid] != 0){
                    sbody='<tr><th>Total Yield (<abbr title="Megabases">Mb</abbr>):</th> \
                    <td>' + data['yields'][lid]+ '</td></tr>';
            }
            status = data['seq_qc'][lid];<commit_msg>text-right for ths. looks ugly as hell though<commit_after>/*
File: flowcell_samples.js
URL: /static/js/flowcell_samples.js
Powers /flowcells/[FcID] - template is run_dir/design/flowcell_samples.html
*/

// Get data attributes
var flowcell = $('#flowcells-js').attr('data-flowcell');


for (var i = 1; i < 9; i++) {
    $("#lanes").append('<div id="lane_' + i + '" class="hidden"><h4>Lane ' + i + '</h4></div>')
};

$.getJSON("/api/v1/flowcell_info2/"+flowcell, function(data) {

    load_running_notes()
    load_links()
    
    // Fill in the main table with summary information
    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>';
    } else {
        tbody += '<td><span class="label label-warning"">Pending</span></td></tr>';
    }
    tbody += "</tr>";
    if(data.hasOwnProperty("plist")){
        tbody += "<tr> \
            <th>Projects :</th>\
            <td>" + data["plist"].join(", ") + "</td>\
        </tr>";
    }
    $("#fc_info tbody").html(tbody);
    
    // If demultiplexed, get additional information for each lane
    if(data.hasOwnProperty("demuldone")){
        
        // First table - Overall lane stats
        for (lid=1; lid<9; lid++){
            var sbody = '';
            if ('lanedata'in data && lid in data['lanedata']){
                sbody = '<tr> \
                    <th class="text-right" >Total Yield (<abbr title="Megabases">Mb</abbr>):</th> \
                    <td class="text-right" >' + data['lanedata'][lid]['yield'] + '</td> \
                    <th class="text-right" >Total clusters :</th> \
                    <td class="text-right">' + data['lanedata'][lid]['clustersnb'] + '</td> \
                    <th class="text-right" >% bases > Q30:</th> \
                    <td class="text-right ';
                q30=data['lanedata'][lid]['overthirty']
                if (q30 < 30) sbody += 'danger';
                else if(q30 < 80) sbody += 'warning';
                else if(q30 < 100) sbody += 'success';
                sbody+='">' + q30 + '</td> \
                    <th class="text-right" >Mean Quality Score:</th> \
                    <td class="text-right">' + data['lanedata'][lid]['mqs'] + '</td> \
                    <th class="text-right" >% perfect barcode :</th> \
                    <td class="text-right">' + data['lanedata'][lid]['perf'] + '</td> \
                </tr>';
            } else if (data['yields'][lid] != 0){
                    sbody='<tr><th>Total Yield (<abbr title="Megabases">Mb</abbr>):</th> \
                    <td>' + data['yields'][lid]+ '</td></tr>';
            }
            status = data['seq_qc'][lid];
{'fraction_non_alphanumeric': 0.2048660084626234, 'fraction_numerical': 0.009873060648801129, 'mean_word_length': 1.7904574520413183, 'pattern_counts': {'":': 0, '<': 135, '<?xml version=': 0, '>': 127, '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': '4316697', 'n_tokens_mistral': 1896, 'n_tokens_neox': 1801, 'n_words': 356}