How to use the ve-sequence-utils.convertDnaCaretPositionOrRangeToAA 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 / withEditorInteractions / createSequenceInputPopup.js View on Github external
-1,
        selectionLayer,
        sequenceLength
      );

      message = (
        <span>
          Press <span style="{{">ENTER</span> to replace{" "}
          {divideBy3(getRangeLength(selectionLayer, sequenceLength), isProtein)}{" "}
          {isProtein ? "AAs" : "base pairs"} between{" "}
          {isProtein
            ? convertDnaCaretPositionOrRangeToAA(betweenVals[0])
            : betweenVals[0]}{" "}
          and{" "}
          {isProtein
            ? convertDnaCaretPositionOrRangeToAA(betweenVals[1] + 2)
            : betweenVals[1]}
        </span>
      );
    } else {
      message = (
        <span>
          Press <span style="{{">ENTER</span> to insert{" "}
          {charsToInsert.length} {isProtein ? "AAs" : "base pairs"} after{" "}
          {isProtein ? "AA" : "base"}{" "}
          {isProtein
            ? convertDnaCaretPositionOrRangeToAA(caretPosition)
            : caretPosition}
        </span>
      );
    }
    return (
github TeselaGen / openVectorEditor / src / helperComponents / PropertiesDialog / utils.js View on Github external
render: (val, _record, i, props) =&gt; {
    const record = props.isProtein
      ? convertDnaCaretPositionOrRangeToAA(_record)
      : _record;
    const base1Range = convertRangeTo1Based(record);
    const hasJoinedLocations = record.locations &amp;&amp; record.locations.length &gt; 1;

    return (
      <span>
        {props.isProtein ? Math.floor(val / 3) : val}{" "}
        <span style="{{">
          {hasJoinedLocations ? (
            record.locations.map((loc, i) =&gt; {
              const base1Range = convertRangeTo1Based(loc);
              return (
                <span>
                  ({base1Range.start}-{base1Range.end})
                </span>
              );</span></span>
github TeselaGen / openVectorEditor / src / withEditorInteractions / createSequenceInputPopup.js View on Github external
let message;
    if (isReplace) {
      let betweenVals = getInsertBetweenVals(
        -1,
        selectionLayer,
        sequenceLength
      );

      message = (
        <span>
          Press <span style="{{">ENTER</span> to replace{" "}
          {divideBy3(getRangeLength(selectionLayer, sequenceLength), isProtein)}{" "}
          {isProtein ? "AAs" : "base pairs"} between{" "}
          {isProtein
            ? convertDnaCaretPositionOrRangeToAA(betweenVals[0])
            : betweenVals[0]}{" "}
          and{" "}
          {isProtein
            ? convertDnaCaretPositionOrRangeToAA(betweenVals[1] + 2)
            : betweenVals[1]}
        </span>
      );
    } else {
      message = (
        <span>
          Press <span style="{{">ENTER</span> to insert{" "}
          {charsToInsert.length} {isProtein ? "AAs" : "base pairs"} after{" "}
          {isProtein ? "AA" : "base"}{" "}
          {isProtein
            ? convertDnaCaretPositionOrRangeToAA(caretPosition)
            : caretPosition}</span>
github TeselaGen / openVectorEditor / src / withEditorInteractions / createSequenceInputPopup.js View on Github external
? convertDnaCaretPositionOrRangeToAA(betweenVals[0])
            : betweenVals[0]}{" "}
          and{" "}
          {isProtein
            ? convertDnaCaretPositionOrRangeToAA(betweenVals[1] + 2)
            : betweenVals[1]}
        
      );
    } else {
      message = (
        <span>
          Press <span style="{{">ENTER</span> to insert{" "}
          {charsToInsert.length} {isProtein ? "AAs" : "base pairs"} after{" "}
          {isProtein ? "AA" : "base"}{" "}
          {isProtein
            ? convertDnaCaretPositionOrRangeToAA(caretPosition)
            : caretPosition}
        </span>
      );
    }
    return (
      <div>
        <input> {
            if (e.keyCode === 27) {
              this.handleUnmount();
            }
            if (e.keyCode === 13) {
              this.handleInsert();
              this.handleUnmount();
            }</div>