How to use the ve-sequence-utils.cutSequenceByRestrictionEnzyme 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 / AddAdditionalEnzymes / index.js View on Github external
enzymesToAdd: enzymesToAdd.map(function({ value }) {
                  const times = cutSequenceByRestrictionEnzyme(
                    inputSequenceToTestAgainst,
                    true,
                    value
                  ).length;
                  return {
                    label:
                      value.name +
                      ` (Cuts ${times} time${times === 1 ? "" : "s"})`,
                    value
                  };
                })
              });
github TeselaGen / openVectorEditor / src / AddAdditionalEnzymes / index.js View on Github external
if (
    !enzyme.name ||
    !enzyme.site ||
    !enzyme.forwardRegex ||
    !enzyme.reverseRegex ||
    (!enzyme.topSnipOffset && enzyme.topSnipOffset !== 0) ||
    (!enzyme.bottomSnipOffset && enzyme.bottomSnipOffset !== 0)
  ) {
    invalid = true;
  }

  let matches;
  if (regexString.length === 0) {
    matches = [];
  } else {
    matches = cutSequenceByRestrictionEnzyme(
      inputSequenceToTestAgainst,
      true,
      enzyme
    );
  }

  const errors = validate(addAdditionalEnzymes);
  if (Object.keys(errors || {}).length) {
    invalid = true;
  }
  function onChange(updatedVal) {
    dispatch({
      type: "ADD_ADDITIONAL_ENZYMES_UPDATE",
      payload: {
        ...addAdditionalEnzymes,
        ...updatedVal