function process_plant_tsv(file_str) {
  var rows = [];
  var feature_arr = [];
  var row_id = 0;
  var header = true;

  var lines = file_str.split('\n');
  for (line of lines) {
    row_id += 1;
    var arr = line.trim().split('\t');
    //  Get an array of header
    if (header) {
      num_of_cols = arr.length;
      for (var i = 0; i < num_of_cols; i++) {
        feature_arr.push(arr[i].trim());
      }
      header = false;
    } else {
      if (arr.length < num_of_cols) {
        console.log('Error on row', row_id, 'Not enough columns!', arr);
        continue;
      }
      for (var i = 0; i < arr.length; i++) {
        arr[i] = arr[i].trim();
      }

      row = arr.slice(0, num_of_cols);
      labels = arr.slice(num_of_cols, arr.length);
      rows.push([row].concat([labels]));
    }
  }

  attr_header = feature_arr; //global
  data_rows = rows; //global
}
// Put the header and raw file into the arries from raw file

Put the header and raw file into the arries from raw file
Put the header and raw file into the arries from raw file
function process_plant_tsv(file_str) {
  var rows = [];
  var feature_arr = [];
  var row_id = 0;
  var header = true;
  var lines = file_str.split('\n');
  for (line of lines) {
    row_id += 1;
    var arr = line.trim().split('\t');
    if (header) {
      num_of_cols = arr.length;
      for (var i = 0; i < num_of_cols; i++) {
        feature_arr.push(arr[i].trim());
      }
      header = false;
    } else {
      if (arr.length < num_of_cols) {
        console.log('Error on row', row_id, 'Not enough columns!', arr);
        continue;
      }
      for (var i = 0; i < arr.length; i++) {
        arr[i] = arr[i].trim();
      }
      row = arr.slice(0, num_of_cols);
      labels = arr.slice(num_of_cols, arr.length);
      rows.push([row].concat([labels]));
    }
  }
  attr_header = feature_arr; 
  data_rows = rows; 
}
function process_plant_tsv ( file_str ) { var rows = [ ] ; var feature_arr = [ ] ; var row_id = 0 ; var header = true ; var lines = file_str . split ( '\n' ) ; for ( line of lines ) { row_id += 1 ; var arr = line . trim ( ) . split ( '\t' ) ; if ( header ) { num_of_cols = arr . length ; for ( var i = 0 ; i < num_of_cols ; i ++ ) { feature_arr . push ( arr [ i ] . trim ( ) ) ; } header = false ; } else { if ( arr . length < num_of_cols ) { console . log ( 'Error on row' , row_id , 'Not enough columns!' , arr ) ; continue ; } for ( var i = 0 ; i < arr . length ; i ++ ) { arr [ i ] = arr [ i ] . trim ( ) ; } row = arr . slice ( 0 , num_of_cols ) ; labels = arr . slice ( num_of_cols , arr . length ) ; rows . push ( [ row ] . concat ( [ labels ] ) ) ; } } attr_header = feature_arr ; data_rows = rows ; }
Put the header and raw file into the arries from raw file
Put the header and raw file into the arries from raw file
//  Get an array of header
 //global
 //global
