<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');

function display_undetermined(lane){
    $("#table_ud_lane_" + lane + ':first').slideToggle();
}

for (var i = 1; i < 9; i++) {
    $("#lanes").append('<div id="lane_' + i + '" class="hidden sublane"><h4>Lane ' + i + '<span id="button_lane_' + i + '"></span></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 = '';

    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")){
        // tresholds for the number of clusters: depending on the run mode
        var run_mode = data['run_mode'];
        var treshold = 0;
        if (run_mode == 'HiSeq X') {
            treshold = 320;
        } else if (run_mode == 'RapidHighOutput') {
            treshold = 188;
        } else if (run_mode == 'RapidRun') {
            treshold = 114;
        } else if (run_mode == 'HighOutput') {
            treshold = 143;
        }
        // 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-left" >' + nice_numbers(data['lanedata'][lid]['yield']) + '</td> \
                    <th>Total clusters :</th> \
                    <td class="text-left ';
                // parse millions from a string
                var clusters_number = parseInt(data['lanedata'][lid]['clustersnb'].replace(/,/g, '')) / 1000000;
                var clusters_class = '';
                if (clusters_number < treshold) {
                    clusters_class = 'warning';
                } else {<commit_msg>Flowcell page: tresholds for MiSeq<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');

function display_undetermined(lane){
    $("#table_ud_lane_" + lane + ':first').slideToggle();
}

for (var i = 1; i < 9; i++) {
    $("#lanes").append('<div id="lane_' + i + '" class="hidden sublane"><h4>Lane ' + i + '<span id="button_lane_' + i + '"></span></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 = '';

    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")){
        // tresholds for the number of clusters: depending on the run mode
        var run_mode = data['run_mode'];
        var treshold = 0;
        if (run_mode == 'HiSeq X') {
            treshold = 320;
        } else if (run_mode == 'RapidHighOutput') {
            treshold = 188;
        } else if (run_mode == 'RapidRun') {
            treshold = 114;
        } else if (run_mode == 'HighOutput') {
            treshold = 143;
        } else if (run_mode == 'MiSeq Version2') {
            treshold = 10;
        } else if (run_mode == 'MiSeq Version3') {
            treshold = 18;
        }
        // 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-left" >' + nice_numbers(data['lanedata'][lid]['yield']) + '</td> \
                    <th>Total clusters :</th> \
                    <td class="text-left ';
                // parse millions from a string
                var clusters_number = parseInt(data['lanedata'][lid]['clustersnb'].replace(/,/g, '')) / 1000000;
                var clusters_class = '';
                if (clusters_number < treshold) {
                    clusters_class = 'warning';
                } else {
{'fraction_non_alphanumeric': 0.16811165151194757, 'fraction_numerical': 0.013110594205963206, 'mean_word_length': 2.069435431537962, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 45, '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': '1672580', 'n_tokens_mistral': 1558, 'n_tokens_neox': 1458, 'n_words': 342}