How to use the ve-sequence-utils.getCutsitesFromSequence function in ve-sequence-utils

To help you get started, we’ve selected a few ve-sequence-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TeselaGen / openVectorEditor / src / selectors / cutsitesSelector.js View on Github external
function cutsitesSelector(sequence, circular, enzymeList) {
  //get the cutsites grouped by enzyme
  let cutsitesByName = getCutsitesFromSequence(
    sequence,
    circular,
    Object.keys(enzymeList).map(function(enzymeName) {
      return enzymeList[enzymeName];
    })
  );
  //tag each cutsite with a unique id
  let cutsitesById = {};

  Object.keys(cutsitesByName).forEach(function(enzymeName) {
    let cutsitesForEnzyme = cutsitesByName[enzymeName];
    cutsitesForEnzyme.forEach(function(cutsite) {
      const numberOfCuts = cutsitesByName[enzymeName].length;
      const uniqueId = bsonObjectid().str;
      cutsite.id = uniqueId;
      cutsite.numberOfCuts = numberOfCuts;