static/js/binning.js
/**
 * Add selected contigs to a bin.
 * @function addToBin
 * @param {string} name - target bin name
 * @param {number[]} picked - contig selection
 * @param {string[]} binned - binning plan
 * @returns {number[], number[]} indices of added and existing contigs
 */
Add selected contigs to a bin.
Add selected contigs to a bin .
function addToBin(name, picked, binned) {
  const added = [], existing = [];
  const n = picked.length;
  for (let i = 0; i < n; i++) {
    if (binned[i] === name) {
      existing.push(i);
    } else if (picked[i]) {
      binned[i] = name;
      added.push(i);
    }
  }
  return [added, existing];
}
function addToBin ( name , picked , binned ) { const added = [ ] , existing = [ ] ; const n = picked . length ; for ( let i = 0 ; i < n ; i ++ ) { if ( binned [ i ] === name ) { existing . push ( i ) ; } else if ( picked [ i ] ) { binned [ i ] = name ; added . push ( i ) ; } } return [ added , existing ] ; }
Add selected contigs to a bin.
Add selected contigs to a bin .