@teselagen/ove 0.7.27 → 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 +6 -5
- 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,208 @@
|
|
|
1
|
+
/* Copyright (C) 2018 TeselaGen Biotechnology, Inc. */
|
|
2
|
+
|
|
3
|
+
import { Tab, Tabs } from "@blueprintjs/core";
|
|
4
|
+
import { wrapDialog } from "@teselagen/ui";
|
|
5
|
+
|
|
6
|
+
const highlightStyle = {
|
|
7
|
+
background: "red",
|
|
8
|
+
marginTop: 2
|
|
9
|
+
};
|
|
10
|
+
export const AutoAnnotateBpMatchingDialog = wrapDialog({
|
|
11
|
+
title: "Annotation Matching"
|
|
12
|
+
})(function ({ isRegex }) {
|
|
13
|
+
return (
|
|
14
|
+
<div className="bp3-dialog-body">
|
|
15
|
+
<Tabs defaultSelectedTabId={isRegex ? "regex" : "iupac"}>
|
|
16
|
+
<Tab
|
|
17
|
+
id="iupac"
|
|
18
|
+
title="IUPAC"
|
|
19
|
+
panel={
|
|
20
|
+
<div>
|
|
21
|
+
<p>
|
|
22
|
+
When in standard (IUPAC) mode, annotations are matched
|
|
23
|
+
case-insensitively. You can use any degenerate IUPAC base pair
|
|
24
|
+
as well as a couple special characters.
|
|
25
|
+
</p>
|
|
26
|
+
<h4>Special Characters:</h4>
|
|
27
|
+
<div
|
|
28
|
+
style={{
|
|
29
|
+
display: "grid",
|
|
30
|
+
columnGap: 20,
|
|
31
|
+
gridTemplateColumns: "1fr 5fr",
|
|
32
|
+
maxHeight: 200,
|
|
33
|
+
overflow: "auto"
|
|
34
|
+
}}
|
|
35
|
+
>
|
|
36
|
+
<div>#</div>
|
|
37
|
+
<div>
|
|
38
|
+
Any arbitrary string of zero or more bases can be matched
|
|
39
|
+
here.
|
|
40
|
+
</div>
|
|
41
|
+
<div>{"<"}</div>
|
|
42
|
+
<div>Any bases before a {"<"} are considered optional</div>
|
|
43
|
+
<div>{">"}</div>
|
|
44
|
+
<div>Any bases after a {">"} are considered optional</div>
|
|
45
|
+
<div>M</div> <div>AC</div>
|
|
46
|
+
<div>R</div> <div>AG</div>
|
|
47
|
+
<div>W</div> <div>AT</div>
|
|
48
|
+
<div>S</div> <div>CG</div>
|
|
49
|
+
<div>Y</div> <div>CT</div>
|
|
50
|
+
<div>K</div> <div>GT</div>
|
|
51
|
+
<div>V</div> <div>ACG</div>
|
|
52
|
+
<div>H</div> <div>ACT</div>
|
|
53
|
+
<div>D</div> <div>AGT</div>
|
|
54
|
+
<div>B</div> <div>CGT</div>
|
|
55
|
+
<div>X</div> <div>GATC</div>
|
|
56
|
+
<div>N</div> <div>GATC</div>
|
|
57
|
+
<div>.</div> <div>GATC</div>
|
|
58
|
+
</div>
|
|
59
|
+
<br></br>
|
|
60
|
+
<h4>Examples:</h4>
|
|
61
|
+
<div
|
|
62
|
+
style={{
|
|
63
|
+
display: "grid",
|
|
64
|
+
columnGap: 20,
|
|
65
|
+
gridTemplateColumns: "2fr 5fr"
|
|
66
|
+
}}
|
|
67
|
+
>
|
|
68
|
+
<h6>Annotation</h6>
|
|
69
|
+
<h6>
|
|
70
|
+
Sequence (matches in <span style={highlightStyle}>red</span>)
|
|
71
|
+
</h6>
|
|
72
|
+
<div>AATT</div>
|
|
73
|
+
<div>
|
|
74
|
+
AA<span style={highlightStyle}>AATT</span>TTGGGGGCCCCCAAGT
|
|
75
|
+
</div>
|
|
76
|
+
<div>aAkT</div>
|
|
77
|
+
<div>
|
|
78
|
+
AA<span style={highlightStyle}>AATT</span>TTGGGGGCCCCC
|
|
79
|
+
<span style={highlightStyle}>AAGT</span>
|
|
80
|
+
</div>
|
|
81
|
+
<div>ANT</div>
|
|
82
|
+
<div>
|
|
83
|
+
AA<span style={highlightStyle}>AAT</span>TTTGGGGGCCCCCA
|
|
84
|
+
<span style={highlightStyle}>AGT</span>
|
|
85
|
+
</div>
|
|
86
|
+
<div>T#C</div>
|
|
87
|
+
<div>
|
|
88
|
+
AAAATTT<span style={highlightStyle}>TGGGGGC</span>CCCCAAGT
|
|
89
|
+
</div>
|
|
90
|
+
<div>CA{"<"}ATTT</div>
|
|
91
|
+
<div>
|
|
92
|
+
AA<span style={highlightStyle}>AATTT</span>TGGGGGCCCCCAAGT
|
|
93
|
+
</div>
|
|
94
|
+
<div>
|
|
95
|
+
CA{"<"}ATT{">"}TTGAG
|
|
96
|
+
</div>
|
|
97
|
+
<div>
|
|
98
|
+
AA<span style={highlightStyle}>AATTTTG</span>GGGGCCCCCAAGT
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
|
|
102
|
+
<br></br>
|
|
103
|
+
{/* <ConvertApeToRegexTool></ConvertApeToRegexTool> */}
|
|
104
|
+
</div>
|
|
105
|
+
}
|
|
106
|
+
></Tab>
|
|
107
|
+
<Tab
|
|
108
|
+
id="regex"
|
|
109
|
+
title="Regex"
|
|
110
|
+
panel={
|
|
111
|
+
<div>
|
|
112
|
+
<p>
|
|
113
|
+
When in regex mode, you can use any custom regex to match base
|
|
114
|
+
pairs
|
|
115
|
+
</p>
|
|
116
|
+
<p>
|
|
117
|
+
You can learn more and try out your custom regexes at{" "}
|
|
118
|
+
<a href="https://regex101.com/">https://regex101.com/</a>
|
|
119
|
+
</p>
|
|
120
|
+
<br></br>
|
|
121
|
+
<h4>Examples:</h4>
|
|
122
|
+
<div
|
|
123
|
+
style={{
|
|
124
|
+
display: "grid",
|
|
125
|
+
columnGap: 20,
|
|
126
|
+
gridTemplateColumns: "2fr 5fr"
|
|
127
|
+
}}
|
|
128
|
+
>
|
|
129
|
+
<h6>Annotation</h6>
|
|
130
|
+
<h6>
|
|
131
|
+
Sequence (matches in <span style={highlightStyle}>red</span>)
|
|
132
|
+
</h6>
|
|
133
|
+
<div>AATT</div>
|
|
134
|
+
<div>
|
|
135
|
+
AA<span style={highlightStyle}>AATT</span>TTGGGGGCCCCCAAGT
|
|
136
|
+
</div>
|
|
137
|
+
<div>aAtT</div>
|
|
138
|
+
<div>
|
|
139
|
+
AA<span style={highlightStyle}>AATT</span>TTGGGGGCCCCCAAGT
|
|
140
|
+
</div>
|
|
141
|
+
<div>A.T</div>
|
|
142
|
+
<div>
|
|
143
|
+
AA<span style={highlightStyle}>AAT</span>TTTGGGGGCCCCCA
|
|
144
|
+
<span style={highlightStyle}>AGT</span>
|
|
145
|
+
</div>
|
|
146
|
+
<div>T.*C</div>
|
|
147
|
+
<div>
|
|
148
|
+
AAAA<span style={highlightStyle}>TTTTGGGGGCCCCC</span>AAGT
|
|
149
|
+
</div>
|
|
150
|
+
<div>T[^T]*?C</div>
|
|
151
|
+
<div>
|
|
152
|
+
AAAATTT<span style={highlightStyle}>TGGGGGC</span>CCCCAAGT
|
|
153
|
+
</div>
|
|
154
|
+
<div>C?A?ATT</div>
|
|
155
|
+
<div>
|
|
156
|
+
AA<span style={highlightStyle}>AATTT</span>TGGGGGCCCCCAAGT
|
|
157
|
+
</div>
|
|
158
|
+
<div>C?A?ATTT?T?C?</div>
|
|
159
|
+
<div>
|
|
160
|
+
AA<span style={highlightStyle}>AATTTT</span>GGGGGCCCCCAAGT
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
<br></br>
|
|
164
|
+
|
|
165
|
+
{/* <ConvertApeToRegexTool></ConvertApeToRegexTool> */}
|
|
166
|
+
</div>
|
|
167
|
+
}
|
|
168
|
+
></Tab>
|
|
169
|
+
</Tabs>
|
|
170
|
+
</div>
|
|
171
|
+
);
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
// function ConvertApeToRegexTool() {
|
|
175
|
+
// const [inputVal, setInput] = useState("CA<ANT>TTGAG");
|
|
176
|
+
|
|
177
|
+
// let convertedVal = "";
|
|
178
|
+
// try {
|
|
179
|
+
// convertedVal = convertApELikeRegexToRegex(inputVal);
|
|
180
|
+
// } catch (error) {
|
|
181
|
+
// convertedVal = "Error trying to convert to regex";
|
|
182
|
+
// }
|
|
183
|
+
// return (
|
|
184
|
+
// <div
|
|
185
|
+
// style={{
|
|
186
|
+
// display: "grid",
|
|
187
|
+
// rowGap: 10,
|
|
188
|
+
// columnGap: 10,
|
|
189
|
+
// gridTemplateColumns: "1fr 5fr"
|
|
190
|
+
// }}
|
|
191
|
+
// >
|
|
192
|
+
// <div>Input:</div>
|
|
193
|
+
// <TextArea
|
|
194
|
+
// value={inputVal}
|
|
195
|
+
// onChange={e => {
|
|
196
|
+
// setInput(e.target.value.replace(/\s/g, "X"));
|
|
197
|
+
// }}
|
|
198
|
+
// ></TextArea>
|
|
199
|
+
|
|
200
|
+
// <div>Output:</div>
|
|
201
|
+
// <div
|
|
202
|
+
// style={{ maxHeight: 200, overflowWrap: "anywhere", overflow: "auto" }}
|
|
203
|
+
// >
|
|
204
|
+
// {convertedVal}
|
|
205
|
+
// </div>
|
|
206
|
+
// </div>
|
|
207
|
+
// );
|
|
208
|
+
// }
|
package/Axis.js
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { normalizePositionByRangeLength } from "@teselagen/range-utils";
|
|
2
|
+
import getXStartAndWidthOfRangeWrtRow from "./getXStartAndWidthOfRangeWrtRow";
|
|
3
|
+
import React, { useMemo } from "react";
|
|
4
|
+
import calculateTickMarkPositionsForGivenRange from "../utils/calculateTickMarkPositionsForGivenRange";
|
|
5
|
+
import { divideBy3 } from "../utils/proteinUtils";
|
|
6
|
+
import { view } from "@risingstack/react-easy-state";
|
|
7
|
+
import { getVisibleStartEnd } from "../utils/getVisibleStartEnd";
|
|
8
|
+
|
|
9
|
+
const Axis = function (props) {
|
|
10
|
+
const {
|
|
11
|
+
row,
|
|
12
|
+
tickSpacing,
|
|
13
|
+
bpsPerRow,
|
|
14
|
+
charWidth,
|
|
15
|
+
annotationHeight,
|
|
16
|
+
marginTop,
|
|
17
|
+
sequenceLength,
|
|
18
|
+
showAxisNumbers = true,
|
|
19
|
+
getGaps,
|
|
20
|
+
scrollData,
|
|
21
|
+
isProtein,
|
|
22
|
+
style,
|
|
23
|
+
isLinearView
|
|
24
|
+
} = props;
|
|
25
|
+
const noRows = row.start === 0 && row.end === 0;
|
|
26
|
+
/* eslint-disable react-hooks/exhaustive-deps */
|
|
27
|
+
//memoize this function because it does the heavy lifting
|
|
28
|
+
const tickMarkPositions = useMemo(() => {
|
|
29
|
+
if (noRows) return [];
|
|
30
|
+
return calculateTickMarkPositionsForGivenRange({
|
|
31
|
+
tickSpacing,
|
|
32
|
+
range: row,
|
|
33
|
+
sequenceLength,
|
|
34
|
+
isProtein
|
|
35
|
+
}).map(tickMarkPosition => {
|
|
36
|
+
const gaps = getGaps ? getGaps(tickMarkPosition).gapsBefore : 0;
|
|
37
|
+
const xCenter =
|
|
38
|
+
(tickMarkPosition - (isProtein ? 1 : 0) + gaps) * charWidth +
|
|
39
|
+
charWidth / 2;
|
|
40
|
+
return {
|
|
41
|
+
tickMarkPosition,
|
|
42
|
+
xCenter
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
}, [
|
|
46
|
+
noRows,
|
|
47
|
+
tickSpacing,
|
|
48
|
+
row.start,
|
|
49
|
+
row.end,
|
|
50
|
+
sequenceLength,
|
|
51
|
+
isProtein,
|
|
52
|
+
charWidth
|
|
53
|
+
]);
|
|
54
|
+
/* eslint-enable react-hooks/exhaustive-deps*/
|
|
55
|
+
if (noRows) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
const { xStart, width } = getXStartAndWidthOfRangeWrtRow({
|
|
59
|
+
row,
|
|
60
|
+
range: row,
|
|
61
|
+
charWidth,
|
|
62
|
+
sequenceLength,
|
|
63
|
+
...(getGaps ? getGaps(row) : {})
|
|
64
|
+
});
|
|
65
|
+
//this function should take in a desired tickSpacing (eg 10 bps between tick mark)
|
|
66
|
+
//and output an array of tickMarkPositions for the given row (eg, [0, 10, 20])
|
|
67
|
+
const xEnd = xStart + width;
|
|
68
|
+
let visibleStart, visibleEnd;
|
|
69
|
+
if (scrollData) {
|
|
70
|
+
const val = getVisibleStartEnd({
|
|
71
|
+
scrollData,
|
|
72
|
+
width: sequenceLength * charWidth
|
|
73
|
+
});
|
|
74
|
+
//add a small buffer to either side of the visible start/end
|
|
75
|
+
visibleStart = val.visibleStart - 400;
|
|
76
|
+
visibleEnd = val.visibleEnd + 400;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const yStart = 0;
|
|
80
|
+
const tickMarkSVG = [];
|
|
81
|
+
|
|
82
|
+
tickMarkPositions.forEach(function ({ tickMarkPosition, xCenter }, i) {
|
|
83
|
+
// const xCenterPlusXStart = xCenter + xStart;
|
|
84
|
+
|
|
85
|
+
if (scrollData && !(xCenter < visibleEnd && xCenter > visibleStart)) return;
|
|
86
|
+
tickMarkSVG.push(
|
|
87
|
+
<rect
|
|
88
|
+
className="veAxisTick"
|
|
89
|
+
data-test={tickMarkPosition + 1}
|
|
90
|
+
key={"axisTickMarkPath " + i + " " + tickMarkPosition}
|
|
91
|
+
x={xCenter}
|
|
92
|
+
width={1}
|
|
93
|
+
height={5}
|
|
94
|
+
/>
|
|
95
|
+
);
|
|
96
|
+
if (showAxisNumbers) {
|
|
97
|
+
const position =
|
|
98
|
+
normalizePositionByRangeLength(
|
|
99
|
+
row.start + tickMarkPosition,
|
|
100
|
+
sequenceLength
|
|
101
|
+
) + (isProtein ? 0 : 1);
|
|
102
|
+
const positionLength = position.toString().length * 4;
|
|
103
|
+
const textInner = divideBy3(position + (isProtein ? 1 : 0), isProtein);
|
|
104
|
+
|
|
105
|
+
let x = xCenter;
|
|
106
|
+
if (!isLinearView) {
|
|
107
|
+
x =
|
|
108
|
+
i === 0 //if first label in row, or last label in row, we add checks to make sure the axis number labels don't go outside of the width of the row
|
|
109
|
+
? Math.max(positionLength, xCenter)
|
|
110
|
+
: i === tickMarkPositions.length - 1
|
|
111
|
+
? Math.min(bpsPerRow * charWidth - positionLength, xCenter)
|
|
112
|
+
: xCenter;
|
|
113
|
+
}
|
|
114
|
+
if (i === tickMarkPositions.length - 1) {
|
|
115
|
+
x = Math.min(x, xEnd - positionLength / 2);
|
|
116
|
+
}
|
|
117
|
+
tickMarkSVG.push(
|
|
118
|
+
<text
|
|
119
|
+
data-tick-mark={textInner}
|
|
120
|
+
key={"axisTickMarkText " + i + " " + tickMarkPosition}
|
|
121
|
+
fill="black"
|
|
122
|
+
x={x}
|
|
123
|
+
y={annotationHeight}
|
|
124
|
+
style={{ textAnchor: "middle", fontSize: 10, fontFamily: "Verdana" }}
|
|
125
|
+
>
|
|
126
|
+
{textInner}
|
|
127
|
+
</text>
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
return (
|
|
133
|
+
<svg
|
|
134
|
+
className="veRowViewAxis veAxis"
|
|
135
|
+
height={annotationHeight}
|
|
136
|
+
width={width}
|
|
137
|
+
style={{ marginTop, overflow: "visible", display: "block", ...style }}
|
|
138
|
+
>
|
|
139
|
+
{tickMarkSVG}
|
|
140
|
+
<path
|
|
141
|
+
className="veAxisLine"
|
|
142
|
+
d={"M" + xStart + "," + yStart + " L" + xEnd + "," + yStart}
|
|
143
|
+
stroke="black"
|
|
144
|
+
/>
|
|
145
|
+
</svg>
|
|
146
|
+
);
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
// export default Axis
|
|
150
|
+
export default view(Axis);
|
|
151
|
+
// export default pureNoFunc(Axis);
|
package/AxisNumbers.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import shouldFlipText from "./shouldFlipText";
|
|
3
|
+
import { divideBy3 } from "../utils/proteinUtils";
|
|
4
|
+
|
|
5
|
+
export function AxisNumbers({
|
|
6
|
+
rotationRadians,
|
|
7
|
+
textHeightOffset = -5,
|
|
8
|
+
annotation,
|
|
9
|
+
isProtein,
|
|
10
|
+
hideNumbers
|
|
11
|
+
}) {
|
|
12
|
+
const shouldFlip = shouldFlipText(annotation.startAngle + rotationRadians);
|
|
13
|
+
return (
|
|
14
|
+
<g>
|
|
15
|
+
<rect y={-17} width={1} height={5} fill="black"></rect>
|
|
16
|
+
{!hideNumbers && (
|
|
17
|
+
<text
|
|
18
|
+
transform={
|
|
19
|
+
(shouldFlip ? "rotate(180)" : "") +
|
|
20
|
+
` translate(0, ${
|
|
21
|
+
shouldFlip ? -textHeightOffset : textHeightOffset
|
|
22
|
+
})`
|
|
23
|
+
}
|
|
24
|
+
style={{
|
|
25
|
+
textAnchor: "middle",
|
|
26
|
+
dominantBaseline: "central",
|
|
27
|
+
fontSize: "small"
|
|
28
|
+
}}
|
|
29
|
+
>
|
|
30
|
+
{divideBy3(annotation.tickPosition + 1, isProtein) + ""}
|
|
31
|
+
</text>
|
|
32
|
+
)}
|
|
33
|
+
</g>
|
|
34
|
+
);
|
|
35
|
+
}
|
package/Browser.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/////////////////////////////////////////////////////////
|
|
2
|
+
// Browser Utils
|
|
3
|
+
//
|
|
4
|
+
/////////////////////////////////////////////////////////
|
|
5
|
+
class Browser {
|
|
6
|
+
// Check if not running on server
|
|
7
|
+
static isBrowser() {
|
|
8
|
+
return typeof window !== "undefined";
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// // Opera 8.0+ (UA detection to detect Blink/v8-powered Opera)
|
|
12
|
+
// static isOpera() {
|
|
13
|
+
// return (
|
|
14
|
+
// Browser.isBrowser() &&
|
|
15
|
+
// (!!window.opera || navigator.userAgent.indexOf(" OPR/") >= 0)
|
|
16
|
+
// );
|
|
17
|
+
// }
|
|
18
|
+
|
|
19
|
+
static isOpera() {
|
|
20
|
+
return Browser.isBrowser() && Browser.getUserAgent().match(/Opera Mini/i);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Firefox 1.0+
|
|
24
|
+
static isFirefox() {
|
|
25
|
+
return Browser.isBrowser() && typeof InstallTrigger !== "undefined";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Safari 3.0+
|
|
29
|
+
static isSafari() {
|
|
30
|
+
if (!Browser.isBrowser()) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// Internet Explorer 6-11
|
|
38
|
+
static isIE() {
|
|
39
|
+
/*@cc_on!@*/
|
|
40
|
+
return Browser.isBrowser() && !!document.documentMode;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// Edge 20+
|
|
44
|
+
static isEdge() {
|
|
45
|
+
return Browser.isBrowser() && !Browser.isIE() && !!window.StyleMedia;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Chrome 1+
|
|
49
|
+
static isChrome() {
|
|
50
|
+
return Browser.isBrowser() && !!window.chrome && !!window.chrome.webstore;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Blink engine detection
|
|
54
|
+
static isBlink() {
|
|
55
|
+
return (
|
|
56
|
+
Browser.isBrowser() &&
|
|
57
|
+
(Browser.isChrome() || Browser.isOpera()) &&
|
|
58
|
+
!!window.CSS
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
static getUserAgent() {
|
|
63
|
+
return typeof navigator === "undefined" ? "" : navigator.userAgent;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
static isAndroid() {
|
|
67
|
+
return Browser.isBrowser() && Browser.getUserAgent().match(/Android/i);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
static isBlackBerry() {
|
|
71
|
+
return Browser.isBrowser() && Browser.getUserAgent().match(/BlackBerry/i);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
static isIOS() {
|
|
75
|
+
return (
|
|
76
|
+
Browser.isBrowser() && Browser.getUserAgent().match(/iPhone|iPad|iPod/i)
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
static isWindows() {
|
|
81
|
+
return (
|
|
82
|
+
(Browser.isBrowser() && Browser.isWindowsDesktop()) ||
|
|
83
|
+
Browser.isWindowsMobile()
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
static isWindowsMobile() {
|
|
88
|
+
return Browser.isBrowser() && Browser.getUserAgent().match(/IEMobile/i);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
static isWindowsDesktop() {
|
|
92
|
+
return Browser.isBrowser() && Browser.getUserAgent().match(/WPDesktop/i);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
static isMobile() {
|
|
96
|
+
return (
|
|
97
|
+
Browser.isBrowser() &&
|
|
98
|
+
(Browser.isWindowsMobile() ||
|
|
99
|
+
Browser.isBlackBerry() ||
|
|
100
|
+
Browser.isAndroid() ||
|
|
101
|
+
Browser.isIOS())
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export default Browser;
|
package/Caret.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import isNumber from "lodash/isNumber";
|
|
2
|
+
import { getRangeAngles } from "@teselagen/range-utils";
|
|
3
|
+
import PositionAnnotationOnCircle from "./PositionAnnotationOnCircle";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import draggableClassnames from "../constants/draggableClassnames";
|
|
6
|
+
import pureNoFunc from "../utils/pureNoFunc";
|
|
7
|
+
import { getSelectionMessage } from "../utils/editorUtils";
|
|
8
|
+
|
|
9
|
+
function Caret({
|
|
10
|
+
caretPosition,
|
|
11
|
+
sequenceLength,
|
|
12
|
+
className,
|
|
13
|
+
onClick,
|
|
14
|
+
isSelection,
|
|
15
|
+
innerRadius,
|
|
16
|
+
outerRadius,
|
|
17
|
+
isProtein,
|
|
18
|
+
selectionMessage
|
|
19
|
+
}) {
|
|
20
|
+
const { startAngle, endAngle } = getRangeAngles(
|
|
21
|
+
{ start: caretPosition, end: caretPosition },
|
|
22
|
+
sequenceLength || 1
|
|
23
|
+
);
|
|
24
|
+
if (!isNumber(startAngle)) {
|
|
25
|
+
console.error("we've got a problem!");
|
|
26
|
+
}
|
|
27
|
+
const { transform } = PositionAnnotationOnCircle({
|
|
28
|
+
sAngle: startAngle,
|
|
29
|
+
eAngle: endAngle,
|
|
30
|
+
height: 0
|
|
31
|
+
});
|
|
32
|
+
return (
|
|
33
|
+
<g
|
|
34
|
+
onClick={onClick}
|
|
35
|
+
transform={transform}
|
|
36
|
+
className={className + " veCaret " + draggableClassnames.caret}
|
|
37
|
+
>
|
|
38
|
+
<title>
|
|
39
|
+
{selectionMessage ||
|
|
40
|
+
getSelectionMessage({ caretPosition, isProtein, sequenceLength })}
|
|
41
|
+
</title>
|
|
42
|
+
<line
|
|
43
|
+
strokeWidth="1.5px"
|
|
44
|
+
x1={0}
|
|
45
|
+
y1={-innerRadius}
|
|
46
|
+
x2={0}
|
|
47
|
+
y2={-outerRadius}
|
|
48
|
+
// stroke="black"
|
|
49
|
+
/>
|
|
50
|
+
{isSelection ? (
|
|
51
|
+
<polygon
|
|
52
|
+
className="vePolygonCaretHandle"
|
|
53
|
+
fill="black"
|
|
54
|
+
points={`0,${-outerRadius + 2} 5,${-outerRadius - 10} -5,${
|
|
55
|
+
-outerRadius - 10
|
|
56
|
+
}`}
|
|
57
|
+
/>
|
|
58
|
+
) : null}
|
|
59
|
+
</g>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export default pureNoFunc(Caret);
|