Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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;