@teselagen/ove 0.7.26 → 0.7.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AASliver.js +187 -0
- package/AddLaddersDialog.js +82 -0
- package/AdditionalCutsiteInfoDialog.js +599 -0
- package/AlignmentView/Mismatches.d.ts +3 -3
- package/AlignmentVisibilityTool.js +105 -0
- package/AnnotationContainerHolder.js +20 -0
- package/AnnotationPositioner.js +27 -0
- package/AutoAnnotate.js +501 -0
- package/AutoAnnotateBpMatchingDialog.js +208 -0
- package/Axis.js +151 -0
- package/AxisNumbers.js +35 -0
- package/Browser.js +106 -0
- package/Caret.js +63 -0
- package/Chromatogram.js +293 -0
- package/CircularDnaSequence.js +73 -0
- package/CircularView/Labels/index.d.ts +1 -1
- package/CircularView/index.d.ts +0 -1
- package/CircularZoomMinimap.js +16 -0
- package/ColorPicker.js +30 -0
- package/CommandHotkeyHandler.js +44 -0
- package/CreateAnnotationsPage.d.ts +4 -4
- package/CreateAnnotationsPage.js +98 -0
- package/Cutsite.js +18 -0
- package/CutsiteProperties.js +176 -0
- package/CutsiteSelectionLayers.js +47 -0
- package/Cutsites.js +271 -0
- package/DeletionLayer.js +28 -0
- package/DigestTool/Ladder.d.ts +1 -1
- package/DropHandler.css +21 -0
- package/DropHandler.js +64 -0
- package/EditCaretPosition.js +234 -0
- package/EditTrackNameDialog.js +30 -0
- package/Feature.js +83 -0
- package/FeatureProperties.js +6 -0
- package/FillWindow.js +47 -0
- package/GenbankView.js +74 -0
- package/GeneralProperties.js +117 -0
- package/GenericAnnotationProperties.js +406 -0
- package/GlobalDialog.js +73 -0
- package/GlobalDialogUtils.js +110 -0
- package/GoToDialog.js +25 -0
- package/HorizontalPanelDragHandle.js +35 -0
- package/Keyboard.js +85 -0
- package/Labels.js +327 -0
- package/Ladder.css +20 -0
- package/Ladder.js +303 -0
- package/MeltingTemp.js +85 -0
- package/Menlo.ttf +0 -0
- package/Minimap.js +515 -0
- package/Mismatches.js +134 -0
- package/Monaco.ttf +0 -0
- package/MultipleSeqsDetectedOnImportDialog.js +74 -0
- package/Orf.js +109 -0
- package/OrfProperties.js +117 -0
- package/Orfs.js +35 -0
- package/PCRTool.js +179 -0
- package/PairwiseAlignmentView.js +68 -0
- package/Part.js +34 -0
- package/PartProperties.js +9 -0
- package/PassThrough.js +3 -0
- package/PerformantSelectionLayer.js +32 -0
- package/PinchHelper.js +24 -0
- package/PointedAnnotation.js +347 -0
- package/PositionAnnotationOnCircle.js +26 -0
- package/Primer.js +41 -0
- package/PrimerProperties.js +19 -0
- package/Reflex/index.d.ts +0 -1
- package/ReflexContainer.js +802 -0
- package/ReflexElement.js +160 -0
- package/ReflexEvents.js +77 -0
- package/ReflexSplitter.js +205 -0
- package/RenameSequenceDialog.js +7 -0
- package/RotateCircularViewSlider.js +93 -0
- package/RowView/index.d.ts +0 -1
- package/SelectDialog.js +150 -0
- package/SequenceName.js +15 -0
- package/SimpleCircularOrLinearView.js +381 -0
- package/SimpleOligoPreview.js +39 -0
- package/SingleEnzymeCutsiteInfo.js +139 -0
- package/ToolBar/ToolbarItem.d.ts +1 -3
- package/ToolbarItem.js +192 -0
- package/Translation.js +198 -0
- package/TranslationProperties.js +149 -0
- package/UncontrolledSliderWithPlusMinusBtns.css +5 -0
- package/UncontrolledSliderWithPlusMinusBtns.js +134 -0
- package/VeTopRightContainer.js +12 -0
- package/ZoomCircularViewSlider.js +62 -0
- package/ZoomLinearView.js +47 -0
- package/addAlignment.js +6 -0
- package/addMetaToActionCreators.js +12 -0
- package/addWrappedAddons.js +20 -0
- package/alignmentTool.js +503 -0
- package/alignments.js +379 -0
- package/annotationLabelVisibility.js +2 -0
- package/annotationSearchSelector.js +24 -0
- package/annotationTypes.js +35 -0
- package/annotationVisibility.js +196 -0
- package/annotationsToSupport.js +104 -0
- package/arrayToObjWithIds.js +17 -0
- package/arrayUtils.js +19 -0
- package/array_move.js +10 -0
- package/calculateTickMarkPositionsForGivenRange.js +47 -0
- package/caretPosition.js +27 -0
- package/cdsFeaturesSelector.js +9 -0
- package/charWidth.js +22 -0
- package/circular.js +19 -0
- package/circularSelector.js +4 -0
- package/clickAndDragUtils.js +576 -0
- package/coerceInitialValue.js +7 -0
- package/combineReducersDontIgnoreKeys.js +12 -0
- package/commandUtils.js +20 -0
- package/constants.js +2 -0
- package/copyOptions.js +34 -0
- package/createFragmentLines.js +120 -0
- package/createMergedDefaultStateReducer.js +30 -0
- package/createMetaAction.js +12 -0
- package/createSequenceInputPopup.js +290 -0
- package/createSequenceInputPopupStyle.css +87 -0
- package/createSimpleDialog.js +89 -0
- package/createYourOwnEnzyme.js +39 -0
- package/cutsiteLabelColorSelector.js +6 -0
- package/cutsiteTool.js +88 -0
- package/cutsitesByRangeSelector.js +5 -0
- package/cutsitesSelector.js +61 -0
- package/darkmode.css +98 -0
- package/defaultConfig.js +150 -0
- package/deletionLayers.js +36 -0
- package/description.js +21 -0
- package/digestTool.js +34 -0
- package/dnaToColor.js +17 -0
- package/downloadTool.js +39 -0
- package/draggableClassnames.js +5 -0
- package/drawAnnotations.js +440 -0
- package/drawDirectedPiePiece.js +142 -0
- package/editTool.js +49 -0
- package/editorSelector.js +2 -0
- package/editorUtils.js +205 -0
- package/estimateRowHeight.js +184 -0
- package/featureLengthsToHide.js +27 -0
- package/featureTool.js +34 -0
- package/features.js +19 -0
- package/featuresSelector.js +8 -0
- package/filteredCutsitesSelector.js +136 -0
- package/filteredFeaturesSelector.js +32 -0
- package/filteredPartsSelector.js +57 -0
- package/filteredPrimersSelector.js +27 -0
- package/filteredRestrictionEnzymesSelector.js +1 -0
- package/find.png +0 -0
- package/findTool.js +79 -0
- package/findToolConstants.js +1 -0
- package/frameTranslations.js +52 -0
- package/fullscreen.png +0 -0
- package/getAdditionalEnzymesSelector.js +46 -0
- package/getAngleForPositionMidpoint.js +3 -0
- package/getAnnotationClassnames.js +12 -0
- package/getAnnotationNameAndStartStopString.js +61 -0
- package/getBpsPerRow.js +19 -0
- package/getCutsiteLabelHeights.js +56 -0
- package/getGapMap.js +12 -0
- package/getGaps.js +27 -0
- package/getInternalLabel.js +40 -0
- package/getOveHotkeyDefs.js +12 -0
- package/getPairwiseOverviewLinearViewOptions.js +38 -0
- package/getRangeAnglesSpecial.js +12 -0
- package/getStructuredBases.js +97 -0
- package/getTrackFromEvent.js +25 -0
- package/getVisibleStartEnd.js +7 -0
- package/getXStartAndWidthFromNonCircularRange.js +12 -0
- package/getXStartAndWidthOfRangeWrtRow.js +27 -0
- package/getXStartAndWidthOfRowAnnotation.js +19 -0
- package/getYOffset.js +15 -0
- package/hoveredAnnotation.js +24 -0
- package/{html2canvas.esm--JN4fLQL.js → html2canvas.esm-DiGWN1gP.js} +187 -229
- package/{html2canvas.esm-B7d7VJmQ.cjs → html2canvas.esm-J1esNpMJ.cjs} +187 -229
- package/importTool.js +27 -0
- package/index.cjs.js +48165 -47142
- package/index.es.js +47699 -46676
- package/index.js +71 -0
- package/inlineFindTool.js +38 -0
- package/isElementInViewport.js +29 -0
- package/isEnzymeFilterAndSelector.js +1 -0
- package/isTargetWithinEl.js +6 -0
- package/labelLineIntensity.js +25 -0
- package/labelSize.js +23 -0
- package/ladderDefaults.js +25 -0
- package/lastSavedId.js +20 -0
- package/lineageLines.js +11 -0
- package/linear.png +0 -0
- package/makeStore.js +34 -0
- package/massageTickSpacing.js +19 -0
- package/materiallyAvailable.js +19 -0
- package/middleware.js +112 -0
- package/minimumOrfSize.js +24 -0
- package/minimumOrfSizeSelector.js +2 -0
- package/modalActions.js +3 -0
- package/moveCaret.js +58 -0
- package/name.js +19 -0
- package/normalizeAngle.js +3 -0
- package/normalizeAngleRange.js +9 -0
- package/oligoTool.js +30 -0
- package/onlyUpdateForKeysDeep.js +31 -0
- package/orfFrameToColorMap.js +10 -0
- package/orfTool.js +136 -0
- package/orfsSelector.js +15 -0
- package/ove.css +12107 -0
- package/package.json +8 -7
- package/panelsShown.js +294 -0
- package/partLengthsToHide.js +23 -0
- package/partOverhangs.js +6 -0
- package/partTagSearch.js +69 -0
- package/partTool.js +45 -0
- package/parts.js +19 -0
- package/partsSelector.js +8 -0
- package/pie.png +0 -0
- package/polarToSpecialCartesian.js +7 -0
- package/positionCutsites.js +6 -0
- package/prepareRowData.js +64 -0
- package/primerBases.js +221 -0
- package/primerLengthsToHide.js +27 -0
- package/primers.js +19 -0
- package/primersSelector.js +8 -0
- package/print.png +0 -0
- package/printTool.js +31 -0
- package/propertiesTool.js +40 -0
- package/proteinUtils.js +3 -0
- package/pureNoFunc.js +18 -0
- package/readOnly.js +25 -0
- package/redoTool.js +30 -0
- package/reflex-styles.css +128 -0
- package/reflex-styles.css.map +9 -0
- package/relaxLabelAngles.js +157 -0
- package/relaxLabels_DEPRECATED.js +105 -0
- package/replacementLayers.js +36 -0
- package/restrictionEnzymes.js +52 -0
- package/restrictionEnzymesSelector.js +34 -0
- package/rowviewContants.js +3 -0
- package/ruler.css +89 -0
- package/save.png +0 -0
- package/saveTool.js +44 -0
- package/searchLayersSelector.js +71 -0
- package/selectedAnnotations.js +89 -0
- package/selectedAnnotationsSelector.js +1 -0
- package/selectedCutsitesSelector.js +21 -0
- package/selectedPartTags.js +21 -0
- package/selectionLayer.js +25 -0
- package/selectors/annotationSearchSelector.d.ts +1 -1
- package/sequence.js +12 -0
- package/sequenceDataHistory.js +43 -0
- package/sequenceDataSelector.js +2 -0
- package/sequenceLengthSelector.js +5 -0
- package/sequenceSelector.js +4 -0
- package/sharedActionCreators.js +0 -0
- package/shouldFlipText.js +4 -0
- package/shouldRerender.js +27 -0
- package/showFileDialog.js +25 -0
- package/showGCContent.js +23 -0
- package/show_cut_sites.png +0 -0
- package/show_features.png +0 -0
- package/show_orfs.png +0 -0
- package/show_primers.png +0 -0
- package/simpleDialog.css +13 -0
- package/specialCutsiteFilterOptions.js +22 -0
- package/src/Editor/DropHandler.js +2 -1
- package/src/Editor/index.js +0 -2
- package/src/RowItem/StackedAnnotations/getStructuredBases.js +20 -6
- package/src/ToolBar/cutsiteTool.js +1 -1
- package/src/helperComponents/PropertiesDialog/TranslationProperties.js +2 -1
- package/style.css +3 -12100
- package/tagsToBoldSelector.js +2 -0
- package/toggle_views.svg +1 -0
- package/toolBar.js +23 -0
- package/translationSearchMatchesSelector.js +14 -0
- package/translations.js +20 -0
- package/translationsRawSelector.js +8 -0
- package/translationsSelector.js +137 -0
- package/typeField.js +24 -0
- package/undoTool.js +30 -0
- package/updateEditor.d.ts +1 -3
- package/updateEditor.js +200 -0
- package/updateLabelsForInViewFeatures.js +55 -0
- package/updateLabelsForInViewFeaturesCircView.js +41 -0
- package/updateTrackHelper.js +58 -0
- package/uppercaseSequenceMapFont.js +25 -0
- package/upsertDeleteActionGenerator.js +31 -0
- package/useAAColorType.js +8 -0
- package/useAdditionalOrfStartCodons.js +24 -0
- package/useAnnotationLimits.js +42 -0
- package/useChromatogramPrefs.js +31 -0
- package/useFormValue.js +7 -0
- package/useLadders.js +6 -0
- package/useMeltingTemp.js +7 -0
- package/useTmType.js +10 -0
- package/userDefinedHandlersAndOpts.js +61 -0
- package/utils/getAnnotationNameAndStartStopString.d.ts +1 -5
- package/utils/selectionLayer.d.ts +2 -2
- package/utils.js +37 -0
- package/versionHistory.js +26 -0
- package/versionHistoryTool.js +21 -0
- package/viewSubmenu.js +479 -0
- package/visibilityTool.js +39 -0
- package/withEditorInteractions/getBpsPerRow.d.ts +1 -3
- package/withHover.js +113 -0
- package/withRestrictionEnzymes.js +15 -0
- package/index.umd.js +0 -188322
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { createSelector } from "reselect";
|
|
2
|
+
import partsSelector from "./partsSelector";
|
|
3
|
+
import tagsToBoldSelector from "./tagsToBoldSelector";
|
|
4
|
+
import { some, keyBy, omitBy } from "lodash-es";
|
|
5
|
+
import { map } from "lodash-es";
|
|
6
|
+
import sequenceLengthSelector from "./sequenceLengthSelector";
|
|
7
|
+
import { hideAnnByLengthFilter } from "../utils/editorUtils";
|
|
8
|
+
import { addWrappedAddons } from "../utils/addWrappedAddons";
|
|
9
|
+
|
|
10
|
+
function filteredPartsSelector(
|
|
11
|
+
parts,
|
|
12
|
+
seqLen,
|
|
13
|
+
partIndividualToHide,
|
|
14
|
+
tagsToBold,
|
|
15
|
+
lengthsToHide
|
|
16
|
+
) {
|
|
17
|
+
if (tagsToBold) {
|
|
18
|
+
const keyedTagsToBold = keyBy(tagsToBold, "value");
|
|
19
|
+
|
|
20
|
+
return map(parts || {}, p => {
|
|
21
|
+
if (p.tags) {
|
|
22
|
+
if (
|
|
23
|
+
some(p.tags, tagId => {
|
|
24
|
+
return keyedTagsToBold[tagId];
|
|
25
|
+
})
|
|
26
|
+
) {
|
|
27
|
+
return {
|
|
28
|
+
...p,
|
|
29
|
+
className: "partWithSelectedTag",
|
|
30
|
+
labelClassName: "partWithSelectedTag",
|
|
31
|
+
highPriorityLabel: true
|
|
32
|
+
};
|
|
33
|
+
} else {
|
|
34
|
+
return p;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const toRet = map(
|
|
41
|
+
omitBy(parts, ann => {
|
|
42
|
+
const hideIndividually = partIndividualToHide[ann.id];
|
|
43
|
+
return (
|
|
44
|
+
hideAnnByLengthFilter(lengthsToHide, ann, seqLen) || hideIndividually
|
|
45
|
+
);
|
|
46
|
+
})
|
|
47
|
+
);
|
|
48
|
+
return addWrappedAddons(toRet, seqLen);
|
|
49
|
+
}
|
|
50
|
+
export default createSelector(
|
|
51
|
+
partsSelector,
|
|
52
|
+
sequenceLengthSelector,
|
|
53
|
+
state => state.annotationVisibility.partIndividualToHide,
|
|
54
|
+
tagsToBoldSelector,
|
|
55
|
+
state => state.partLengthsToHide,
|
|
56
|
+
filteredPartsSelector
|
|
57
|
+
);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createSelector } from "reselect";
|
|
2
|
+
import { omitBy } from "lodash-es";
|
|
3
|
+
import primersSelector from "./primersSelector";
|
|
4
|
+
import sequenceLengthSelector from "./sequenceLengthSelector";
|
|
5
|
+
import { hideAnnByLengthFilter } from "../utils/editorUtils";
|
|
6
|
+
|
|
7
|
+
function filteredPrimersSelector(
|
|
8
|
+
primers,
|
|
9
|
+
seqLen,
|
|
10
|
+
primerIndividualToHide,
|
|
11
|
+
lengthsToHide
|
|
12
|
+
) {
|
|
13
|
+
return omitBy(primers, ann => {
|
|
14
|
+
const hideIndividually = primerIndividualToHide[ann.id];
|
|
15
|
+
return (
|
|
16
|
+
hideAnnByLengthFilter(lengthsToHide, ann, seqLen) || hideIndividually
|
|
17
|
+
);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default createSelector(
|
|
22
|
+
primersSelector,
|
|
23
|
+
sequenceLengthSelector,
|
|
24
|
+
state => state.annotationVisibility.primerIndividualToHide,
|
|
25
|
+
state => state.primerLengthsToHide,
|
|
26
|
+
filteredPrimersSelector
|
|
27
|
+
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default state => state.restrictionEnzymes.filteredRestrictionEnzymes;
|
package/find.png
ADDED
|
Binary file
|
package/findTool.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import createAction from "./utils/createMetaAction";
|
|
2
|
+
import createMergedDefaultStateReducer from "./utils/createMergedDefaultStateReducer";
|
|
3
|
+
import { noop } from "lodash-es";
|
|
4
|
+
|
|
5
|
+
// ------------------------------------
|
|
6
|
+
// Actions
|
|
7
|
+
// ------------------------------------
|
|
8
|
+
export const toggleFindTool = createAction("TOGGLE_FIND_TOOL", noop); //NOTE!!:: second argument sanitizes actions so no payload is passed!
|
|
9
|
+
export const toggleHighlightAll = createAction("toggleHighlightAll", noop); //NOTE!!:: second argument sanitizes actions so no payload is passed!
|
|
10
|
+
export const toggleIsInline = createAction("toggleIsInline", noop); //NOTE!!:: second argument sanitizes actions so no payload is passed!
|
|
11
|
+
export const updateSearchText = createAction("updateSearchText");
|
|
12
|
+
export const updateAmbiguousOrLiteral = createAction(
|
|
13
|
+
"updateAmbiguousOrLiteral"
|
|
14
|
+
);
|
|
15
|
+
export const updateDnaOrAA = createAction("updateDnaOrAA");
|
|
16
|
+
export const updateMatchNumber = createAction("updateMatchNumber");
|
|
17
|
+
|
|
18
|
+
// ------------------------------------
|
|
19
|
+
// Reducer
|
|
20
|
+
// ------------------------------------
|
|
21
|
+
export default createMergedDefaultStateReducer(
|
|
22
|
+
{
|
|
23
|
+
[toggleFindTool]: state => {
|
|
24
|
+
return {
|
|
25
|
+
...state,
|
|
26
|
+
isOpen: !state.isOpen
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
[toggleHighlightAll]: state => {
|
|
30
|
+
return {
|
|
31
|
+
...state,
|
|
32
|
+
highlightAll: !state.highlightAll
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
[toggleIsInline]: state => {
|
|
36
|
+
localStorage.setItem("veFindBarIsExpanded", state.isInline);
|
|
37
|
+
return {
|
|
38
|
+
...state,
|
|
39
|
+
isInline: !state.isInline
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
[updateAmbiguousOrLiteral]: (state, payload) => {
|
|
43
|
+
return {
|
|
44
|
+
...state,
|
|
45
|
+
matchNumber: 0,
|
|
46
|
+
ambiguousOrLiteral: payload
|
|
47
|
+
};
|
|
48
|
+
},
|
|
49
|
+
[updateDnaOrAA]: (state, payload) => {
|
|
50
|
+
return {
|
|
51
|
+
...state,
|
|
52
|
+
matchNumber: 0,
|
|
53
|
+
dnaOrAA: payload
|
|
54
|
+
};
|
|
55
|
+
},
|
|
56
|
+
[updateSearchText]: (state, payload) => {
|
|
57
|
+
return {
|
|
58
|
+
...state,
|
|
59
|
+
matchNumber: 0,
|
|
60
|
+
searchText: payload
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
[updateMatchNumber]: (state, payload) => {
|
|
64
|
+
return {
|
|
65
|
+
...state,
|
|
66
|
+
matchNumber: payload
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
isOpen: false,
|
|
72
|
+
isInline: !localStorage.getItem("veFindBarIsExpanded"),
|
|
73
|
+
searchText: "",
|
|
74
|
+
dnaOrAA: "DNA",
|
|
75
|
+
ambiguousOrLiteral: "LITERAL",
|
|
76
|
+
highlightAll: false,
|
|
77
|
+
matchNumber: 0
|
|
78
|
+
}
|
|
79
|
+
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const MAX_MATCHES_DISPLAYED = 1000;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
//./caretPosition.js
|
|
2
|
+
import { createReducer } from "redux-act";
|
|
3
|
+
import createAction from "./utils/createMetaAction";
|
|
4
|
+
|
|
5
|
+
// ------------------------------------
|
|
6
|
+
// Actions
|
|
7
|
+
// ------------------------------------
|
|
8
|
+
export const frameTranslationToggle = createAction("FRAME_TRANSLATION_TOGGLE");
|
|
9
|
+
export const frameTranslationToggleOn = createAction(
|
|
10
|
+
"FRAME_TRANSLATION_TOGGLE_ON"
|
|
11
|
+
);
|
|
12
|
+
export const frameTranslationToggleOff = createAction(
|
|
13
|
+
"FRAME_TRANSLATION_TOGGLE_OFF"
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
// ------------------------------------
|
|
17
|
+
// Reducer
|
|
18
|
+
// ------------------------------------
|
|
19
|
+
export default createReducer(
|
|
20
|
+
{
|
|
21
|
+
[frameTranslationToggle]: (state, payload) => {
|
|
22
|
+
return {
|
|
23
|
+
...state,
|
|
24
|
+
[payload]: !state[payload]
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
[frameTranslationToggleOn]: (state, payload) => {
|
|
28
|
+
return {
|
|
29
|
+
...state,
|
|
30
|
+
[payload]: true
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
[frameTranslationToggleOff]: (state, payload) => {
|
|
34
|
+
return {
|
|
35
|
+
...state,
|
|
36
|
+
[payload]: false
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
1: false,
|
|
42
|
+
2: false,
|
|
43
|
+
3: false,
|
|
44
|
+
"-1": false,
|
|
45
|
+
"-2": false,
|
|
46
|
+
"-3": false
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
export function getMinimumOrfSize(state) {
|
|
51
|
+
return state;
|
|
52
|
+
}
|
package/fullscreen.png
ADDED
|
Binary file
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { pickBy } from "lodash-es";
|
|
2
|
+
import { createSelector } from "reselect";
|
|
3
|
+
import { getLowerCaseObj } from "../utils/arrayUtils";
|
|
4
|
+
import { getCustomEnzymes } from "../utils/editorUtils";
|
|
5
|
+
|
|
6
|
+
export default createSelector(
|
|
7
|
+
() => window.localStorage.getItem("customEnzymes"),
|
|
8
|
+
(state, additionalEnzymes) => additionalEnzymes,
|
|
9
|
+
(customEnzymesString, additionalEnzymes) => {
|
|
10
|
+
return getLowerCaseObj(
|
|
11
|
+
pickBy(
|
|
12
|
+
{
|
|
13
|
+
...additionalEnzymes,
|
|
14
|
+
...getCustomEnzymes(customEnzymesString)
|
|
15
|
+
},
|
|
16
|
+
(val, key) => {
|
|
17
|
+
if (!val) {
|
|
18
|
+
console.error(
|
|
19
|
+
"43ti3523: Error: Missing enzyme data for key: ",
|
|
20
|
+
key,
|
|
21
|
+
"Ignoring this enzyme"
|
|
22
|
+
);
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// eslint-disable-next-line no-unused-vars
|
|
27
|
+
for (const prop of [
|
|
28
|
+
"forwardRegex",
|
|
29
|
+
"reverseRegex",
|
|
30
|
+
"topSnipOffset",
|
|
31
|
+
"bottomSnipOffset",
|
|
32
|
+
"site"
|
|
33
|
+
]) {
|
|
34
|
+
if (val[prop] === undefined || val[prop] === null) {
|
|
35
|
+
console.error(
|
|
36
|
+
`23483g93h Error: Missing property ${prop} for enzyme ${key}. Ignoring this enzyme`
|
|
37
|
+
);
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import classnames from "classnames";
|
|
2
|
+
import { upperFirst } from "lodash-es";
|
|
3
|
+
|
|
4
|
+
export default function getAnnotationClassnames(
|
|
5
|
+
{ overlapsSelf },
|
|
6
|
+
{ viewName, type }
|
|
7
|
+
) {
|
|
8
|
+
const Type = upperFirst(type);
|
|
9
|
+
return classnames(`ve${Type}`, `ve${viewName}${Type}`, {
|
|
10
|
+
overlapsSelf
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { upperFirst } from "lodash-es";
|
|
2
|
+
import { getSingular } from "./annotationTypes";
|
|
3
|
+
|
|
4
|
+
export default function getAnnotationNameAndStartStopString(
|
|
5
|
+
{
|
|
6
|
+
name,
|
|
7
|
+
start,
|
|
8
|
+
end,
|
|
9
|
+
type,
|
|
10
|
+
message,
|
|
11
|
+
annotationTypePlural,
|
|
12
|
+
overlapsSelf,
|
|
13
|
+
isWrappedAddon
|
|
14
|
+
},
|
|
15
|
+
{ startText, isProtein, readOnly } = {}
|
|
16
|
+
) {
|
|
17
|
+
const typeToUse = (() => {
|
|
18
|
+
if (annotationTypePlural) {
|
|
19
|
+
const singularKey = getSingular(annotationTypePlural);
|
|
20
|
+
if (singularKey === "cutsite") {
|
|
21
|
+
return (
|
|
22
|
+
"Cut site" + (annotationTypePlural === "features" ? ` (${type})` : "")
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
if (singularKey === "orf") {
|
|
26
|
+
return (
|
|
27
|
+
"ORF" + (annotationTypePlural === "features" ? ` (${type})` : "")
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
return (
|
|
31
|
+
upperFirst(getSingular(annotationTypePlural)) +
|
|
32
|
+
(annotationTypePlural === "features" ? ` (${type})` : "")
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
return "";
|
|
36
|
+
})();
|
|
37
|
+
|
|
38
|
+
if (isWrappedAddon) {
|
|
39
|
+
const oldEnd = end;
|
|
40
|
+
end = start - 1;
|
|
41
|
+
start = oldEnd + 1;
|
|
42
|
+
}
|
|
43
|
+
return `${startText ? startText : ""} ${typeToUse ? typeToUse + " -" : ""} ${
|
|
44
|
+
name ? name : ""
|
|
45
|
+
} - Start: ${isProtein ? (start + 3) / 3 : start + 1} End: ${
|
|
46
|
+
isProtein ? (end + 1) / 3 : end + 1
|
|
47
|
+
} ${overlapsSelf ? "(Overlaps Self) " : ""}${message ? "\n" + message : ""} ${
|
|
48
|
+
readOnly
|
|
49
|
+
? ""
|
|
50
|
+
: annotationTypePlural === "cutsites"
|
|
51
|
+
? `
|
|
52
|
+
|
|
53
|
+
click --> top cut position
|
|
54
|
+
alt/option+click --> bottom cut position
|
|
55
|
+
cmd/ctrl+click --> recognition range`
|
|
56
|
+
: `
|
|
57
|
+
|
|
58
|
+
alt/option+click --> jump row view to start/end
|
|
59
|
+
double click --> edit`
|
|
60
|
+
}`;
|
|
61
|
+
}
|
package/getBpsPerRow.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defaultCharWidth,
|
|
3
|
+
defaultContainerWidth,
|
|
4
|
+
defaultMarginWidth
|
|
5
|
+
} from "../constants/rowviewContants";
|
|
6
|
+
|
|
7
|
+
export default function getBpsPerRow({
|
|
8
|
+
charWidth = defaultCharWidth,
|
|
9
|
+
width = defaultContainerWidth,
|
|
10
|
+
dimensions: { width: width2 } = {},
|
|
11
|
+
marginWidth = defaultMarginWidth,
|
|
12
|
+
sequenceData
|
|
13
|
+
}) {
|
|
14
|
+
const toRet = Math.floor(
|
|
15
|
+
((width2 || width) - marginWidth) /
|
|
16
|
+
(sequenceData.isProtein ? charWidth * 3 : charWidth)
|
|
17
|
+
);
|
|
18
|
+
return sequenceData.isProtein ? toRet * 3 : toRet;
|
|
19
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
//tnr: not actually used yet. I don't think it is necessary
|
|
2
|
+
// for the cutsite label heights to be perfect
|
|
3
|
+
|
|
4
|
+
import getXStartAndWidthOfRowAnnotation from "./getXStartAndWidthOfRowAnnotation";
|
|
5
|
+
import IntervalTree from "node-interval-tree";
|
|
6
|
+
import getYOffset from "../CircularView/getYOffset";
|
|
7
|
+
import forEach from "lodash/forEach";
|
|
8
|
+
|
|
9
|
+
export default function getCutsiteLabelHeights({
|
|
10
|
+
bpsPerRow,
|
|
11
|
+
charWidth,
|
|
12
|
+
annotationRanges,
|
|
13
|
+
annotationHeight,
|
|
14
|
+
spaceBetweenAnnotations,
|
|
15
|
+
textWidth
|
|
16
|
+
}) {
|
|
17
|
+
const rowLength = bpsPerRow * charWidth;
|
|
18
|
+
let counter = 0;
|
|
19
|
+
let maxAnnotationYOffset = 0;
|
|
20
|
+
const rowCenter = rowLength / 2;
|
|
21
|
+
const iTree = new IntervalTree(rowCenter);
|
|
22
|
+
forEach(annotationRanges, function (annotationRange) {
|
|
23
|
+
counter++;
|
|
24
|
+
if (counter > 50) return;
|
|
25
|
+
let annotation = annotationRange.annotation;
|
|
26
|
+
if (!annotation) {
|
|
27
|
+
annotation = annotationRange;
|
|
28
|
+
}
|
|
29
|
+
const labelLength = annotation.restrictionEnzyme.name.length * textWidth;
|
|
30
|
+
let { xStart } = getXStartAndWidthOfRowAnnotation(
|
|
31
|
+
annotationRange,
|
|
32
|
+
bpsPerRow,
|
|
33
|
+
charWidth
|
|
34
|
+
);
|
|
35
|
+
let xEnd = xStart + labelLength;
|
|
36
|
+
|
|
37
|
+
if (xEnd > rowLength) {
|
|
38
|
+
xStart = xStart - (xEnd - rowLength);
|
|
39
|
+
xEnd = rowLength;
|
|
40
|
+
}
|
|
41
|
+
const yOffset = getYOffset(iTree, xStart, xEnd);
|
|
42
|
+
iTree.insert(xStart, xEnd, {
|
|
43
|
+
...annotationRange,
|
|
44
|
+
yOffset
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
if (yOffset > maxAnnotationYOffset) {
|
|
48
|
+
maxAnnotationYOffset = yOffset;
|
|
49
|
+
}
|
|
50
|
+
const height = yOffset * (annotationHeight + spaceBetweenAnnotations);
|
|
51
|
+
annotation.height = height;
|
|
52
|
+
});
|
|
53
|
+
const containerHeight =
|
|
54
|
+
(maxAnnotationYOffset + 1) * (annotationHeight + spaceBetweenAnnotations);
|
|
55
|
+
return containerHeight;
|
|
56
|
+
}
|
package/getGapMap.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function getGapMap(sequence) {
|
|
2
|
+
const gapMap = [0]; //a map of position to how many gaps come before that position [0,0,0,5,5,5,5,17,17,17, ]
|
|
3
|
+
sequence.split("").forEach(char => {
|
|
4
|
+
if (char === "-") {
|
|
5
|
+
gapMap[Math.max(0, gapMap.length - 1)] =
|
|
6
|
+
(gapMap[Math.max(0, gapMap.length - 1)] || 0) + 1;
|
|
7
|
+
} else {
|
|
8
|
+
gapMap.push(gapMap[gapMap.length - 1] || 0);
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
return gapMap;
|
|
12
|
+
}
|
package/getGaps.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { getGapMap } from "./getGapMap";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* this function is used to calculate the number of spaces that come before or inside a range
|
|
5
|
+
*/
|
|
6
|
+
export let getGaps = () => ({
|
|
7
|
+
gapsBefore: 0,
|
|
8
|
+
gapsInside: 0
|
|
9
|
+
});
|
|
10
|
+
getGaps = (rangeOrCaretPosition, sequence) => {
|
|
11
|
+
const gapMap = getGapMap(sequence);
|
|
12
|
+
if (typeof rangeOrCaretPosition !== "object") {
|
|
13
|
+
return {
|
|
14
|
+
gapsBefore: gapMap[Math.min(rangeOrCaretPosition, gapMap.length - 1)]
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//otherwise it is a range!
|
|
18
|
+
const { start, end } = rangeOrCaretPosition;
|
|
19
|
+
const toReturn = {
|
|
20
|
+
gapsBefore: gapMap[start],
|
|
21
|
+
gapsInside:
|
|
22
|
+
gapMap[Math.min(end, gapMap.length - 1)] -
|
|
23
|
+
gapMap[Math.min(start, gapMap.length - 1)]
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return toReturn;
|
|
27
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import Color from "color";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
export function getInternalLabel({
|
|
5
|
+
ellipsizedName,
|
|
6
|
+
id,
|
|
7
|
+
annotationType,
|
|
8
|
+
revTransform,
|
|
9
|
+
angleAdjust,
|
|
10
|
+
isPart,
|
|
11
|
+
colorToUse,
|
|
12
|
+
textPath,
|
|
13
|
+
locationNumber
|
|
14
|
+
}) {
|
|
15
|
+
if (!ellipsizedName) return null;
|
|
16
|
+
const pathId = `${annotationType}${id}${locationNumber ?? ""}`;
|
|
17
|
+
return (
|
|
18
|
+
<>
|
|
19
|
+
<path id={pathId} fill="none" d={textPath.print()}></path>
|
|
20
|
+
<text
|
|
21
|
+
className="veLabelText veCircularViewInternalLabelText ve-monospace-font"
|
|
22
|
+
transform={
|
|
23
|
+
(revTransform || "") + (angleAdjust ? ` rotate(${angleAdjust})` : "")
|
|
24
|
+
}
|
|
25
|
+
fill={
|
|
26
|
+
isPart ? "#ac68cc" : Color(colorToUse).isDark() ? "white" : "black"
|
|
27
|
+
}
|
|
28
|
+
dy={-3}
|
|
29
|
+
>
|
|
30
|
+
<textPath
|
|
31
|
+
textAnchor="middle"
|
|
32
|
+
startOffset="50%"
|
|
33
|
+
xlinkHref={`#${pathId}`}
|
|
34
|
+
>
|
|
35
|
+
{ellipsizedName}
|
|
36
|
+
</textPath>
|
|
37
|
+
</text>
|
|
38
|
+
</>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import getCommands from "./index";
|
|
2
|
+
import { getCommandHotkeys } from "@teselagen/ui";
|
|
3
|
+
|
|
4
|
+
export default function getOveHotkeyDefs({ store, editorName }) {
|
|
5
|
+
const commands = getCommands({
|
|
6
|
+
props: {
|
|
7
|
+
store,
|
|
8
|
+
editorName
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
return getCommandHotkeys(commands);
|
|
12
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export function getPairwiseOverviewLinearViewOptions({ isTemplate }) {
|
|
2
|
+
if (!isTemplate) {
|
|
3
|
+
return {
|
|
4
|
+
annotationVisibilityOverrides: {
|
|
5
|
+
features: false,
|
|
6
|
+
translations: false,
|
|
7
|
+
parts: false,
|
|
8
|
+
orfs: false,
|
|
9
|
+
orfTranslations: false,
|
|
10
|
+
cdsFeatureTranslations: false,
|
|
11
|
+
axis: false,
|
|
12
|
+
cutsites: false,
|
|
13
|
+
primers: false,
|
|
14
|
+
chromatogram: false,
|
|
15
|
+
sequence: false,
|
|
16
|
+
dnaColors: false,
|
|
17
|
+
reverseSequence: false,
|
|
18
|
+
axisNumbers: false
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
} else {
|
|
22
|
+
return {
|
|
23
|
+
// annotationVisibilityOverrides: {
|
|
24
|
+
// features: false,
|
|
25
|
+
// yellowAxis: false,
|
|
26
|
+
// translations: false,
|
|
27
|
+
// parts: false,
|
|
28
|
+
// orfs: false,
|
|
29
|
+
// orfTranslations: false,
|
|
30
|
+
// axis: true,
|
|
31
|
+
// cutsites: false,
|
|
32
|
+
// primers: false,
|
|
33
|
+
// reverseSequence: false,
|
|
34
|
+
// axisNumbers: false
|
|
35
|
+
// }
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { getRangeAngles } from "@teselagen/range-utils";
|
|
2
|
+
export default function getRangeAnglesSpecial() {
|
|
3
|
+
const { endAngle, totalAngle, ...rest } = getRangeAngles.apply(
|
|
4
|
+
this,
|
|
5
|
+
arguments
|
|
6
|
+
);
|
|
7
|
+
return {
|
|
8
|
+
endAngle: endAngle - 0.00001, //we subtract a tiny amount because an angle of 2PI will cause nothing to be drawn!
|
|
9
|
+
totalAngle: totalAngle - 0.00001, //we subtract a tiny amount because we don't want the range comparisons to treat the same angle as overlapping
|
|
10
|
+
...rest
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { clone } from "lodash-es";
|
|
2
|
+
import { getRangeLength, getSequenceWithinRange } from "@teselagen/range-utils";
|
|
3
|
+
import { getComplementSequenceString } from "@teselagen/sequence-utils";
|
|
4
|
+
import { bioData } from "@teselagen/sequence-utils";
|
|
5
|
+
const { ambiguous_dna_values } = bioData;
|
|
6
|
+
export function getStructuredBases({
|
|
7
|
+
annotationRange,
|
|
8
|
+
forward,
|
|
9
|
+
bases = "",
|
|
10
|
+
start,
|
|
11
|
+
end,
|
|
12
|
+
fullSequence,
|
|
13
|
+
primerBindsOn,
|
|
14
|
+
sequenceLength
|
|
15
|
+
}) {
|
|
16
|
+
const annLen = getRangeLength({ start, end }, sequenceLength);
|
|
17
|
+
let basesToUse = bases;
|
|
18
|
+
if (bases.length < annLen) {
|
|
19
|
+
if (forward && primerBindsOn === "3prime") {
|
|
20
|
+
const toAddLen = annLen - bases.length;
|
|
21
|
+
for (let index = 0; index < toAddLen; index++) {
|
|
22
|
+
basesToUse = "&" + basesToUse;
|
|
23
|
+
}
|
|
24
|
+
} else if (!forward && primerBindsOn === "5prime") {
|
|
25
|
+
const toAddLen = annLen - bases.length;
|
|
26
|
+
for (let index = 0; index < toAddLen; index++) {
|
|
27
|
+
basesToUse = basesToUse + "&";
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const aRange = {
|
|
32
|
+
//tnr: this probably needs to be changed in case annotation wraps origin
|
|
33
|
+
start: annotationRange.start - start,
|
|
34
|
+
end: annotationRange.end - start
|
|
35
|
+
};
|
|
36
|
+
const r = {
|
|
37
|
+
aRange,
|
|
38
|
+
basesNoInserts: basesToUse,
|
|
39
|
+
inserts: []
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const baseLen = basesToUse.length;
|
|
43
|
+
const diffLen = baseLen - annLen;
|
|
44
|
+
if (diffLen > 0) {
|
|
45
|
+
r.basesNoInserts = basesToUse.slice(
|
|
46
|
+
primerBindsOn === "5prime" ? 0 : diffLen,
|
|
47
|
+
primerBindsOn === "5prime" ? annLen : baseLen
|
|
48
|
+
);
|
|
49
|
+
const insertBases = basesToUse.slice(
|
|
50
|
+
primerBindsOn === "5prime" ? annLen : 0,
|
|
51
|
+
primerBindsOn === "5prime" ? baseLen : diffLen
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
r.inserts = [
|
|
55
|
+
{
|
|
56
|
+
bases: insertBases,
|
|
57
|
+
index: primerBindsOn === "5prime" ? annLen : 0
|
|
58
|
+
}
|
|
59
|
+
];
|
|
60
|
+
}
|
|
61
|
+
const basesForRange = getSequenceWithinRange(
|
|
62
|
+
aRange,
|
|
63
|
+
forward ? r.basesNoInserts : r.basesNoInserts.split("").reverse().join("")
|
|
64
|
+
);
|
|
65
|
+
r.basesNoInsertsWithMetaData = basesForRange.split("").map((b, i) => {
|
|
66
|
+
const indexOfBase = i + annotationRange.start;
|
|
67
|
+
let seqForBase = (fullSequence && fullSequence[indexOfBase]) || "";
|
|
68
|
+
if (!forward) {
|
|
69
|
+
seqForBase = getComplementSequenceString(seqForBase);
|
|
70
|
+
}
|
|
71
|
+
const isMatch = seqForBase.toLowerCase() === b.toLowerCase();
|
|
72
|
+
const isAmbiguousMatch =
|
|
73
|
+
!isMatch &&
|
|
74
|
+
ambiguous_dna_values[b.toUpperCase()]?.length > 1 &&
|
|
75
|
+
ambiguous_dna_values[b.toUpperCase()]?.includes(seqForBase.toUpperCase());
|
|
76
|
+
return {
|
|
77
|
+
b,
|
|
78
|
+
isMatch,
|
|
79
|
+
isAmbiguousMatch
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
r.allBasesWithMetaData = clone(r.basesNoInsertsWithMetaData);
|
|
83
|
+
if (!forward) {
|
|
84
|
+
r.allBasesWithMetaData = r.allBasesWithMetaData.reverse();
|
|
85
|
+
}
|
|
86
|
+
r.inserts
|
|
87
|
+
.sort((a, b) => a.index - b.index)
|
|
88
|
+
.forEach(({ bases, index }) => {
|
|
89
|
+
r.allBasesWithMetaData.splice(
|
|
90
|
+
index,
|
|
91
|
+
0,
|
|
92
|
+
...bases.split("").map(b => ({ b, isMatch: false }))
|
|
93
|
+
);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
return r;
|
|
97
|
+
}
|