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