@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/partTagSearch.js DELETED
@@ -1,69 +0,0 @@
1
- import React from "react";
2
- import withEditorProps from "../withEditorProps";
3
- import { TgSelect, getKeyedTagsAndTagOptions } from "@teselagen/ui";
4
- import { flatMap } from "lodash-es";
5
- import { uniqBy } from "lodash-es";
6
-
7
- export const PartTagSearch = withEditorProps(PartToolDropdown);
8
-
9
- function PartToolDropdown({
10
- sequenceData,
11
- updateSelectedPartTags,
12
- selectedPartTags,
13
- allPartTags,
14
- annotationVisibilityShow,
15
- editTagsLink,
16
- dontAutoOpen
17
- }) {
18
- if (!sequenceData) return <div>No Parts Present</div>;
19
- const keyedTags = getKeyedTagsAndTagOptions(allPartTags);
20
-
21
- // this is what keyedTags looks like:
22
- // keyedTags = {
23
- // '12:4': {label,value,id},
24
- // '12:1': {label,value,id},
25
- // '44': {label,value,id},
26
- // }
27
-
28
- const tags = uniqBy(
29
- flatMap(sequenceData.parts, ({ tags }) => {
30
- return flatMap(tags, t => {
31
- const tag = keyedTags[t];
32
- if (!tag) return [];
33
- return tag;
34
- });
35
- }),
36
- "value"
37
- );
38
- return (
39
- <div style={{ width: "100%" }}>
40
- <div>Search Parts By Tag: </div>
41
- <div style={{ display: "flex" }}>
42
- <TgSelect
43
- value={selectedPartTags.parts}
44
- onChange={(...args) => {
45
- annotationVisibilityShow("parts");
46
- updateSelectedPartTags(...args);
47
- }}
48
- isTagSelect
49
- multi
50
- popoverProps={{
51
- usePortal: false,
52
- modifiers: {
53
- preventOverflow: { enabled: false },
54
- hide: {
55
- enabled: false
56
- },
57
- flip: {
58
- boundariesElement: "viewport"
59
- }
60
- }
61
- }}
62
- options={tags}
63
- autoOpen={!dontAutoOpen}
64
- ></TgSelect>
65
- {editTagsLink || null}
66
- </div>
67
- </div>
68
- );
69
- }
package/partTool.js DELETED
@@ -1,45 +0,0 @@
1
- import { Icon } from "@blueprintjs/core";
2
- // import { Checkbox, Button } from "@blueprintjs/core";
3
- import React from "react";
4
- // import { connect } from "react-redux";
5
- // import { convertRangeTo1Based } from "@teselagen/range-utils";
6
- //import { partIcon } from "@teselagen/ui";
7
- import ToolbarItem from "./ToolbarItem";
8
- import { connectToEditor } from "../withEditorProps";
9
- import { PartTagSearch } from "../helperComponents/partTagSearch";
10
-
11
- export default connectToEditor(
12
- ({ annotationVisibility = {}, toolBar = {} }) => {
13
- return {
14
- toggled: annotationVisibility.parts,
15
- isOpen: toolBar.openItem === "partTool"
16
- };
17
- }
18
- )(({
19
- allPartTags,
20
- editTagsLink,
21
- toolbarItemProps,
22
- toggled,
23
- annotationVisibilityToggle,
24
- isOpen
25
- }) => {
26
- return (
27
- <ToolbarItem
28
- {...{
29
- Icon: <Icon icon="doughnut-chart" />,
30
- onIconClick: function () {
31
- annotationVisibilityToggle("parts");
32
- },
33
- toggled,
34
- editTagsLink,
35
- allPartTags,
36
- tooltip: "Show parts",
37
- tooltipToggled: "Hide parts",
38
- noDropdownIcon: !allPartTags,
39
- Dropdown: PartTagSearch,
40
- dropdowntooltip: (!isOpen ? "Show" : "Hide") + " Part Options",
41
- ...toolbarItemProps
42
- }}
43
- />
44
- );
45
- });
package/parts.js DELETED
@@ -1,19 +0,0 @@
1
- import { createReducer } from "redux-act";
2
- import createAction from "../utils/createMetaAction";
3
- import upsertDeleteActionGenerator from "./upsertDeleteActionGenerator";
4
-
5
- // ------------------------------------
6
- // Actions
7
- // ------------------------------------
8
- export const upsertPart = createAction("UPSERT_PART");
9
- export const deletePart = createAction("DELETE_PART");
10
-
11
- // ------------------------------------
12
- // Reducer
13
- // ------------------------------------
14
- export default createReducer(
15
- {
16
- ...upsertDeleteActionGenerator(upsertPart, deletePart)
17
- },
18
- {}
19
- );
package/partsSelector.js DELETED
@@ -1,8 +0,0 @@
1
- import { createSelector } from "reselect";
2
- import sequenceDataSelector from "./sequenceDataSelector";
3
-
4
- function partsRawSelector(sequenceData) {
5
- return sequenceData.parts;
6
- }
7
-
8
- export default createSelector(sequenceDataSelector, partsRawSelector);
package/pie.png DELETED
Binary file
@@ -1,7 +0,0 @@
1
- export default function polarToSpecialCartesian(radius, angle) {
2
- //the 0 angle returns the 0,1 point on the unit circle instead of the 1,0 point like normal
3
- return {
4
- x: radius * Math.cos(angle - Math.PI / 2),
5
- y: radius * Math.sin(angle - Math.PI / 2)
6
- };
7
- }
@@ -1,6 +0,0 @@
1
- export function positionCutsites(annotation) {
2
- return {
3
- start: annotation.topSnipPosition,
4
- end: annotation.topSnipPosition
5
- };
6
- }
package/prepareRowData.js DELETED
@@ -1,64 +0,0 @@
1
- import { mapAnnotationsToRows } from "@teselagen/sequence-utils";
2
- import { annotationTypes } from "@teselagen/sequence-utils";
3
- export default function prepareRowData(sequenceData, bpsPerRow) {
4
- const sequenceLength = sequenceData.noSequence
5
- ? sequenceData.size
6
- : sequenceData.sequence.length;
7
- const totalRows = Math.ceil(sequenceLength / bpsPerRow) || 1; //this check makes sure there is always at least 1 row!
8
- const rows = [];
9
- const rowMap = {};
10
- if (sequenceData.isProtein) {
11
- rowMap.primaryProteinSequence = mapAnnotationsToRows(
12
- [
13
- {
14
- id: "primaryProteinSequence",
15
- forward: true,
16
- start: 0,
17
- end: sequenceLength - 1,
18
- proteinSequence: sequenceData.proteinSequence,
19
- aminoAcids: sequenceData.aminoAcidDataForEachBaseOfDNA
20
- }
21
- ],
22
- sequenceLength,
23
- bpsPerRow
24
- );
25
- }
26
- annotationTypes.forEach(function (type) {
27
- rowMap[type] = mapAnnotationsToRows(
28
- sequenceData[type],
29
- sequenceLength,
30
- bpsPerRow,
31
- { splitForwardReverse: type === "primers" }
32
- );
33
- });
34
-
35
- for (let rowNumber = 0; rowNumber < totalRows; rowNumber++) {
36
- const row = {};
37
- row.rowNumber = rowNumber;
38
- row.start = rowNumber * bpsPerRow;
39
- row.end =
40
- (rowNumber + 1) * bpsPerRow - 1 < sequenceLength
41
- ? (rowNumber + 1) * bpsPerRow - 1
42
- : sequenceLength - 1;
43
- if (row.end < 0) {
44
- row.end = 0;
45
- }
46
- annotationTypes.forEach(function (type) {
47
- row[type] = rowMap[type][rowNumber] || [];
48
- });
49
- if (sequenceData.isProtein) {
50
- row.isProtein = true;
51
- row.primaryProteinSequence =
52
- rowMap.primaryProteinSequence &&
53
- (rowMap.primaryProteinSequence[rowNumber] || []);
54
- }
55
- row.sequence = sequenceData.noSequence
56
- ? {
57
- length: row.end + 1 - row.start
58
- }
59
- : sequenceData.sequence.slice(row.start, row.end + 1);
60
-
61
- rows[rowNumber] = row;
62
- }
63
- return rows;
64
- }
package/primerBases.js DELETED
@@ -1,221 +0,0 @@
1
- import React from "react";
2
- import { map } from "lodash-es";
3
- import { fudge2, realCharWidth } from "../constants";
4
- import getYOffset from "../../CircularView/getYOffset";
5
- import { getRangeLength } from "@teselagen/range-utils";
6
- import { getStructuredBases } from "./getStructuredBases";
7
-
8
- export function getBasesToShow({
9
- hidePrimerBases,
10
- annotation,
11
- annotationRange,
12
- charWidth,
13
- bpsPerRow,
14
- fullSequence,
15
- iTree,
16
- sequenceLength
17
- }) {
18
- if (hidePrimerBases) return {};
19
- const basesToShow = {};
20
- if (annotation && annotation.bases) {
21
- const fudge = charWidth - realCharWidth;
22
- const { forward, primerBindsOn } = annotation;
23
-
24
- const { basesNoInsertsWithMetaData, inserts, aRange } = getStructuredBases({
25
- ...annotation,
26
- fullSequence,
27
- annotationRange,
28
- sequenceLength
29
- });
30
-
31
- const annLen = getRangeLength(annotation, sequenceLength);
32
- const aRangeLen = getRangeLength(annotationRange, sequenceLength);
33
- const startOffset = annotationRange.start % bpsPerRow;
34
- const endOffset = bpsPerRow - (annotationRange.end % bpsPerRow);
35
- basesToShow.insertPaths = "";
36
- basesToShow.insertTicks = "";
37
- basesToShow.flipAnnotation = !forward;
38
- basesToShow.extraHeight = 0;
39
- const insertText = [];
40
- const level1Height = -10;
41
- const level2Height = 11;
42
- inserts.forEach((i, n) => {
43
- //loop thru all inserts
44
- const indexToUse = forward ? i.index : annLen - i.index - 1;
45
- if (
46
- aRange.start - (primerBindsOn === "5prime" ? 1 : 0) <= indexToUse &&
47
- aRange.end + (primerBindsOn === "5prime" ? 1 : 0) >= indexToUse
48
- ) {
49
- //only draw if insert falls within the annotation range
50
- let xStart = i.index - aRange.start - Math.ceil(0.5 * i.bases.length); //calculate initial xStart
51
- let xEnd = i.index - aRange.start + Math.floor(0.5 * i.bases.length);
52
- if (aRange.end + 3 < xEnd) {
53
- xStart -= xEnd - aRange.end - 3;
54
- xEnd -= xEnd - aRange.end - 3;
55
- }
56
- if (i.index === 0) {
57
- //for the first chunk, try to make it hang off the end if possible
58
- xStart -= xEnd - 1;
59
- xEnd -= xEnd - 1;
60
- }
61
- const forwAnd3Prime = forward;
62
-
63
- if (xStart < -(forwAnd3Prime ? startOffset : endOffset)) {
64
- //if the xStart is going to fall off the row to the left, correct it by moving the xStart to the right
65
- const offsetLeft =
66
- -(forwAnd3Prime ? startOffset : endOffset) - xStart;
67
- xStart += offsetLeft;
68
- xEnd += offsetLeft;
69
- } else if (
70
- xEnd + (forwAnd3Prime ? startOffset : endOffset) >
71
- bpsPerRow
72
- ) {
73
- //if the xStart is going to fall off the row to the right, correct it by moving the xStart to the left
74
- const offsetLeft =
75
- bpsPerRow - xEnd - (forwAnd3Prime ? startOffset : endOffset);
76
- xStart += offsetLeft;
77
- xEnd += offsetLeft;
78
- }
79
- // use an interval tree to determine the level the primer insert should be on to not overlap with other inserts
80
- const yOffset = getYOffset(iTree, xStart, xEnd);
81
- iTree.insert(xStart, xEnd, {
82
- //tnr: pass an initial level in the case that the underlying primer ranges themselves are overlapping
83
- ...annotationRange,
84
- yOffset
85
- });
86
-
87
- basesToShow.extraHeight = Math.max(
88
- basesToShow.extraHeight,
89
- 15 + yOffset * 20
90
- );
91
- const insertStart =
92
- (indexToUse - (forward ? aRange.start : aRange.end)) *
93
- (!forward && primerBindsOn === "5prime" ? -1 : 1);
94
- basesToShow.insertPaths += getInsertPath({
95
- xStart,
96
- xEnd,
97
- charWidth,
98
- level: yOffset,
99
- insertStart
100
- });
101
-
102
- if (indexToUse !== aRange.end + 1 && indexToUse !== -1) {
103
- basesToShow.insertTicks += getInsertTick({
104
- charWidth,
105
- height: level2Height,
106
- insertStart
107
- });
108
- }
109
- const textLength = Math.max(
110
- 0,
111
- charWidth * i.bases.length - fudge - fudge2
112
- );
113
- insertText.push(
114
- <text
115
- style={{ pointerEvents: "none" }}
116
- data-insert-bases={i.bases}
117
- className="ve-monospace-font tg-primer-bases-insert"
118
- textLength={textLength}
119
- transform={
120
- forward
121
- ? ""
122
- : `translate(${aRangeLen * charWidth},-5) scale(-1,-1) `
123
- }
124
- key={n}
125
- x={
126
- forward
127
- ? (xStart - 1) * charWidth + fudge
128
- : xStart * charWidth - fudge / 2
129
- }
130
- y={level1Height - yOffset * 20 - (forward ? 0 : 5)}
131
- >
132
- {i.bases.split("").map((b, i) => (
133
- <tspan
134
- key={i}
135
- rotate={forward ? 0 : 180}
136
- className="tg-no-match-seq"
137
- textLength={textLength}
138
- >
139
- {b}
140
- </tspan>
141
- ))}
142
- </text>
143
- );
144
- }
145
- });
146
-
147
- const textLength =
148
- charWidth * basesNoInsertsWithMetaData.length - fudge - fudge2;
149
- basesToShow.baseEl = (
150
- <React.Fragment>
151
- <text
152
- {...{
153
- textLength,
154
- y: forward ? level2Height : -(basesToShow.extraHeight - 5),
155
- x: forward ? fudge / 2 : fudge / 2 + 0.2 /* + diffLen * charWidth */
156
- }}
157
- style={{ pointerEvents: "none" }}
158
- className="ve-monospace-font tg-primer-bases"
159
- >
160
- {map(
161
- basesNoInsertsWithMetaData,
162
- ({ b, isMatch, isAmbiguousMatch }, i) => {
163
- return (
164
- <tspan
165
- key={i}
166
- className={
167
- b === "&"
168
- ? "tg-no-show-seq"
169
- : isMatch
170
- ? ""
171
- : isAmbiguousMatch
172
- ? "tg-ambiguous-match-seq"
173
- : "tg-no-match-seq"
174
- }
175
- textLength={textLength}
176
- >
177
- {b}
178
- </tspan>
179
- );
180
- }
181
- )}
182
- </text>
183
- {insertText}
184
- </React.Fragment>
185
- );
186
- }
187
- return basesToShow;
188
- }
189
-
190
- function getInsertTick({ insertStart, charWidth, height }) {
191
- if (insertStart === 0) return "";
192
- const insertLocation = insertStart * charWidth;
193
-
194
- const jutUp = `
195
- L ${insertLocation - 1},${height + 5}
196
- L ${insertLocation - 1},${height - 4}
197
- L ${insertLocation - 1},${height + 5}
198
- `;
199
- return jutUp;
200
- }
201
-
202
- function getInsertPath({ charWidth, xStart, xEnd, insertStart, level = 0 }) {
203
- const insertLocation = insertStart * charWidth;
204
- const insertHeight = 15;
205
- const levelHeight = -5 - level * 20;
206
- const leftX = (xStart - 1) * charWidth;
207
- const rightX = (xEnd - 1) * charWidth;
208
-
209
- const jutUp = `
210
- L ${insertLocation - 6},${0}
211
- L ${insertLocation - 6},${levelHeight}
212
- L ${leftX},${levelHeight}
213
- L ${leftX},${-insertHeight + levelHeight}
214
-
215
- L ${rightX},${-insertHeight + levelHeight}
216
- L ${rightX},${levelHeight}
217
- L ${insertLocation + 4},${levelHeight}
218
- L ${insertLocation + 4},${0}
219
- `;
220
- return jutUp;
221
- }
@@ -1,27 +0,0 @@
1
- import createMergedDefaultStateReducer from "./utils/createMergedDefaultStateReducer";
2
- import createAction from "./utils/createMetaAction";
3
-
4
- // ------------------------------------
5
- // Actions
6
- // ------------------------------------
7
- export const updatePrimerLengthsToHide = createAction(
8
- "updatePrimerLengthsToHide"
9
- );
10
- export const togglePrimerLengthsToHide = createAction(
11
- "togglePrimerLengthsToHide"
12
- );
13
-
14
- // ------------------------------------
15
- // Reducer
16
- // ------------------------------------
17
- export default createMergedDefaultStateReducer(
18
- {
19
- [updatePrimerLengthsToHide]: (state, payload) => {
20
- return { ...state, ...payload };
21
- },
22
- [togglePrimerLengthsToHide]: state => {
23
- return { ...state, enabled: !state["enabled"] };
24
- }
25
- },
26
- { enabled: false, min: 0, max: 40 }
27
- );
package/primers.js DELETED
@@ -1,19 +0,0 @@
1
- import { createReducer } from "redux-act";
2
- import createAction from "../utils/createMetaAction";
3
- import upsertDeleteActionGenerator from "./upsertDeleteActionGenerator";
4
-
5
- // ------------------------------------
6
- // Actions
7
- // ------------------------------------
8
- export const upsertPrimer = createAction("UPSERT_PRIMER");
9
- export const deletePrimer = createAction("DELETE_PRIMER");
10
-
11
- // ------------------------------------
12
- // Reducer
13
- // ------------------------------------
14
- export default createReducer(
15
- {
16
- ...upsertDeleteActionGenerator(upsertPrimer, deletePrimer)
17
- },
18
- {}
19
- );
@@ -1,8 +0,0 @@
1
- import { createSelector } from "reselect";
2
- import sequenceDataSelector from "./sequenceDataSelector";
3
-
4
- function primersRawSelector(sequenceData) {
5
- return sequenceData.primers;
6
- }
7
-
8
- export default createSelector(sequenceDataSelector, primersRawSelector);
package/print.png DELETED
Binary file
package/printTool.js DELETED
@@ -1,31 +0,0 @@
1
- //TNRTODO this needs to be fixed and implemented
2
- import React from "react";
3
- import print from "./veToolbarIcons/print.png";
4
-
5
- export default () => {
6
- return {
7
- Icon: <img src={print} alt="Print Vector" />,
8
- onIconClick: function () {
9
- // var myPrintContent = document.getElementById('printdiv');
10
- // var myPrintWindow = window.open(windowUrl, windowName, 'left=300,top=100,width=400,height=400');
11
- // myPrintWindow.document.write(myPrintContent.innerHTML);
12
- // myPrintWindow.document.getElementById('hidden_div').style.display='block'
13
- // myPrintWindow.document.close();
14
- // myPrintWindow.focus();
15
- // myPrintWindow.print();
16
- // myPrintWindow.close();
17
- // return false;
18
- // print();
19
- // var content = document.getElementById("divcontents");
20
- // document.appendChild(con)
21
- // var pri = document.getElementById("ifmcontentstoprint").contentWindow;
22
- // pri.document.open();
23
- // pri.document.write(content.innerHTML);
24
- // pri.document.close();
25
- // pri.focus();
26
- // pri.print();
27
- // downloadSequenceData(sequenceData || )
28
- },
29
- tooltip: "Print Vector"
30
- };
31
- };
package/propertiesTool.js DELETED
@@ -1,40 +0,0 @@
1
- import createAction from "./utils/createMetaAction";
2
- import createMergedDefaultStateReducer from "./utils/createMergedDefaultStateReducer";
3
-
4
- // ------------------------------------
5
- // Actions
6
- // ------------------------------------
7
- // export const propertiesViewToggle = createAction(
8
- // "TOGGLE_PROPERTIES_VIEW",
9
- // () => {}
10
- // ); //NOTE!!:: second argument sanitizes actions so no payload is passed
11
- // export const propertiesViewOpen = createAction(
12
- // "Open_PROPERTIES_VIEW",
13
- // () => {}
14
- // ); //NOTE!!:: second argument sanitizes actions so no payload is passed
15
- export const propertiesViewTabUpdate = createAction("propertiesViewTabUpdate"); //NOTE!!:: second argument sanitizes actions so no payload is passed
16
-
17
- // ------------------------------------
18
- // Reducer
19
- // ------------------------------------
20
- export default createMergedDefaultStateReducer(
21
- {
22
- [propertiesViewTabUpdate]: (
23
- state,
24
- tabId,
25
- selectedAnnotationOrAnnotationId
26
- ) => {
27
- return {
28
- ...state,
29
- selectedAnnotationId: selectedAnnotationOrAnnotationId
30
- ? selectedAnnotationOrAnnotationId.id ||
31
- selectedAnnotationOrAnnotationId
32
- : undefined,
33
- tabId
34
- };
35
- }
36
- },
37
- {
38
- tabId: "general"
39
- }
40
- );
package/proteinUtils.js DELETED
@@ -1,3 +0,0 @@
1
- export function divideBy3(num, shouldDivideBy3) {
2
- return shouldDivideBy3 ? Math.floor(num / 3) : num;
3
- }
package/pureNoFunc.js DELETED
@@ -1,18 +0,0 @@
1
- import { shouldUpdate } from "recompose";
2
- import { isEqualWith, isFunction } from "lodash-es";
3
-
4
- const isEq = (o1, o2) => {
5
- const isEq = isEqualWith(o1, o2, function (val1, val2) {
6
- if (isFunction(val1) && isFunction(val2)) {
7
- return val1 === val2 || val1.toString() === val2.toString();
8
- }
9
- });
10
- return isEq;
11
- };
12
-
13
- const pure = BaseComponent => {
14
- const hoc = shouldUpdate((props, nextProps) => !isEq(props, nextProps));
15
- return hoc(BaseComponent);
16
- };
17
-
18
- export default pure;
package/readOnly.js DELETED
@@ -1,25 +0,0 @@
1
- //./caretPosition.js
2
- import { createReducer } from "redux-act";
3
- import createAction from "./utils/createMetaAction";
4
- import { noop } from "lodash-es";
5
-
6
- // ------------------------------------
7
- // Actions
8
- // ------------------------------------
9
- export const toggleReadOnlyMode = createAction("TOGGLE_READ_ONLY_MODE", noop); //NOTE!!:: second argument sanitizes actions so no payload is passed
10
- export const updateReadOnlyMode = createAction("UPDATE_READ_ONLY_MODE");
11
-
12
- // ------------------------------------
13
- // Reducer
14
- // ------------------------------------
15
- export default createReducer(
16
- {
17
- [updateReadOnlyMode]: (state, payload) => {
18
- return payload;
19
- },
20
- [toggleReadOnlyMode]: state => {
21
- return !state;
22
- }
23
- },
24
- true
25
- );
package/redoTool.js DELETED
@@ -1,30 +0,0 @@
1
- import React from "react";
2
- import { Icon } from "@blueprintjs/core";
3
- import ToolbarItem from "./ToolbarItem";
4
- import { connectToEditor } from "../withEditorProps";
5
-
6
- export default connectToEditor(editorState => {
7
- return {
8
- disabled: !(
9
- editorState.sequenceDataHistory &&
10
- editorState.sequenceDataHistory.future &&
11
- editorState.sequenceDataHistory.future.length
12
- )
13
- };
14
- })(({ toolbarItemProps, redo, disabled }) => {
15
- return (
16
- <ToolbarItem
17
- {...{
18
- Icon: <Icon data-test="veRedoTool" icon="redo" />,
19
- disabled,
20
- onIconClick: redo,
21
- tooltip: (
22
- <span>
23
- Redo <span style={{ fontSize: 10 }}>(Cmd/Ctrl+Shift+Z)</span>
24
- </span>
25
- ),
26
- ...toolbarItemProps
27
- }}
28
- />
29
- );
30
- });