<commit_before>var RESULTS_PER_PAGE = 100;
var MAX_PAGING = 10;
var current_page = 0;
var current_paging = 0;
var current_lines = [];
var include_dataset_column = false;
var include_hmm_column = false;
var job_id = null;
var interval = null;
var output_interval = null;
var xhr = null;
var trees = {};
var read_datasets = {};
var include_indexes = {};
var column_indexes = {};
var dataset_index = -1;
var hmm_index = -1;
var orf_index = -1;
var homolog_index = -1;
var headers = [];
var current_sort_column = -1;
var current_sort_up = false;
var only_usearch = false; // historical
var sequence_classification = false;
var phylogenetic_classification = false;
var no_exist_count = 0;
var annotations_url = null;
var compare_annotations = null;
var compairison_data = null;
var current_stderr = null;
var current_stdout = null;
var current_pid = null;

var DEFAULT_COLUMNS = [
  'ORF', 'HMM E-val', 'Aligned Length', 'Closest Homolog',
  'Closest Homolog Species', '%id of Closest Homolog', 'Best Representative',
  'Representative Proportion']

var TAXONOMY_COLUMNS = [
  'Species', 'Genus', 'Family', 'Order', 'Class', 'Phylum', 'Superkingdom'
]

function CleanHmmName(hmm_name) {
  if (hmm_name.indexOf('_') >= 0) {
    return hmm_name.substr(0, hmm_name.lastIndexOf('_'));
  } else {
    return hmm_name;
  }
}

function CleanDatasetName(dataset_name) {
  if (dataset_name.indexOf('_') >= 0) {
    return dataset_name.substr(0, dataset_name.lastIndexOf('_'));
  } else {
    return dataset_name;
  }
}

function MakeParametersBox(parameters) {
  var box = $('<div class="parameters" />');
  box.append('<strong>Parameters used:</strong><br/>');
  for (var i = 0; i < parameters.length; i += 1) {
    var parameter = parameters[i];
    var span = $('<span />');
    if (parameter[1] !== '') {
      span.text(parameter[0] + ': ' + parameter[1]);
    } else {
      span.text(parameter[0]);
    }
    box.append(span);
    box.append('<br/>');
  }
  return box;
}

function refresh() {
  if (xhr && xhr.readystate != 4) {
    xhr.abort();
  }
  xhr = $.get( "./job"+job_id, function( data ) {
    if (!jQuery.isEmptyObject(data)) {
      if ('no_exist' in data) {
        if (no_exist_count >= 1) {
          $('#status').empty().append('Job does not exists.');
          clearInterval(interval);
        } else {
          no_exist_count += 1;
        }
        return;
      }
      var status_box = $('#status');
      status_box.empty();
      if ('failed' in data) {
        status_box.append('Job terminated before completion.');
        clearInterval(interval);
        return;
      }
      var parameters = null;
      if ('meta' in data && 'parameters' in data['meta']) {
        parameters = data['meta']['parameters'];
      } else if ('result' in data && 'parameters' in data['result']) {
        parameters = data['result']['parameters'];
      }
      if (parameters) {
        status_box.append(MakeParametersBox(parameters));
        status_box.append('<br/>');
      }

      if ('meta' in data) {
        var num_orfs = -1;
        var num_refs = -1;
        var meta = data['meta'];
        current_pid = 'pid' in meta ? meta['pid'] : null;<commit_msg>fix typo<commit_after>var RESULTS_PER_PAGE = 100;
var MAX_PAGING = 10;
var current_page = 0;
var current_paging = 0;
var current_lines = [];
var include_dataset_column = false;
var include_hmm_column = false;
var job_id = null;
var interval = null;
var output_interval = null;
var xhr = null;
var trees = {};
var read_datasets = {};
var include_indexes = {};
var column_indexes = {};
var dataset_index = -1;
var hmm_index = -1;
var orf_index = -1;
var homolog_index = -1;
var headers = [];
var current_sort_column = -1;
var current_sort_up = false;
var only_usearch = false; // historical
var sequence_classification = false;
var phylogenetic_classification = false;
var no_exist_count = 0;
var annotations_url = null;
var compare_annotations = null;
var compairison_data = null;
var current_stderr = null;
var current_stdout = null;
var current_pid = null;

var DEFAULT_COLUMNS = [
  'ORF', 'HMM E-val', 'Aligned Length', 'Closest Homolog',
  'Closest Homolog Species', '%id of Closest Homolog', 'Best Representative',
  'Representative Proportion']

var TAXONOMY_COLUMNS = [
  'Species', 'Genus', 'Family', 'Order', 'Class', 'Phylum', 'Superkingdom'
]

function CleanHmmName(hmm_name) {
  if (hmm_name.indexOf('_') >= 0) {
    return hmm_name.substr(0, hmm_name.lastIndexOf('_'));
  } else {
    return hmm_name;
  }
}

function CleanDatasetName(dataset_name) {
  if (dataset_name.indexOf('_') >= 0) {
    return dataset_name.substr(0, dataset_name.lastIndexOf('_'));
  } else {
    return dataset_name;
  }
}

function MakeParametersBox(parameters) {
  var box = $('<div class="parameters" />');
  box.append('<strong>Parameters used:</strong><br/>');
  for (var i = 0; i < parameters.length; i += 1) {
    var parameter = parameters[i];
    var span = $('<span />');
    if (parameter[1] !== '') {
      span.text(parameter[0] + ': ' + parameter[1]);
    } else {
      span.text(parameter[0]);
    }
    box.append(span);
    box.append('<br/>');
  }
  return box;
}

function refresh() {
  if (xhr && xhr.readystate != 4) {
    xhr.abort();
  }
  xhr = $.get( "./job"+job_id, function( data ) {
    if (!jQuery.isEmptyObject(data)) {
      if ('no_exist' in data) {
        if (no_exist_count >= 1) {
          $('#status').empty().append('Job does not exist.');
          clearInterval(interval);
        } else {
          no_exist_count += 1;
        }
        return;
      }
      var status_box = $('#status');
      status_box.empty();
      if ('failed' in data) {
        status_box.append('Job terminated before completion.');
        clearInterval(interval);
        return;
      }
      var parameters = null;
      if ('meta' in data && 'parameters' in data['meta']) {
        parameters = data['meta']['parameters'];
      } else if ('result' in data && 'parameters' in data['result']) {
        parameters = data['result']['parameters'];
      }
      if (parameters) {
        status_box.append(MakeParametersBox(parameters));
        status_box.append('<br/>');
      }

      if ('meta' in data) {
        var num_orfs = -1;
        var num_refs = -1;
        var meta = data['meta'];
        current_pid = 'pid' in meta ? meta['pid'] : null;
{'fraction_non_alphanumeric': 0.15583596214511042, 'fraction_numerical': 0.008832807570977918, 'mean_word_length': 3.1827176781002637, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 23, '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': '4458245', 'n_tokens_mistral': 2141, 'n_tokens_neox': 2065, 'n_words': 526}