@teselagen/ove 0.7.28 → 0.7.29

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 (285) hide show
  1. package/index.cjs.js +1055 -996
  2. package/index.es.js +1055 -996
  3. package/index.umd.js +189036 -0
  4. package/ove.css +1 -1
  5. package/package.json +2 -6
  6. package/src/helperComponents/PropertiesDialog/TranslationProperties.js +1 -1
  7. package/AASliver.js +0 -187
  8. package/AddLaddersDialog.js +0 -82
  9. package/AdditionalCutsiteInfoDialog.js +0 -599
  10. package/AlignmentVisibilityTool.js +0 -105
  11. package/AnnotationContainerHolder.js +0 -20
  12. package/AnnotationPositioner.js +0 -27
  13. package/AutoAnnotate.js +0 -501
  14. package/AutoAnnotateBpMatchingDialog.js +0 -208
  15. package/Axis.js +0 -151
  16. package/AxisNumbers.js +0 -35
  17. package/Browser.js +0 -106
  18. package/Caret.js +0 -63
  19. package/Chromatogram.js +0 -293
  20. package/CircularDnaSequence.js +0 -73
  21. package/CircularZoomMinimap.js +0 -16
  22. package/ColorPicker.js +0 -30
  23. package/CommandHotkeyHandler.js +0 -44
  24. package/CreateAnnotationsPage.js +0 -98
  25. package/Cutsite.js +0 -18
  26. package/CutsiteProperties.js +0 -176
  27. package/CutsiteSelectionLayers.js +0 -47
  28. package/Cutsites.js +0 -271
  29. package/DeletionLayer.js +0 -28
  30. package/DropHandler.css +0 -21
  31. package/DropHandler.js +0 -64
  32. package/EditCaretPosition.js +0 -234
  33. package/EditTrackNameDialog.js +0 -30
  34. package/Feature.js +0 -83
  35. package/FeatureProperties.js +0 -6
  36. package/FillWindow.js +0 -47
  37. package/GenbankView.js +0 -74
  38. package/GeneralProperties.js +0 -117
  39. package/GenericAnnotationProperties.js +0 -406
  40. package/GlobalDialog.js +0 -73
  41. package/GlobalDialogUtils.js +0 -110
  42. package/GoToDialog.js +0 -25
  43. package/HorizontalPanelDragHandle.js +0 -35
  44. package/Keyboard.js +0 -85
  45. package/Labels.js +0 -327
  46. package/Ladder.css +0 -20
  47. package/Ladder.js +0 -303
  48. package/MeltingTemp.js +0 -85
  49. package/Menlo.ttf +0 -0
  50. package/Minimap.js +0 -515
  51. package/Mismatches.js +0 -134
  52. package/Monaco.ttf +0 -0
  53. package/MultipleSeqsDetectedOnImportDialog.js +0 -74
  54. package/Orf.js +0 -109
  55. package/OrfProperties.js +0 -117
  56. package/Orfs.js +0 -35
  57. package/PCRTool.js +0 -179
  58. package/PairwiseAlignmentView.js +0 -68
  59. package/Part.js +0 -34
  60. package/PartProperties.js +0 -9
  61. package/PassThrough.js +0 -3
  62. package/PerformantSelectionLayer.js +0 -32
  63. package/PinchHelper.js +0 -24
  64. package/PointedAnnotation.js +0 -347
  65. package/PositionAnnotationOnCircle.js +0 -26
  66. package/Primer.js +0 -41
  67. package/PrimerProperties.js +0 -19
  68. package/ReflexContainer.js +0 -802
  69. package/ReflexElement.js +0 -160
  70. package/ReflexEvents.js +0 -77
  71. package/ReflexSplitter.js +0 -205
  72. package/RenameSequenceDialog.js +0 -7
  73. package/RotateCircularViewSlider.js +0 -93
  74. package/SelectDialog.js +0 -150
  75. package/SequenceName.js +0 -15
  76. package/SimpleCircularOrLinearView.js +0 -381
  77. package/SimpleOligoPreview.js +0 -39
  78. package/SingleEnzymeCutsiteInfo.js +0 -139
  79. package/ToolbarItem.js +0 -192
  80. package/Translation.js +0 -198
  81. package/TranslationProperties.js +0 -149
  82. package/UncontrolledSliderWithPlusMinusBtns.css +0 -5
  83. package/UncontrolledSliderWithPlusMinusBtns.js +0 -134
  84. package/VeTopRightContainer.js +0 -12
  85. package/ZoomCircularViewSlider.js +0 -62
  86. package/ZoomLinearView.js +0 -47
  87. package/addAlignment.js +0 -6
  88. package/addMetaToActionCreators.js +0 -12
  89. package/addWrappedAddons.js +0 -20
  90. package/alignmentTool.js +0 -503
  91. package/alignments.js +0 -379
  92. package/annotationLabelVisibility.js +0 -2
  93. package/annotationSearchSelector.js +0 -24
  94. package/annotationTypes.js +0 -35
  95. package/annotationVisibility.js +0 -196
  96. package/annotationsToSupport.js +0 -104
  97. package/arrayToObjWithIds.js +0 -17
  98. package/arrayUtils.js +0 -19
  99. package/array_move.js +0 -10
  100. package/calculateTickMarkPositionsForGivenRange.js +0 -47
  101. package/caretPosition.js +0 -27
  102. package/cdsFeaturesSelector.js +0 -9
  103. package/charWidth.js +0 -22
  104. package/circular.js +0 -19
  105. package/circularSelector.js +0 -4
  106. package/clickAndDragUtils.js +0 -576
  107. package/coerceInitialValue.js +0 -7
  108. package/combineReducersDontIgnoreKeys.js +0 -12
  109. package/commandUtils.js +0 -20
  110. package/constants.js +0 -2
  111. package/copyOptions.js +0 -34
  112. package/createFragmentLines.js +0 -120
  113. package/createMergedDefaultStateReducer.js +0 -30
  114. package/createMetaAction.js +0 -12
  115. package/createSequenceInputPopup.js +0 -290
  116. package/createSequenceInputPopupStyle.css +0 -87
  117. package/createSimpleDialog.js +0 -89
  118. package/createYourOwnEnzyme.js +0 -39
  119. package/cutsiteLabelColorSelector.js +0 -6
  120. package/cutsiteTool.js +0 -88
  121. package/cutsitesByRangeSelector.js +0 -5
  122. package/cutsitesSelector.js +0 -61
  123. package/darkmode.css +0 -98
  124. package/defaultConfig.js +0 -150
  125. package/deletionLayers.js +0 -36
  126. package/description.js +0 -21
  127. package/digestTool.js +0 -34
  128. package/dnaToColor.js +0 -17
  129. package/downloadTool.js +0 -39
  130. package/draggableClassnames.js +0 -5
  131. package/drawAnnotations.js +0 -440
  132. package/drawDirectedPiePiece.js +0 -142
  133. package/editTool.js +0 -49
  134. package/editorSelector.js +0 -2
  135. package/editorUtils.js +0 -205
  136. package/estimateRowHeight.js +0 -184
  137. package/featureLengthsToHide.js +0 -27
  138. package/featureTool.js +0 -34
  139. package/features.js +0 -19
  140. package/featuresSelector.js +0 -8
  141. package/filteredCutsitesSelector.js +0 -136
  142. package/filteredFeaturesSelector.js +0 -32
  143. package/filteredPartsSelector.js +0 -57
  144. package/filteredPrimersSelector.js +0 -27
  145. package/filteredRestrictionEnzymesSelector.js +0 -1
  146. package/find.png +0 -0
  147. package/findTool.js +0 -79
  148. package/findToolConstants.js +0 -1
  149. package/frameTranslations.js +0 -52
  150. package/fullscreen.png +0 -0
  151. package/getAdditionalEnzymesSelector.js +0 -46
  152. package/getAngleForPositionMidpoint.js +0 -3
  153. package/getAnnotationClassnames.js +0 -12
  154. package/getAnnotationNameAndStartStopString.js +0 -61
  155. package/getBpsPerRow.js +0 -19
  156. package/getCutsiteLabelHeights.js +0 -56
  157. package/getGapMap.js +0 -12
  158. package/getGaps.js +0 -27
  159. package/getInternalLabel.js +0 -40
  160. package/getOveHotkeyDefs.js +0 -12
  161. package/getPairwiseOverviewLinearViewOptions.js +0 -38
  162. package/getRangeAnglesSpecial.js +0 -12
  163. package/getStructuredBases.js +0 -97
  164. package/getTrackFromEvent.js +0 -25
  165. package/getVisibleStartEnd.js +0 -7
  166. package/getXStartAndWidthFromNonCircularRange.js +0 -12
  167. package/getXStartAndWidthOfRangeWrtRow.js +0 -27
  168. package/getXStartAndWidthOfRowAnnotation.js +0 -19
  169. package/getYOffset.js +0 -15
  170. package/hoveredAnnotation.js +0 -24
  171. package/importTool.js +0 -27
  172. package/index.js +0 -71
  173. package/inlineFindTool.js +0 -38
  174. package/isElementInViewport.js +0 -29
  175. package/isEnzymeFilterAndSelector.js +0 -1
  176. package/isTargetWithinEl.js +0 -6
  177. package/labelLineIntensity.js +0 -25
  178. package/labelSize.js +0 -23
  179. package/ladderDefaults.js +0 -25
  180. package/lastSavedId.js +0 -20
  181. package/lineageLines.js +0 -11
  182. package/linear.png +0 -0
  183. package/makeStore.js +0 -34
  184. package/massageTickSpacing.js +0 -19
  185. package/materiallyAvailable.js +0 -19
  186. package/middleware.js +0 -112
  187. package/minimumOrfSize.js +0 -24
  188. package/minimumOrfSizeSelector.js +0 -2
  189. package/modalActions.js +0 -3
  190. package/moveCaret.js +0 -58
  191. package/name.js +0 -19
  192. package/normalizeAngle.js +0 -3
  193. package/normalizeAngleRange.js +0 -9
  194. package/oligoTool.js +0 -30
  195. package/onlyUpdateForKeysDeep.js +0 -31
  196. package/orfFrameToColorMap.js +0 -10
  197. package/orfTool.js +0 -136
  198. package/orfsSelector.js +0 -15
  199. package/panelsShown.js +0 -294
  200. package/partLengthsToHide.js +0 -23
  201. package/partOverhangs.js +0 -6
  202. package/partTagSearch.js +0 -69
  203. package/partTool.js +0 -45
  204. package/parts.js +0 -19
  205. package/partsSelector.js +0 -8
  206. package/pie.png +0 -0
  207. package/polarToSpecialCartesian.js +0 -7
  208. package/positionCutsites.js +0 -6
  209. package/prepareRowData.js +0 -64
  210. package/primerBases.js +0 -221
  211. package/primerLengthsToHide.js +0 -27
  212. package/primers.js +0 -19
  213. package/primersSelector.js +0 -8
  214. package/print.png +0 -0
  215. package/printTool.js +0 -31
  216. package/propertiesTool.js +0 -40
  217. package/proteinUtils.js +0 -3
  218. package/pureNoFunc.js +0 -18
  219. package/readOnly.js +0 -25
  220. package/redoTool.js +0 -30
  221. package/reflex-styles.css +0 -128
  222. package/reflex-styles.css.map +0 -9
  223. package/relaxLabelAngles.js +0 -157
  224. package/relaxLabels_DEPRECATED.js +0 -105
  225. package/replacementLayers.js +0 -36
  226. package/restrictionEnzymes.js +0 -52
  227. package/restrictionEnzymesSelector.js +0 -34
  228. package/rowviewContants.js +0 -3
  229. package/ruler.css +0 -89
  230. package/save.png +0 -0
  231. package/saveTool.js +0 -44
  232. package/searchLayersSelector.js +0 -71
  233. package/selectedAnnotations.js +0 -89
  234. package/selectedAnnotationsSelector.js +0 -1
  235. package/selectedCutsitesSelector.js +0 -21
  236. package/selectedPartTags.js +0 -21
  237. package/selectionLayer.js +0 -25
  238. package/sequence.js +0 -12
  239. package/sequenceDataHistory.js +0 -43
  240. package/sequenceDataSelector.js +0 -2
  241. package/sequenceLengthSelector.js +0 -5
  242. package/sequenceSelector.js +0 -4
  243. package/sharedActionCreators.js +0 -0
  244. package/shouldFlipText.js +0 -4
  245. package/shouldRerender.js +0 -27
  246. package/showFileDialog.js +0 -25
  247. package/showGCContent.js +0 -23
  248. package/show_cut_sites.png +0 -0
  249. package/show_features.png +0 -0
  250. package/show_orfs.png +0 -0
  251. package/show_primers.png +0 -0
  252. package/simpleDialog.css +0 -13
  253. package/specialCutsiteFilterOptions.js +0 -22
  254. package/style.css +0 -10
  255. package/tagsToBoldSelector.js +0 -2
  256. package/toggle_views.svg +0 -1
  257. package/toolBar.js +0 -23
  258. package/translationSearchMatchesSelector.js +0 -14
  259. package/translations.js +0 -20
  260. package/translationsRawSelector.js +0 -8
  261. package/translationsSelector.js +0 -137
  262. package/typeField.js +0 -24
  263. package/undoTool.js +0 -30
  264. package/updateEditor.js +0 -200
  265. package/updateLabelsForInViewFeatures.js +0 -55
  266. package/updateLabelsForInViewFeaturesCircView.js +0 -41
  267. package/updateTrackHelper.js +0 -58
  268. package/uppercaseSequenceMapFont.js +0 -25
  269. package/upsertDeleteActionGenerator.js +0 -31
  270. package/useAAColorType.js +0 -8
  271. package/useAdditionalOrfStartCodons.js +0 -24
  272. package/useAnnotationLimits.js +0 -42
  273. package/useChromatogramPrefs.js +0 -31
  274. package/useFormValue.js +0 -7
  275. package/useLadders.js +0 -6
  276. package/useMeltingTemp.js +0 -7
  277. package/useTmType.js +0 -10
  278. package/userDefinedHandlersAndOpts.js +0 -61
  279. package/utils.js +0 -37
  280. package/versionHistory.js +0 -26
  281. package/versionHistoryTool.js +0 -21
  282. package/viewSubmenu.js +0 -479
  283. package/visibilityTool.js +0 -39
  284. package/withHover.js +0 -113
  285. 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
- ];