@teselagen/ove 0.7.28 → 0.7.30-beta.1

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.
Files changed (301) hide show
  1. package/CreateAnnotationsPage.d.ts +4 -3
  2. package/README.md +1 -1
  3. package/fileUtils.d.ts +12 -0
  4. package/html2canvas.esm--JN4fLQL.js +7891 -0
  5. package/html2canvas.esm-B7d7VJmQ.cjs +7891 -0
  6. package/index.cjs.js +1305 -1121
  7. package/index.es.js +1305 -1121
  8. package/index.umd.js +189161 -0
  9. package/ove.css +17 -4
  10. package/package.json +5 -9
  11. package/redux/findTool.d.ts +1 -0
  12. package/selectors/searchLayersSelector.d.ts +1 -1
  13. package/src/AutoAnnotate.js +1 -1
  14. package/src/CreateAnnotationsPage.js +1 -2
  15. package/src/Editor/style.css +8 -3
  16. package/src/FindBar/index.js +32 -1
  17. package/src/RowItem/SelectionLayer/index.js +42 -4
  18. package/src/RowItem/SelectionLayer/style.css +8 -0
  19. package/src/fileUtils.js +103 -0
  20. package/src/helperComponents/PropertiesDialog/TranslationProperties.js +1 -1
  21. package/src/redux/findTool.js +9 -0
  22. package/src/selectors/searchLayersSelector.js +40 -2
  23. package/style.css +12098 -1
  24. package/AASliver.js +0 -187
  25. package/AddLaddersDialog.js +0 -82
  26. package/AdditionalCutsiteInfoDialog.js +0 -599
  27. package/AlignmentVisibilityTool.js +0 -105
  28. package/AnnotationContainerHolder.js +0 -20
  29. package/AnnotationPositioner.js +0 -27
  30. package/AutoAnnotate.js +0 -501
  31. package/AutoAnnotateBpMatchingDialog.js +0 -208
  32. package/Axis.js +0 -151
  33. package/AxisNumbers.js +0 -35
  34. package/Browser.js +0 -106
  35. package/Caret.js +0 -63
  36. package/Chromatogram.js +0 -293
  37. package/CircularDnaSequence.js +0 -73
  38. package/CircularZoomMinimap.js +0 -16
  39. package/ColorPicker.js +0 -30
  40. package/CommandHotkeyHandler.js +0 -44
  41. package/CreateAnnotationsPage.js +0 -98
  42. package/Cutsite.js +0 -18
  43. package/CutsiteProperties.js +0 -176
  44. package/CutsiteSelectionLayers.js +0 -47
  45. package/Cutsites.js +0 -271
  46. package/DeletionLayer.js +0 -28
  47. package/DropHandler.css +0 -21
  48. package/DropHandler.js +0 -64
  49. package/EditCaretPosition.js +0 -234
  50. package/EditTrackNameDialog.js +0 -30
  51. package/Feature.js +0 -83
  52. package/FeatureProperties.js +0 -6
  53. package/FillWindow.js +0 -47
  54. package/GenbankView.js +0 -74
  55. package/GeneralProperties.js +0 -117
  56. package/GenericAnnotationProperties.js +0 -406
  57. package/GlobalDialog.js +0 -73
  58. package/GlobalDialogUtils.js +0 -110
  59. package/GoToDialog.js +0 -25
  60. package/HorizontalPanelDragHandle.js +0 -35
  61. package/Keyboard.js +0 -85
  62. package/Labels.js +0 -327
  63. package/Ladder.css +0 -20
  64. package/Ladder.js +0 -303
  65. package/MeltingTemp.js +0 -85
  66. package/Menlo.ttf +0 -0
  67. package/Minimap.js +0 -515
  68. package/Mismatches.js +0 -134
  69. package/Monaco.ttf +0 -0
  70. package/MultipleSeqsDetectedOnImportDialog.js +0 -74
  71. package/Orf.js +0 -109
  72. package/OrfProperties.js +0 -117
  73. package/Orfs.js +0 -35
  74. package/PCRTool.js +0 -179
  75. package/PairwiseAlignmentView.js +0 -68
  76. package/Part.js +0 -34
  77. package/PartProperties.js +0 -9
  78. package/PassThrough.js +0 -3
  79. package/PerformantSelectionLayer.js +0 -32
  80. package/PinchHelper.js +0 -24
  81. package/PointedAnnotation.js +0 -347
  82. package/PositionAnnotationOnCircle.js +0 -26
  83. package/Primer.js +0 -41
  84. package/PrimerProperties.js +0 -19
  85. package/ReflexContainer.js +0 -802
  86. package/ReflexElement.js +0 -160
  87. package/ReflexEvents.js +0 -77
  88. package/ReflexSplitter.js +0 -205
  89. package/RenameSequenceDialog.js +0 -7
  90. package/RotateCircularViewSlider.js +0 -93
  91. package/SelectDialog.js +0 -150
  92. package/SequenceName.js +0 -15
  93. package/SimpleCircularOrLinearView.js +0 -381
  94. package/SimpleOligoPreview.js +0 -39
  95. package/SingleEnzymeCutsiteInfo.js +0 -139
  96. package/ToolbarItem.js +0 -192
  97. package/Translation.js +0 -198
  98. package/TranslationProperties.js +0 -149
  99. package/UncontrolledSliderWithPlusMinusBtns.css +0 -5
  100. package/UncontrolledSliderWithPlusMinusBtns.js +0 -134
  101. package/VeTopRightContainer.js +0 -12
  102. package/ZoomCircularViewSlider.js +0 -62
  103. package/ZoomLinearView.js +0 -47
  104. package/addAlignment.js +0 -6
  105. package/addMetaToActionCreators.js +0 -12
  106. package/addWrappedAddons.js +0 -20
  107. package/alignmentTool.js +0 -503
  108. package/alignments.js +0 -379
  109. package/annotationLabelVisibility.js +0 -2
  110. package/annotationSearchSelector.js +0 -24
  111. package/annotationTypes.js +0 -35
  112. package/annotationVisibility.js +0 -196
  113. package/annotationsToSupport.js +0 -104
  114. package/arrayToObjWithIds.js +0 -17
  115. package/arrayUtils.js +0 -19
  116. package/array_move.js +0 -10
  117. package/calculateTickMarkPositionsForGivenRange.js +0 -47
  118. package/caretPosition.js +0 -27
  119. package/cdsFeaturesSelector.js +0 -9
  120. package/charWidth.js +0 -22
  121. package/circular.js +0 -19
  122. package/circularSelector.js +0 -4
  123. package/clickAndDragUtils.js +0 -576
  124. package/coerceInitialValue.js +0 -7
  125. package/combineReducersDontIgnoreKeys.js +0 -12
  126. package/commandUtils.js +0 -20
  127. package/constants.js +0 -2
  128. package/copyOptions.js +0 -34
  129. package/createFragmentLines.js +0 -120
  130. package/createMergedDefaultStateReducer.js +0 -30
  131. package/createMetaAction.js +0 -12
  132. package/createSequenceInputPopup.js +0 -290
  133. package/createSequenceInputPopupStyle.css +0 -87
  134. package/createSimpleDialog.js +0 -89
  135. package/createYourOwnEnzyme.js +0 -39
  136. package/cutsiteLabelColorSelector.js +0 -6
  137. package/cutsiteTool.js +0 -88
  138. package/cutsitesByRangeSelector.js +0 -5
  139. package/cutsitesSelector.js +0 -61
  140. package/darkmode.css +0 -98
  141. package/defaultConfig.js +0 -150
  142. package/deletionLayers.js +0 -36
  143. package/description.js +0 -21
  144. package/digestTool.js +0 -34
  145. package/dnaToColor.js +0 -17
  146. package/downloadTool.js +0 -39
  147. package/draggableClassnames.js +0 -5
  148. package/drawAnnotations.js +0 -440
  149. package/drawDirectedPiePiece.js +0 -142
  150. package/editTool.js +0 -49
  151. package/editorSelector.js +0 -2
  152. package/editorUtils.js +0 -205
  153. package/estimateRowHeight.js +0 -184
  154. package/featureLengthsToHide.js +0 -27
  155. package/featureTool.js +0 -34
  156. package/features.js +0 -19
  157. package/featuresSelector.js +0 -8
  158. package/filteredCutsitesSelector.js +0 -136
  159. package/filteredFeaturesSelector.js +0 -32
  160. package/filteredPartsSelector.js +0 -57
  161. package/filteredPrimersSelector.js +0 -27
  162. package/filteredRestrictionEnzymesSelector.js +0 -1
  163. package/find.png +0 -0
  164. package/findTool.js +0 -79
  165. package/findToolConstants.js +0 -1
  166. package/frameTranslations.js +0 -52
  167. package/fullscreen.png +0 -0
  168. package/getAdditionalEnzymesSelector.js +0 -46
  169. package/getAngleForPositionMidpoint.js +0 -3
  170. package/getAnnotationClassnames.js +0 -12
  171. package/getAnnotationNameAndStartStopString.js +0 -61
  172. package/getBpsPerRow.js +0 -19
  173. package/getCutsiteLabelHeights.js +0 -56
  174. package/getGapMap.js +0 -12
  175. package/getGaps.js +0 -27
  176. package/getInternalLabel.js +0 -40
  177. package/getOveHotkeyDefs.js +0 -12
  178. package/getPairwiseOverviewLinearViewOptions.js +0 -38
  179. package/getRangeAnglesSpecial.js +0 -12
  180. package/getStructuredBases.js +0 -97
  181. package/getTrackFromEvent.js +0 -25
  182. package/getVisibleStartEnd.js +0 -7
  183. package/getXStartAndWidthFromNonCircularRange.js +0 -12
  184. package/getXStartAndWidthOfRangeWrtRow.js +0 -27
  185. package/getXStartAndWidthOfRowAnnotation.js +0 -19
  186. package/getYOffset.js +0 -15
  187. package/hoveredAnnotation.js +0 -24
  188. package/importTool.js +0 -27
  189. package/index.js +0 -71
  190. package/inlineFindTool.js +0 -38
  191. package/isElementInViewport.js +0 -29
  192. package/isEnzymeFilterAndSelector.js +0 -1
  193. package/isTargetWithinEl.js +0 -6
  194. package/labelLineIntensity.js +0 -25
  195. package/labelSize.js +0 -23
  196. package/ladderDefaults.js +0 -25
  197. package/lastSavedId.js +0 -20
  198. package/lineageLines.js +0 -11
  199. package/linear.png +0 -0
  200. package/makeStore.js +0 -34
  201. package/massageTickSpacing.js +0 -19
  202. package/materiallyAvailable.js +0 -19
  203. package/middleware.js +0 -112
  204. package/minimumOrfSize.js +0 -24
  205. package/minimumOrfSizeSelector.js +0 -2
  206. package/modalActions.js +0 -3
  207. package/moveCaret.js +0 -58
  208. package/name.js +0 -19
  209. package/normalizeAngle.js +0 -3
  210. package/normalizeAngleRange.js +0 -9
  211. package/oligoTool.js +0 -30
  212. package/onlyUpdateForKeysDeep.js +0 -31
  213. package/orfFrameToColorMap.js +0 -10
  214. package/orfTool.js +0 -136
  215. package/orfsSelector.js +0 -15
  216. package/panelsShown.js +0 -294
  217. package/partLengthsToHide.js +0 -23
  218. package/partOverhangs.js +0 -6
  219. package/partTagSearch.js +0 -69
  220. package/partTool.js +0 -45
  221. package/parts.js +0 -19
  222. package/partsSelector.js +0 -8
  223. package/pie.png +0 -0
  224. package/polarToSpecialCartesian.js +0 -7
  225. package/positionCutsites.js +0 -6
  226. package/prepareRowData.js +0 -64
  227. package/primerBases.js +0 -221
  228. package/primerLengthsToHide.js +0 -27
  229. package/primers.js +0 -19
  230. package/primersSelector.js +0 -8
  231. package/print.png +0 -0
  232. package/printTool.js +0 -31
  233. package/propertiesTool.js +0 -40
  234. package/proteinUtils.js +0 -3
  235. package/pureNoFunc.js +0 -18
  236. package/readOnly.js +0 -25
  237. package/redoTool.js +0 -30
  238. package/reflex-styles.css +0 -128
  239. package/reflex-styles.css.map +0 -9
  240. package/relaxLabelAngles.js +0 -157
  241. package/relaxLabels_DEPRECATED.js +0 -105
  242. package/replacementLayers.js +0 -36
  243. package/restrictionEnzymes.js +0 -52
  244. package/restrictionEnzymesSelector.js +0 -34
  245. package/rowviewContants.js +0 -3
  246. package/ruler.css +0 -89
  247. package/save.png +0 -0
  248. package/saveTool.js +0 -44
  249. package/searchLayersSelector.js +0 -71
  250. package/selectedAnnotations.js +0 -89
  251. package/selectedAnnotationsSelector.js +0 -1
  252. package/selectedCutsitesSelector.js +0 -21
  253. package/selectedPartTags.js +0 -21
  254. package/selectionLayer.js +0 -25
  255. package/sequence.js +0 -12
  256. package/sequenceDataHistory.js +0 -43
  257. package/sequenceDataSelector.js +0 -2
  258. package/sequenceLengthSelector.js +0 -5
  259. package/sequenceSelector.js +0 -4
  260. package/sharedActionCreators.js +0 -0
  261. package/shouldFlipText.js +0 -4
  262. package/shouldRerender.js +0 -27
  263. package/showFileDialog.js +0 -25
  264. package/showGCContent.js +0 -23
  265. package/show_cut_sites.png +0 -0
  266. package/show_features.png +0 -0
  267. package/show_orfs.png +0 -0
  268. package/show_primers.png +0 -0
  269. package/simpleDialog.css +0 -13
  270. package/specialCutsiteFilterOptions.js +0 -22
  271. package/tagsToBoldSelector.js +0 -2
  272. package/toggle_views.svg +0 -1
  273. package/toolBar.js +0 -23
  274. package/translationSearchMatchesSelector.js +0 -14
  275. package/translations.js +0 -20
  276. package/translationsRawSelector.js +0 -8
  277. package/translationsSelector.js +0 -137
  278. package/typeField.js +0 -24
  279. package/undoTool.js +0 -30
  280. package/updateEditor.js +0 -200
  281. package/updateLabelsForInViewFeatures.js +0 -55
  282. package/updateLabelsForInViewFeaturesCircView.js +0 -41
  283. package/updateTrackHelper.js +0 -58
  284. package/uppercaseSequenceMapFont.js +0 -25
  285. package/upsertDeleteActionGenerator.js +0 -31
  286. package/useAAColorType.js +0 -8
  287. package/useAdditionalOrfStartCodons.js +0 -24
  288. package/useAnnotationLimits.js +0 -42
  289. package/useChromatogramPrefs.js +0 -31
  290. package/useFormValue.js +0 -7
  291. package/useLadders.js +0 -6
  292. package/useMeltingTemp.js +0 -7
  293. package/useTmType.js +0 -10
  294. package/userDefinedHandlersAndOpts.js +0 -61
  295. package/utils.js +0 -37
  296. package/versionHistory.js +0 -26
  297. package/versionHistoryTool.js +0 -21
  298. package/viewSubmenu.js +0 -479
  299. package/visibilityTool.js +0 -39
  300. package/withHover.js +0 -113
  301. package/withRestrictionEnzymes.js +0 -15
package/moveCaret.js DELETED
@@ -1,58 +0,0 @@
1
- const handleMoves = {
2
- moveCaretLeftOne: function ({ isProtein, selectionLayer, shiftHeld }) {
3
- if (selectionLayer.start > -1 && !shiftHeld) {
4
- return 0;
5
- }
6
- return isProtein ? -3 : -1;
7
- },
8
- moveCaretRightOne: function ({ isProtein, selectionLayer, shiftHeld }) {
9
- if (selectionLayer.start > -1 && !shiftHeld) {
10
- return 0;
11
- }
12
- return isProtein ? 3 : 1;
13
- },
14
- moveCaretUpARow: function ({ bpsPerRow }) {
15
- return -bpsPerRow;
16
- },
17
- moveCaretDownARow: function ({ bpsPerRow }) {
18
- return bpsPerRow;
19
- },
20
- moveCaretToEndOfRow: function ({ bpsPerRow, caretPosition }) {
21
- return bpsPerRow - (caretPosition % bpsPerRow);
22
- },
23
- moveCaretToStartOfRow: function ({ bpsPerRow, caretPosition }) {
24
- let moveBy = -caretPosition % bpsPerRow;
25
- if (moveBy === 0) {
26
- moveBy = -bpsPerRow;
27
- }
28
- return moveBy;
29
- },
30
- moveCaretToStartOfSequence: function ({ caretPosition }) {
31
- return -caretPosition;
32
- },
33
- moveCaretToEndOfSequence: function ({ caretPosition, sequenceLength }) {
34
- return sequenceLength - caretPosition;
35
- }
36
- };
37
-
38
- function moveCaret({
39
- sequenceLength,
40
- bpsPerRow,
41
- caretPosition,
42
- selectionLayer,
43
- shiftHeld,
44
- isProtein,
45
- type
46
- }) {
47
- const moveBy = handleMoves[type]({
48
- shiftHeld,
49
- sequenceLength,
50
- isProtein,
51
- bpsPerRow,
52
- caretPosition,
53
- selectionLayer
54
- });
55
- return moveBy;
56
- }
57
-
58
- export default moveCaret;
package/name.js DELETED
@@ -1,19 +0,0 @@
1
- import { createReducer } from "redux-act";
2
- import createAction from "../utils/createMetaAction";
3
-
4
- // ------------------------------------
5
- // Actions
6
- // ------------------------------------
7
- export const sequenceNameUpdate = createAction("sequenceNameUpdate");
8
-
9
- // ------------------------------------
10
- // Reducer
11
- // ------------------------------------
12
- export default createReducer(
13
- {
14
- [sequenceNameUpdate]: (state, payload) => {
15
- return payload;
16
- }
17
- },
18
- "Untitled Sequence"
19
- );
package/normalizeAngle.js DELETED
@@ -1,3 +0,0 @@
1
- export function normalizeAngle(a) {
2
- return (a + Math.PI * 2) % (Math.PI * 2);
3
- }
@@ -1,9 +0,0 @@
1
- import { normalizeAngle } from "./normalizeAngle";
2
-
3
- export function normalizeAngleRange(r) {
4
- return {
5
- ...r,
6
- start: normalizeAngle(r.start),
7
- end: normalizeAngle(r.end)
8
- };
9
- }
package/oligoTool.js DELETED
@@ -1,30 +0,0 @@
1
- import { Icon } from "@blueprintjs/core";
2
- import React from "react";
3
- import ToolbarItem from "./ToolbarItem";
4
- import { connectToEditor } from "../withEditorProps";
5
-
6
- export default connectToEditor(editorState => {
7
- return {
8
- isHidden: editorState.sequenceData && editorState.sequenceData.isProtein,
9
-
10
- toggled:
11
- editorState.annotationVisibility &&
12
- editorState.annotationVisibility.primers
13
- };
14
- })(({ toolbarItemProps, isHidden, toggled, annotationVisibilityToggle }) => {
15
- return (
16
- <ToolbarItem
17
- {...{
18
- Icon: <Icon icon="swap-horizontal" />,
19
- onIconClick: function () {
20
- annotationVisibilityToggle("primers");
21
- },
22
- isHidden,
23
- toggled,
24
- tooltip: "Show Primers",
25
- tooltipToggled: "Hide Primers",
26
- ...toolbarItemProps
27
- }}
28
- />
29
- );
30
- });
@@ -1,31 +0,0 @@
1
- import { pick } from "lodash-es";
2
- import { shouldUpdate } from "recompose";
3
- import { isEqualWith, isFunction } from "lodash-es";
4
-
5
- // import deepEqual from "deep-equal";
6
-
7
- const onlyUpdateForKeys = propKeys => {
8
- const hoc = shouldUpdate((props, nextProps) => {
9
- const a = !isEq(pick(nextProps, propKeys), pick(props, propKeys));
10
- return a;
11
- });
12
-
13
- // if (process.env.NODE_ENV !== "production") {
14
- // return BaseComponent =>
15
- // setDisplayName(wrapDisplayName(BaseComponent, "onlyUpdateForKeys"))(
16
- // hoc(BaseComponent)
17
- // );
18
- // }
19
- return hoc;
20
- };
21
-
22
- export default onlyUpdateForKeys;
23
-
24
- const isEq = (o1, o2) => {
25
- const isEq = isEqualWith(o1, o2, function (val1, val2) {
26
- if (isFunction(val1) && isFunction(val2)) {
27
- return val1 === val2 || val1.toString() === val2.toString();
28
- }
29
- });
30
- return isEq;
31
- };
@@ -1,10 +0,0 @@
1
- const orfFrameToColorMap = {
2
- 0: "#FF4040",
3
- 1: "#5E8804",
4
- 2: "#17569B"
5
- };
6
- export default orfFrameToColorMap;
7
-
8
- export const getOrfColor = orf => {
9
- return orfFrameToColorMap[orf.frame];
10
- };
package/orfTool.js DELETED
@@ -1,136 +0,0 @@
1
- import { Icon } from "@blueprintjs/core";
2
- import React from "react";
3
- import { orfIcon, CmdCheckbox, CmdDiv, InfoHelper } from "@teselagen/ui";
4
- import ToolbarItem from "./ToolbarItem";
5
- import { connectToEditor } from "../withEditorProps";
6
- import withEditorProps from "../withEditorProps";
7
- import getCommands from "../commands";
8
-
9
- export default connectToEditor(
10
- ({ annotationVisibility = {}, toolBar = {} }) => {
11
- return {
12
- toggled: annotationVisibility.orfs,
13
- isOpen: toolBar.openItem === "orfTool"
14
- };
15
- }
16
- )(({ toolbarItemProps, toggled, annotationVisibilityToggle, isOpen }) => {
17
- return (
18
- <ToolbarItem
19
- {...{
20
- Icon: <Icon data-test="orfTool" icon={orfIcon} />,
21
- onIconClick: function () {
22
- annotationVisibilityToggle("orfs");
23
- },
24
- toggled,
25
- tooltip: "Show Open Reading Frames",
26
- tooltipToggled: "Hide Open Reading Frames",
27
- Dropdown: OrfToolDropdown,
28
- dropdowntooltip:
29
- (!isOpen ? "Show" : "Hide") + " Open Reading Frame Options",
30
- ...toolbarItemProps
31
- }}
32
- />
33
- );
34
- });
35
-
36
- const OrfToolDropdown = withEditorProps(
37
- class OrfDropdown extends React.Component {
38
- constructor(props) {
39
- super(props);
40
- this.commands = getCommands(this);
41
- }
42
- render() {
43
- return (
44
- <div className="veToolbarOrfOptionsHolder">
45
- <CmdCheckbox
46
- prefix="Show "
47
- cmd={this.commands.toggleOrfTranslations}
48
- />
49
- <CmdCheckbox
50
- prefix="Show "
51
- cmd={this.commands.useGtgAndCtgAsStartCodons}
52
- />
53
- <CmdDiv cmd={this.commands.minOrfSizeCmd} />
54
- <div className="vespacer" />
55
-
56
- <InfoHelper
57
- displayToSide
58
- content="To translate an arbitrary area, right click a selection."
59
- />
60
- </div>
61
- );
62
- }
63
- }
64
- );
65
- // const OrfToolDropdown = withEditorProps(function({
66
- // useAdditionalOrfStartCodons,
67
- // useAdditionalOrfStartCodonsToggle,
68
- // annotationVisibility,
69
- // annotationVisibilityToggle,
70
- // editorName
71
- // }) {
72
- // return (
73
- // <div className="veToolbarOrfOptionsHolder">
74
- // {/* <div className="vespacer" />
75
- // <MinOrfSize editorName={editorName} />
76
- // <Checkbox
77
- // onChange={function() {
78
- // annotationVisibilityToggle("orfTranslations");
79
- // }}
80
- // disabled={!annotationVisibility.orfs}
81
- // checked={annotationVisibility.orfTranslations}
82
- // label="Show translations for ORFs"
83
- // />
84
- // <Checkbox
85
- // onChange={function() {
86
- // annotationVisibilityToggle("cdsFeatureTranslations");
87
- // }}
88
- // checked={annotationVisibility.cdsFeatureTranslations}
89
- // label="Show translations for CDS features"
90
- // />
91
- // <Checkbox
92
- // onChange={useAdditionalOrfStartCodonsToggle}
93
- // checked={useAdditionalOrfStartCodons}
94
- // label="Use GTG and CTG as start codons"
95
- // /> */}
96
- // <div className="vespacer" />
97
-
98
- // <InfoHelper
99
- // displayToSide
100
- // content="To translate an arbitrary area, right click a selection."
101
- // />
102
- // </div>
103
- // );
104
- // });
105
-
106
- // export const MinOrfSize = connectToEditor(editorState => {
107
- // return {
108
- // sequenceLength: selectors.sequenceLengthSelector(editorState),
109
- // minimumOrfSize: editorState.minimumOrfSize
110
- // };
111
- // })(
112
- // ({
113
- // minimumOrfSizeUpdate,
114
- // sequenceLength,
115
- // annotationVisibilityShow,
116
- // minimumOrfSize
117
- // }) => {
118
- // return (
119
- // <div data-test="min-orf-size" style={{ display: "flex" }}>
120
- // Minimum ORF Size:
121
- // <input
122
- // type="number"
123
- // className={classNames(Classes.INPUT, "minOrfSizeInput")}
124
- // onChange={function(event) {
125
- // let minimumOrfSize = parseInt(event.target.value, 10);
126
- // if (!(minimumOrfSize > -1)) return;
127
- // if (minimumOrfSize > sequenceLength) return;
128
- // annotationVisibilityShow("orfs");
129
- // minimumOrfSizeUpdate(minimumOrfSize);
130
- // }}
131
- // value={minimumOrfSize}
132
- // />
133
- // </div>
134
- // );
135
- // }
136
- // );
package/orfsSelector.js DELETED
@@ -1,15 +0,0 @@
1
- import circularSelector from "./circularSelector";
2
- import sequenceSelector from "./sequenceSelector";
3
- import minimumOrfSizeSelector from "./minimumOrfSizeSelector";
4
- import { findOrfsInPlasmid } from "@teselagen/sequence-utils";
5
- import { createSelector } from "reselect";
6
-
7
- export default createSelector(
8
- sequenceSelector,
9
- circularSelector,
10
- minimumOrfSizeSelector,
11
- state => state.useAdditionalOrfStartCodons,
12
- findOrfsInPlasmid
13
- );
14
-
15
- //tiny
package/panelsShown.js DELETED
@@ -1,294 +0,0 @@
1
- import { map, flatMap } from "lodash-es";
2
- import { createReducer } from "redux-act";
3
- import createAction from "./utils/createMetaAction";
4
- import { removeItem } from "../utils/arrayUtils";
5
- import immer from "immer";
6
-
7
- //manages which tab panels are shown in the editor
8
-
9
- // ------------------------------------
10
- // Actions
11
- // ------------------------------------
12
- export const panelsShownUpdate = createAction("PANELS_SHOWN_UPDATE");
13
- export const addPanelIfItDoesntAlreadyExist = createAction(
14
- "addPanelIfItDoesntAlreadyExist"
15
- );
16
- export const togglePanelFullScreen = createAction("togglePanelFullScreen");
17
- export const collapsePanel = createAction("collapsePanel");
18
- export const closePanel = createAction("closePanel");
19
- export const _collapseSplitScreen = createAction("_collapseSplitScreen");
20
- export const setPanelAsActive = createAction("setPanelAsActive");
21
- export const flipActiveTabFromLinearOrCircularIfNecessary = createAction(
22
- "flipActiveTabFromLinearOrCircularIfNecessary"
23
- );
24
- export const expandTabToSplitScreen = createAction("expandTabToSplitScreen");
25
- export const propertiesViewOpen = (unused, meta) => {
26
- return setPanelAsActive("properties", meta);
27
- };
28
- export const createNewDigest = (unused, meta) => {
29
- return dispatch => {
30
- dispatch(
31
- addPanelIfItDoesntAlreadyExist(
32
- {
33
- id: "digestTool",
34
- name: "New Digest",
35
- active: true,
36
- canClose: true
37
- },
38
- meta
39
- )
40
- );
41
- dispatch(setPanelAsActive("digestTool", meta));
42
- };
43
- };
44
- export const createNewPCR = (unused, meta) => {
45
- return dispatch => {
46
- dispatch(
47
- addPanelIfItDoesntAlreadyExist(
48
- {
49
- id: "pcrTool",
50
- name: "New PCR",
51
- active: true,
52
- canClose: true
53
- },
54
- meta
55
- )
56
- );
57
- dispatch(setPanelAsActive("pcrTool", meta));
58
- };
59
- };
60
-
61
- export const createNewAlignment = (payload, meta) => {
62
- return dispatch => {
63
- dispatch(
64
- addPanelIfItDoesntAlreadyExist(
65
- {
66
- type: "alignment",
67
- name: "New Alignment",
68
- active: true,
69
- canClose: true,
70
- ...payload
71
- },
72
- meta
73
- )
74
- );
75
- dispatch(setPanelAsActive(payload.id, meta));
76
- };
77
- };
78
-
79
- export const createNewMismatchesList = (payload, meta) => {
80
- return dispatch => {
81
- dispatch(
82
- addPanelIfItDoesntAlreadyExist(
83
- {
84
- type: "mismatches",
85
- name: "Mismatches",
86
- active: true,
87
- canClose: true,
88
- ...payload
89
- },
90
- meta
91
- )
92
- );
93
- dispatch(setPanelAsActive(payload.id, meta));
94
- };
95
- };
96
-
97
- export const collapseSplitScreen = (activePanelId, meta) => {
98
- return dispatch => {
99
- dispatch(_collapseSplitScreen(activePanelId, meta));
100
- activePanelId && dispatch(setPanelAsActive(activePanelId, meta));
101
- };
102
- };
103
-
104
- // ------------------------------------
105
- // Reducer
106
- // ------------------------------------
107
- const reducer = createReducer(
108
- {
109
- [addPanelIfItDoesntAlreadyExist]: (state, panelToAdd) => {
110
- if (
111
- !state.some(panelGroup => {
112
- return panelGroup.some(({ id }) => {
113
- return id === panelToAdd.id;
114
- });
115
- })
116
- ) {
117
- return state.map((panelGroup, index) => {
118
- if (index === 0) return [panelToAdd, ...panelGroup];
119
- return panelGroup;
120
- });
121
- }
122
- return state;
123
- },
124
- [panelsShownUpdate]: (state, payload) => {
125
- return payload.filter(group => group.length); //filter out any empty groups
126
- },
127
- [flipActiveTabFromLinearOrCircularIfNecessary]: (state, setCircActive) => {
128
- const newState = immer(state, s => {
129
- s.forEach(g => {
130
- flipActiveForGroup(g, setCircActive);
131
- });
132
- });
133
-
134
- return newState;
135
- },
136
- [closePanel]: (state, idToClose) => {
137
- const newState = state.map(group => {
138
- let indexToClose;
139
- group.forEach(({ id }, i) => {
140
- if (id === idToClose) indexToClose = i;
141
- });
142
- if (indexToClose > -1) {
143
- const newPanels = removeItem(group, indexToClose);
144
- let mostRecentIndex = 0;
145
- newPanels.forEach(p => {
146
- if (
147
- (p.lastActive || 0) > (newPanels[mostRecentIndex].lastActive || 0)
148
- ) {
149
- mostRecentIndex = newPanels.indexOf(p);
150
- }
151
- });
152
-
153
- return newPanels.map((tab, i) => {
154
- if (i === mostRecentIndex) return { ...tab, active: true };
155
- else {
156
- return tab;
157
- }
158
- });
159
- }
160
- return group;
161
- });
162
- return newState.filter(group => group.length); //filter out any empty groups
163
- },
164
- [_collapseSplitScreen]: state => {
165
- return [flatMap(state)];
166
- },
167
- [expandTabToSplitScreen]: (state, activePanelId) => {
168
- let panelToMove;
169
- return [
170
- state[0]
171
- .filter(panel => {
172
- if (panel.id === activePanelId) {
173
- panelToMove = panel;
174
- return false;
175
- }
176
- return true;
177
- })
178
- .map((panel, i) => {
179
- return i === 0 ? { ...panel, active: true } : panel;
180
- }),
181
- [{ ...panelToMove, active: true }]
182
- ];
183
- },
184
- [setPanelAsActive]: (state, panelId) => {
185
- return map(state, panelGroup => {
186
- const isPanelInGroup = panelGroup.some(({ id }) => {
187
- return panelId === id;
188
- });
189
- return panelGroup.map(panel => {
190
- return {
191
- ...panel,
192
- active:
193
- panelId === panel.id
194
- ? true
195
- : isPanelInGroup
196
- ? false
197
- : panel.active
198
- };
199
- });
200
- });
201
- },
202
- [togglePanelFullScreen]: (state, panelId) => {
203
- return map(state, panelGroup => {
204
- const isPanelInGroup = panelGroup.some(({ id }) => {
205
- return panelId === id;
206
- });
207
- return panelGroup.map(panel => {
208
- return {
209
- ...panel,
210
- active:
211
- panelId === panel.id
212
- ? true
213
- : isPanelInGroup
214
- ? false
215
- : panel.active,
216
- fullScreen:
217
- panelId === panel.id
218
- ? !panel.fullScreen
219
- : isPanelInGroup
220
- ? false
221
- : panel.fullScreen
222
- };
223
- });
224
- });
225
- },
226
- [collapsePanel]: (state, panelToCloseId) => {
227
- return [
228
- flatMap(state, panelGroup => {
229
- return panelGroup;
230
- }).map(panel => {
231
- if (panel.id === panelToCloseId) {
232
- return {
233
- ...panel,
234
- active: false
235
- };
236
- }
237
- return panel;
238
- })
239
- ];
240
- }
241
- },
242
- [
243
- [
244
- {
245
- id: "circular",
246
- name: "Circular Map",
247
- active: true
248
- // canClose: true
249
- },
250
- {
251
- id: "rail",
252
- name: "Linear Map",
253
- active: false
254
- }
255
- ],
256
- [
257
- {
258
- id: "sequence",
259
- name: "Sequence Map",
260
- active: true
261
- },
262
- {
263
- id: "properties",
264
- name: "Properties",
265
- active: false
266
- }
267
- ]
268
- ]
269
- );
270
-
271
- export default (state, action) => {
272
- const nextState = reducer(state, action);
273
- nextState.forEach(pg => {
274
- pg.forEach(p => {
275
- if (p.active) {
276
- p.lastActive = Date.now();
277
- }
278
- });
279
- });
280
- return nextState;
281
- };
282
- function flipActiveForGroup(group, setCircActive) {
283
- const activeTab = group.find(({ active }) => active);
284
- if (activeTab?.id === (setCircActive ? "rail" : "circular")) {
285
- //we're on the wrong tab type so check if the other tab is in
286
- const newTabToActivate = group.find(
287
- ({ id }) => id === (setCircActive ? "circular" : "rail")
288
- );
289
- if (newTabToActivate) {
290
- newTabToActivate.active = true;
291
- activeTab.active = false;
292
- }
293
- }
294
- }
@@ -1,23 +0,0 @@
1
- import createMergedDefaultStateReducer from "./utils/createMergedDefaultStateReducer";
2
- import createAction from "./utils/createMetaAction";
3
-
4
- // ------------------------------------
5
- // Actions
6
- // ------------------------------------
7
- export const updatePartLengthsToHide = createAction("updatePartLengthsToHide");
8
- export const togglePartLengthsToHide = createAction("togglePartLengthsToHide");
9
-
10
- // ------------------------------------
11
- // Reducer
12
- // ------------------------------------
13
- export default createMergedDefaultStateReducer(
14
- {
15
- [updatePartLengthsToHide]: (state, payload) => {
16
- return { ...state, ...payload };
17
- },
18
- [togglePartLengthsToHide]: state => {
19
- return { ...state, enabled: !state["enabled"] };
20
- }
21
- },
22
- { enabled: false, min: 0, max: 800 }
23
- );
package/partOverhangs.js DELETED
@@ -1,6 +0,0 @@
1
- export const partOverhangs = [
2
- "fivePrimeOverhang",
3
- "fivePrimeUnderhang",
4
- "threePrimeOverhang",
5
- "threePrimeUnderhang"
6
- ];