@teselagen/ove 0.3.11 → 0.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +529 -422
- package/index.mjs +530 -423
- package/index.umd.js +532 -402
- package/package.json +2 -2
- package/src/AlignmentView/AlignmentVisibilityTool.js +1 -1
- package/src/AlignmentView/EditTrackNameDialog.js +1 -5
- package/src/AlignmentView/HorizontalPanelDragHandle.js +2 -2
- package/src/AlignmentView/Minimap.js +12 -12
- package/src/AlignmentView/PairwiseAlignmentView.js +1 -1
- package/src/AlignmentView/getGapMap.js +1 -1
- package/src/AlignmentView/getTrackFromEvent.js +1 -1
- package/src/AlignmentView/index.js +32 -37
- package/src/AutoAnnotate.js +48 -48
- package/src/CircularView/Cutsites.js +3 -3
- package/src/CircularView/Labels/index.js +7 -7
- package/src/CircularView/Labels/relaxLabels_DEPRECATED.js +5 -5
- package/src/CircularView/RotateCircularViewSlider.js +1 -1
- package/src/CircularView/SelectionLayer.js +2 -2
- package/src/CircularView/drawAnnotations.js +3 -3
- package/src/CircularView/getAngleForPositionMidpoint.js +1 -1
- package/src/CircularView/index.d.ts +11 -11
- package/src/CircularView/index.js +9 -9
- package/src/CreateAnnotationsPage.js +7 -5
- package/src/CreateCustomEnzyme/index.js +1 -5
- package/src/CutsiteFilter/AdditionalCutsiteInfoDialog.js +11 -11
- package/src/CutsiteFilter/index.js +12 -12
- package/src/DigestTool/AddLaddersDialog.js +1 -1
- package/src/DigestTool/DigestTool.js +3 -3
- package/src/DigestTool/Ladder.js +8 -8
- package/src/DigestTool/ladderDefaults.js +1 -2
- package/src/Editor/CommandHotkeyHandler.js +1 -1
- package/src/Editor/DropHandler.js +2 -2
- package/src/Editor/index.js +15 -15
- package/src/Editor/userDefinedHandlersAndOpts.js +3 -1
- package/src/FindBar/index.js +6 -6
- package/src/GlobalDialogUtils.js +6 -0
- package/src/LinearView/ZoomLinearView.js +1 -1
- package/src/LinearView/index.js +7 -7
- package/src/MenuBar/index.js +1 -1
- package/src/MenuBar/viewSubmenu.js +1 -1
- package/src/PCRTool/PCRTool.js +19 -19
- package/src/Reflex/Browser.js +4 -5
- package/src/Reflex/ReflexContainer.js +3 -3
- package/src/Reflex/ReflexElement.js +2 -2
- package/src/RowItem/Axis.js +1 -1
- package/src/RowItem/Caret/index.js +1 -1
- package/src/RowItem/Chromatograms/Chromatogram.js +3 -3
- package/src/RowItem/CutsiteSelectionLayers.js +1 -1
- package/src/RowItem/Cutsites.js +1 -1
- package/src/RowItem/Labels.js +2 -2
- package/src/RowItem/Orfs.js +2 -2
- package/src/RowItem/Sequence.js +4 -4
- package/src/RowItem/StackedAnnotations/PointedAnnotation.js +3 -3
- package/src/RowItem/StackedAnnotations/getStructuredBases.js +1 -1
- package/src/RowItem/Translations/AASliver.js +71 -75
- package/src/RowItem/Translations/index.js +1 -1
- package/src/RowItem/getCutsiteLabelHeights.js +1 -1
- package/src/RowItem/index.js +14 -8
- package/src/RowView/estimateRowHeight.js +5 -5
- package/src/RowView/index.d.ts +7 -7
- package/src/RowView/index.js +11 -12
- package/src/SimpleCircularOrLinearView.js +6 -6
- package/src/StatusBar/MeltingTemp.js +3 -3
- package/src/StatusBar/index.js +29 -33
- package/src/ToolBar/ToolbarItem.js +2 -2
- package/src/ToolBar/alignmentTool.js +9 -9
- package/src/ToolBar/editTool.js +41 -37
- package/src/ToolBar/findTool.js +2 -2
- package/src/ToolBar/importTool.js +1 -1
- package/src/ToolBar/index.js +2 -2
- package/src/ToolBar/oligoTool.js +1 -1
- package/src/ToolBar/orfTool.js +1 -6
- package/src/ToolBar/printTool.js +2 -2
- package/src/ToolBar/visibilityTool.js +1 -1
- package/src/VersionHistoryView/index.js +2 -2
- package/src/commands/index.js +237 -230
- package/src/createVectorEditor/index.js +4 -4
- package/src/fileUtils.js +18 -18
- package/src/helperComponents/AddOrEditAnnotationDialog/index.js +22 -15
- package/src/helperComponents/AddOrEditFeatureDialog/index.js +2 -2
- package/src/helperComponents/AddOrEditPartDialog/index.js +2 -2
- package/src/helperComponents/AddOrEditPrimerDialog/index.js +5 -5
- package/src/helperComponents/EnzymesDialog/index.js +17 -22
- package/src/helperComponents/GoToDialog.js +5 -1
- package/src/helperComponents/MergeFeaturesDialog/index.js +3 -3
- package/src/helperComponents/PinchHelper/PinchHelper.js +1 -1
- package/src/helperComponents/PrintDialog/index.js +4 -4
- package/src/helperComponents/PropertiesDialog/CutsiteProperties.js +3 -3
- package/src/helperComponents/PropertiesDialog/GenbankView.js +1 -1
- package/src/helperComponents/PropertiesDialog/GeneralProperties.js +10 -8
- package/src/helperComponents/PropertiesDialog/GenericAnnotationProperties.js +136 -138
- package/src/helperComponents/PropertiesDialog/OrfProperties.js +3 -3
- package/src/helperComponents/PropertiesDialog/PrimerProperties.js +1 -1
- package/src/helperComponents/PropertiesDialog/TranslationProperties.js +2 -2
- package/src/helperComponents/PropertiesDialog/index.js +3 -3
- package/src/helperComponents/RemoveDuplicates/index.js +3 -3
- package/src/helperComponents/SelectDialog.js +3 -3
- package/src/helperComponents/UncontrolledSliderWithPlusMinusBtns.js +5 -5
- package/src/helperComponents/createSimpleDialog.js +1 -1
- package/src/helperComponents/partTagSearch.js +2 -5
- package/src/helperComponents/withHover.js +3 -3
- package/src/redux/alignments.js +6 -6
- package/src/redux/annotationVisibility.js +4 -4
- package/src/redux/featureLengthsToHide.js +1 -1
- package/src/redux/frameTranslations.js +3 -3
- package/src/redux/middleware.js +2 -2
- package/src/redux/panelsShown.js +19 -19
- package/src/redux/partLengthsToHide.js +1 -1
- package/src/redux/primerLengthsToHide.js +1 -1
- package/src/redux/readOnly.js +1 -4
- package/src/redux/selectionLayer.js +1 -1
- package/src/redux/sequenceData/features.js +1 -1
- package/src/redux/sequenceData/upsertDeleteActionGenerator.js +1 -1
- package/src/redux/sequenceDataHistory.js +5 -5
- package/src/redux/toolBar.js +2 -4
- package/src/redux/utils/createMetaAction.js +2 -2
- package/src/redux/versionHistory.js +1 -2
- package/src/selectors/annotationSearchSelector.js +4 -4
- package/src/selectors/circularSelector.js +1 -1
- package/src/selectors/cutsiteLabelColorSelector.js +1 -1
- package/src/selectors/filteredCutsitesSelector.js +6 -6
- package/src/selectors/filteredFeaturesSelector.js +4 -4
- package/src/selectors/filteredPartsSelector.js +5 -5
- package/src/selectors/filteredPrimersSelector.js +3 -3
- package/src/selectors/isEnzymeFilterAndSelector.js +1 -1
- package/src/selectors/orfsSelector.js +1 -1
- package/src/selectors/restrictionEnzymesSelector.js +2 -2
- package/src/selectors/searchLayersSelector.js +7 -7
- package/src/selectors/sequenceLengthSelector.js +1 -1
- package/src/selectors/sequenceSelector.js +1 -1
- package/src/selectors/tagsToBoldSelector.js +1 -1
- package/src/selectors/translationsSelector.js +7 -7
- package/src/updateEditor.js +1 -1
- package/src/utils/PassThrough.js +1 -1
- package/src/utils/addWrappedAddons.js +1 -1
- package/src/utils/annotationTypes.js +2 -2
- package/src/utils/combineReducersDontIgnoreKeys.js +1 -1
- package/src/utils/editorUtils.js +2 -2
- package/src/utils/massageTickSpacing.js +1 -1
- package/src/utils/onlyUpdateForKeysDeep.js +1 -1
- package/src/utils/pureNoFunc.js +1 -1
- package/src/utils/shouldRerender.js +1 -1
- package/src/utils/showFileDialog.js +6 -7
- package/src/utils/updateLabelsForInViewFeatures.js +1 -1
- package/src/utils/useAnnotationLimits.js +1 -1
- package/src/withEditorInteractions/Keyboard.js +2 -3
- package/src/withEditorInteractions/createSequenceInputPopup.js +4 -4
- package/src/withEditorInteractions/index.js +93 -55
- package/src/withEditorProps/index.js +39 -37
- package/style.css +138 -138
package/src/PCRTool/PCRTool.js
CHANGED
|
@@ -23,7 +23,7 @@ function PCRTool(props) {
|
|
|
23
23
|
primerClicked
|
|
24
24
|
} = props;
|
|
25
25
|
const origSeqLen = sequenceData.sequence.length;
|
|
26
|
-
forEach(sequenceData.primers,
|
|
26
|
+
forEach(sequenceData.primers, p => (p.originalId = p.id));
|
|
27
27
|
const fPrimer = sequenceData.primers[forwardPrimer];
|
|
28
28
|
const rPrimer = sequenceData.primers[reversePrimer];
|
|
29
29
|
let seqBetween;
|
|
@@ -77,7 +77,7 @@ function PCRTool(props) {
|
|
|
77
77
|
});
|
|
78
78
|
seqBetween.name = `PCR Product from ${sequenceData.name} `;
|
|
79
79
|
}
|
|
80
|
-
const getPrimers =
|
|
80
|
+
const getPrimers = opts => {
|
|
81
81
|
return flatMap(
|
|
82
82
|
sequenceData.primers,
|
|
83
83
|
({ name, id, forward, start, end }) => {
|
|
@@ -139,23 +139,23 @@ function PCRTool(props) {
|
|
|
139
139
|
<div style={{ fontWeight: "600", fontSize: 13 }}>Output Product:</div>
|
|
140
140
|
{seqBetween ? (
|
|
141
141
|
<SimpleCircularOrLinearView
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
142
|
+
noWarnings
|
|
143
|
+
withZoomLinearView
|
|
144
|
+
withZoomCircularView
|
|
145
|
+
withChoosePreviewType
|
|
146
|
+
withDownload
|
|
147
|
+
smallSlider
|
|
148
|
+
withCaretEnabled
|
|
149
|
+
width={width - 50}
|
|
150
|
+
height={Math.max(height - 250, 400)}
|
|
151
|
+
sequenceData={seqBetween}
|
|
152
|
+
primerClicked={args => {
|
|
153
|
+
primerClicked({
|
|
154
|
+
...args,
|
|
155
|
+
annotation: sequenceData.primers[args.annotation.originalId]
|
|
156
|
+
});
|
|
157
|
+
}}
|
|
158
|
+
></SimpleCircularOrLinearView>
|
|
159
159
|
) : (
|
|
160
160
|
<div style={{ marginTop: 5, fontStyle: "italic", color: "grey" }}>
|
|
161
161
|
Please choose a forward and reverse primer to see the resulting PCR
|
package/src/Reflex/Browser.js
CHANGED
|
@@ -20,7 +20,6 @@ class Browser {
|
|
|
20
20
|
return Browser.isBrowser() && Browser.getUserAgent().match(/Opera Mini/i);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
|
|
24
23
|
// Firefox 1.0+
|
|
25
24
|
static isFirefox() {
|
|
26
25
|
return Browser.isBrowser() && typeof InstallTrigger !== "undefined";
|
|
@@ -43,19 +42,20 @@ class Browser {
|
|
|
43
42
|
|
|
44
43
|
// Edge 20+
|
|
45
44
|
static isEdge() {
|
|
46
|
-
return Browser.isBrowser() &&
|
|
45
|
+
return Browser.isBrowser() && !Browser.isIE() && !!window.StyleMedia;
|
|
47
46
|
}
|
|
48
47
|
|
|
49
48
|
// Chrome 1+
|
|
50
49
|
static isChrome() {
|
|
51
|
-
return Browser.isBrowser() &&
|
|
50
|
+
return Browser.isBrowser() && !!window.chrome && !!window.chrome.webstore;
|
|
52
51
|
}
|
|
53
52
|
|
|
54
53
|
// Blink engine detection
|
|
55
54
|
static isBlink() {
|
|
56
55
|
return (
|
|
57
56
|
Browser.isBrowser() &&
|
|
58
|
-
(
|
|
57
|
+
(Browser.isChrome() || Browser.isOpera()) &&
|
|
58
|
+
!!window.CSS
|
|
59
59
|
);
|
|
60
60
|
}
|
|
61
61
|
|
|
@@ -77,7 +77,6 @@ class Browser {
|
|
|
77
77
|
);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
|
|
81
80
|
static isWindows() {
|
|
82
81
|
return (
|
|
83
82
|
(Browser.isBrowser() && Browser.isWindowsDesktop()) ||
|
|
@@ -517,7 +517,7 @@ class ReflexContainer extends React.Component {
|
|
|
517
517
|
|
|
518
518
|
const newFlex =
|
|
519
519
|
currentFlex > 0
|
|
520
|
-
? currentFlex * newSize / size
|
|
520
|
+
? (currentFlex * newSize) / size
|
|
521
521
|
: this.computePixelFlex() * newSize;
|
|
522
522
|
|
|
523
523
|
// eslint-disable-next-line react/no-direct-mutation-state
|
|
@@ -717,8 +717,8 @@ class ReflexContainer extends React.Component {
|
|
|
717
717
|
guid(format = "xxxx-xxxx") {
|
|
718
718
|
let d = new Date().getTime();
|
|
719
719
|
|
|
720
|
-
return format.replace(/[xy]/g, function(c) {
|
|
721
|
-
const r = (
|
|
720
|
+
return format.replace(/[xy]/g, function (c) {
|
|
721
|
+
const r = (d + Math.random() * 16) % 16 | 0;
|
|
722
722
|
d = Math.floor(d / 16);
|
|
723
723
|
// eslint-disable-next-line eqeqeq
|
|
724
724
|
return (c == "x" ? r : (r & 0x7) | 0x8).toString(16);
|
|
@@ -46,7 +46,7 @@ export default class ReflexElement extends React.Component {
|
|
|
46
46
|
|
|
47
47
|
this.onResize = this.onResize.bind(this);
|
|
48
48
|
|
|
49
|
-
this.setStateThrottled = throttle(
|
|
49
|
+
this.setStateThrottled = throttle(state => {
|
|
50
50
|
this.setState(state);
|
|
51
51
|
}, this.props.renderOnResizeRate);
|
|
52
52
|
|
|
@@ -107,7 +107,7 @@ export default class ReflexElement extends React.Component {
|
|
|
107
107
|
/////////////////////////////////////////////////////////
|
|
108
108
|
renderChildren() {
|
|
109
109
|
if (this.props.propagateDimensions) {
|
|
110
|
-
return React.Children.map(this.props.children,
|
|
110
|
+
return React.Children.map(this.props.children, child => {
|
|
111
111
|
const newProps = Object.assign({}, child.props, {
|
|
112
112
|
dimensions: this.state.dimensions
|
|
113
113
|
});
|
package/src/RowItem/Axis.js
CHANGED
|
@@ -32,7 +32,7 @@ const Axis = function (props) {
|
|
|
32
32
|
range: row,
|
|
33
33
|
sequenceLength,
|
|
34
34
|
isProtein
|
|
35
|
-
}).map(
|
|
35
|
+
}).map(tickMarkPosition => {
|
|
36
36
|
const gaps = getGaps ? getGaps(tickMarkPosition).gapsBefore : 0;
|
|
37
37
|
const xCenter =
|
|
38
38
|
(tickMarkPosition - (isProtein ? 1 : 0) + gaps) * charWidth +
|
|
@@ -61,7 +61,7 @@ export default function Chromatogram(props) {
|
|
|
61
61
|
style={{
|
|
62
62
|
position: "relative"
|
|
63
63
|
}}
|
|
64
|
-
onContextMenu={
|
|
64
|
+
onContextMenu={e => {
|
|
65
65
|
showContextMenu([chromatogramMenu], undefined, e);
|
|
66
66
|
}}
|
|
67
67
|
>
|
|
@@ -70,7 +70,7 @@ export default function Chromatogram(props) {
|
|
|
70
70
|
data-tip="Scale Chromatogram Up"
|
|
71
71
|
className="scaleChromatogramButtonUp"
|
|
72
72
|
icon="caret-up"
|
|
73
|
-
onClick={
|
|
73
|
+
onClick={e => {
|
|
74
74
|
e.stopPropagation();
|
|
75
75
|
setScalePct(scalePct + 0.01);
|
|
76
76
|
}}
|
|
@@ -85,7 +85,7 @@ export default function Chromatogram(props) {
|
|
|
85
85
|
data-tip="Scale Chromatogram Down"
|
|
86
86
|
className="scaleChromatogramButtonDown"
|
|
87
87
|
icon="caret-down"
|
|
88
|
-
onClick={
|
|
88
|
+
onClick={e => {
|
|
89
89
|
e.stopPropagation();
|
|
90
90
|
setScalePct(scalePct - 0.01);
|
|
91
91
|
}}
|
|
@@ -17,7 +17,7 @@ export const CutsiteSelectionLayers = connectToEditor(
|
|
|
17
17
|
row
|
|
18
18
|
}) {
|
|
19
19
|
return Object.keys(cutsites)
|
|
20
|
-
.sort(
|
|
20
|
+
.sort(a => (cutsites[a].id === hoveredAnnotation ? 1 : -1))
|
|
21
21
|
.map(function (id, index) {
|
|
22
22
|
const cutsite = cutsites[id];
|
|
23
23
|
const isHovered = hoveredAnnotation === cutsite.id;
|
package/src/RowItem/Cutsites.js
CHANGED
package/src/RowItem/Labels.js
CHANGED
|
@@ -73,7 +73,7 @@ function Labels(props) {
|
|
|
73
73
|
)
|
|
74
74
|
);
|
|
75
75
|
|
|
76
|
-
filter(annotationRanges,
|
|
76
|
+
filter(annotationRanges, r => {
|
|
77
77
|
if (onlyShowLabelsThatDoNotFit) {
|
|
78
78
|
//tnrtodo: more work needs to be done here to make this actually configurable
|
|
79
79
|
//check if annotation name will fit
|
|
@@ -298,7 +298,7 @@ const DrawLabel = withHover(
|
|
|
298
298
|
|
|
299
299
|
{!noLabelLine && (
|
|
300
300
|
<div
|
|
301
|
-
ref={
|
|
301
|
+
ref={n => {
|
|
302
302
|
if (n) this.n = n;
|
|
303
303
|
}}
|
|
304
304
|
className="veLabelLine"
|
package/src/RowItem/Orfs.js
CHANGED
|
@@ -7,7 +7,7 @@ function getExtraInnerCompProps(annotationRange, props) {
|
|
|
7
7
|
const { annotation, start, end } = annotationRange;
|
|
8
8
|
const { frame, internalStartCodonIndices = [] } = annotation;
|
|
9
9
|
const normalizedInternalStartCodonIndices = internalStartCodonIndices
|
|
10
|
-
.filter(function(position) {
|
|
10
|
+
.filter(function (position) {
|
|
11
11
|
if (
|
|
12
12
|
position >= row.start &&
|
|
13
13
|
position >= start &&
|
|
@@ -17,7 +17,7 @@ function getExtraInnerCompProps(annotationRange, props) {
|
|
|
17
17
|
return true;
|
|
18
18
|
} else return false;
|
|
19
19
|
})
|
|
20
|
-
.map(function(position) {
|
|
20
|
+
.map(function (position) {
|
|
21
21
|
return position - start;
|
|
22
22
|
});
|
|
23
23
|
|
package/src/RowItem/Sequence.js
CHANGED
|
@@ -43,12 +43,12 @@ class Sequence extends React.Component {
|
|
|
43
43
|
const rowSeqLen = sequence.length;
|
|
44
44
|
let overlapToBold;
|
|
45
45
|
let isDigestPart;
|
|
46
|
-
[hoveredAnnEasyStore.hoveredAnn].forEach(
|
|
46
|
+
[hoveredAnnEasyStore.hoveredAnn].forEach(ann => {
|
|
47
47
|
if (ann && !isReplacementLayer) {
|
|
48
48
|
let start = ann.start;
|
|
49
49
|
let end = ann.end - 1;
|
|
50
50
|
|
|
51
|
-
partOverhangs.forEach(
|
|
51
|
+
partOverhangs.forEach(h => {
|
|
52
52
|
if (ann[h]) {
|
|
53
53
|
isDigestPart = true;
|
|
54
54
|
if (h.includes("Underhang") && isReverse) {
|
|
@@ -101,7 +101,7 @@ class Sequence extends React.Component {
|
|
|
101
101
|
scrollData,
|
|
102
102
|
width
|
|
103
103
|
});
|
|
104
|
-
inner = times(numChunks,
|
|
104
|
+
inner = times(numChunks, i => {
|
|
105
105
|
const seqChunk = getChunk(sequence, chunkSize, i);
|
|
106
106
|
const textLength = charWidth * seqChunk.length;
|
|
107
107
|
const x = i * chunkWidth;
|
|
@@ -194,7 +194,7 @@ class ColoredSequence extends React.Component {
|
|
|
194
194
|
const { props } = this;
|
|
195
195
|
if (
|
|
196
196
|
["charWidth", "sequence", "height", "isReverse", "width"].some(
|
|
197
|
-
|
|
197
|
+
key => props[key] !== newProps[key]
|
|
198
198
|
)
|
|
199
199
|
)
|
|
200
200
|
return true;
|
|
@@ -69,7 +69,7 @@ function PointedAnnotation(props) {
|
|
|
69
69
|
let partOverhangStart;
|
|
70
70
|
let partOverhangEnd;
|
|
71
71
|
|
|
72
|
-
partOverhangs.forEach(
|
|
72
|
+
partOverhangs.forEach(h => {
|
|
73
73
|
const overhangBps = props[h];
|
|
74
74
|
if (overhangBps) {
|
|
75
75
|
if (h.includes("fivePrime")) {
|
|
@@ -255,7 +255,7 @@ function PointedAnnotation(props) {
|
|
|
255
255
|
(rangeType === (forward ? "start" : "end") ||
|
|
256
256
|
rangeType === "beginningAndEnd") && (
|
|
257
257
|
<Tooltip
|
|
258
|
-
onInteraction={
|
|
258
|
+
onInteraction={isOpen => {
|
|
259
259
|
setOpen(isOpen);
|
|
260
260
|
}}
|
|
261
261
|
isOpen={isOpen}
|
|
@@ -277,7 +277,7 @@ function PointedAnnotation(props) {
|
|
|
277
277
|
(rangeType === (forward ? "end" : "start") ||
|
|
278
278
|
rangeType === "beginningAndEnd") && (
|
|
279
279
|
<Tooltip
|
|
280
|
-
onInteraction={
|
|
280
|
+
onInteraction={isOpen => {
|
|
281
281
|
setOpen2(isOpen);
|
|
282
282
|
}}
|
|
283
283
|
isOpen={isOpen2}
|
|
@@ -107,83 +107,79 @@ function AASliver(props) {
|
|
|
107
107
|
z`;
|
|
108
108
|
return (
|
|
109
109
|
<g
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
strokeWidth="5"
|
|
151
|
-
fill={color || "gray"}
|
|
152
|
-
/>
|
|
153
|
-
))}
|
|
110
|
+
onClick={onClick}
|
|
111
|
+
onContextMenu={onContextMenu}
|
|
112
|
+
transform={
|
|
113
|
+
"scale(" +
|
|
114
|
+
(width / 100) * 1.25 +
|
|
115
|
+
", " +
|
|
116
|
+
height / 100 +
|
|
117
|
+
") translate(" +
|
|
118
|
+
((forward ? -20 : -50) +
|
|
119
|
+
((relativeAAPositionInTranslation - 1) * 100) / 1.25) +
|
|
120
|
+
",0)"
|
|
121
|
+
}
|
|
122
|
+
>
|
|
123
|
+
<title>{title}</title>
|
|
124
|
+
{showAAColors &&
|
|
125
|
+
(isFiller ? (
|
|
126
|
+
<polyline
|
|
127
|
+
className={letter}
|
|
128
|
+
transform={forward ? "scale(3,1)" : "translate(300,0) scale(-3,1) "}
|
|
129
|
+
points={
|
|
130
|
+
isFiller
|
|
131
|
+
? "25,0 49,0 60,50 49,100 25,100 38,50 25,0"
|
|
132
|
+
: isTruncatedStart
|
|
133
|
+
? "0,0 50,0 60,50 50,100 00,100 16,50 0,0"
|
|
134
|
+
: isTruncatedEnd
|
|
135
|
+
? "24,0 74,0 84,50 74,100 24,100 40,50 24,0"
|
|
136
|
+
: "0,0 74,0 85,50 74,100 0,100 16,50 0,0"
|
|
137
|
+
}
|
|
138
|
+
strokeWidth="5"
|
|
139
|
+
fill={color || "gray"}
|
|
140
|
+
/>
|
|
141
|
+
) : (
|
|
142
|
+
<path
|
|
143
|
+
className={letter}
|
|
144
|
+
transform={forward ? "scale(3,1)" : "translate(300,0) scale(-3,1) "}
|
|
145
|
+
d={path}
|
|
146
|
+
strokeWidth="5"
|
|
147
|
+
fill={color || "gray"}
|
|
148
|
+
/>
|
|
149
|
+
))}
|
|
154
150
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
151
|
+
{!isFiller && (
|
|
152
|
+
<text
|
|
153
|
+
fontSize={25}
|
|
154
|
+
stroke="black"
|
|
155
|
+
strokeWidth={2}
|
|
156
|
+
transform={`scale(${(3 / width) * 10},3) translate(${
|
|
157
|
+
((forward ? 45 : 55) * width) / 10
|
|
158
|
+
},21)`}
|
|
159
|
+
x="0"
|
|
160
|
+
y="4"
|
|
161
|
+
style={{ textAnchor: "middle" }}
|
|
162
|
+
>
|
|
163
|
+
{letter}
|
|
164
|
+
</text>
|
|
165
|
+
)}
|
|
170
166
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
167
|
+
{showAminoAcidNumbers && (aminoAcidIndex + 1) % 5 === 0 && (
|
|
168
|
+
<text
|
|
169
|
+
fontSize={25}
|
|
170
|
+
stroke="black"
|
|
171
|
+
strokeWidth={2}
|
|
172
|
+
transform={`scale(${(3 / width) * 10},3) translate(${
|
|
173
|
+
((forward ? 45 : 55) * width) / 10
|
|
174
|
+
},51)`}
|
|
175
|
+
x="0"
|
|
176
|
+
y="4"
|
|
177
|
+
style={{ textAnchor: "middle" }}
|
|
178
|
+
>
|
|
179
|
+
{aminoAcidIndex + 1}
|
|
180
|
+
</text>
|
|
181
|
+
)}
|
|
182
|
+
</g>
|
|
187
183
|
);
|
|
188
184
|
}
|
|
189
185
|
|
|
@@ -19,7 +19,7 @@ export default function getCutsiteLabelHeights({
|
|
|
19
19
|
let maxAnnotationYOffset = 0;
|
|
20
20
|
const rowCenter = rowLength / 2;
|
|
21
21
|
const iTree = new IntervalTree(rowCenter);
|
|
22
|
-
forEach(annotationRanges, function(annotationRange) {
|
|
22
|
+
forEach(annotationRanges, function (annotationRange) {
|
|
23
23
|
counter++;
|
|
24
24
|
if (counter > 50) return;
|
|
25
25
|
let annotation = annotationRange.annotation;
|
package/src/RowItem/index.js
CHANGED
|
@@ -3,7 +3,15 @@ import {
|
|
|
3
3
|
getSequenceWithinRange,
|
|
4
4
|
getOverlapsOfPotentiallyCircularRanges
|
|
5
5
|
} from "@teselagen/range-utils";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
map,
|
|
8
|
+
camelCase,
|
|
9
|
+
startCase,
|
|
10
|
+
startsWith,
|
|
11
|
+
flatMap,
|
|
12
|
+
assign,
|
|
13
|
+
noop
|
|
14
|
+
} from "lodash";
|
|
7
15
|
import { getComplementSequenceString } from "@teselagen/sequence-utils";
|
|
8
16
|
import React, { useMemo } from "react";
|
|
9
17
|
import pluralize from "pluralize";
|
|
@@ -24,15 +32,13 @@ import { filter } from "lodash";
|
|
|
24
32
|
import { defaultCharWidth } from "../constants/rowviewContants";
|
|
25
33
|
import { CutsiteSelectionLayers } from "./CutsiteSelectionLayers";
|
|
26
34
|
|
|
27
|
-
|
|
28
|
-
|
|
29
35
|
function filterRanges(ranges, extraProps = {}) {
|
|
30
36
|
if (!ranges) return ranges;
|
|
31
37
|
if (extraProps.onlyForward) {
|
|
32
|
-
ranges = filter(ranges,
|
|
38
|
+
ranges = filter(ranges, a => a.annotation.forward);
|
|
33
39
|
}
|
|
34
40
|
if (extraProps.onlyReverse) {
|
|
35
|
-
ranges = filter(ranges,
|
|
41
|
+
ranges = filter(ranges, a => !a.annotation.forward);
|
|
36
42
|
}
|
|
37
43
|
return ranges;
|
|
38
44
|
}
|
|
@@ -149,7 +155,7 @@ export default function RowItem(props) {
|
|
|
149
155
|
if (alignmentData) {
|
|
150
156
|
const gapMap = getGapMap(alignmentData.sequence);
|
|
151
157
|
//this function is used to calculate the number of spaces that come before or inside a range
|
|
152
|
-
return
|
|
158
|
+
return rangeOrCaretPosition => {
|
|
153
159
|
if (typeof rangeOrCaretPosition !== "object") {
|
|
154
160
|
return {
|
|
155
161
|
gapsBefore:
|
|
@@ -211,7 +217,7 @@ export default function RowItem(props) {
|
|
|
211
217
|
const pluralType = pluralize(type);
|
|
212
218
|
const ranges = filterRanges(
|
|
213
219
|
annotationLabelVisibility[pluralType] && annotationVisibility[pluralType]
|
|
214
|
-
? map(row[pluralType],
|
|
220
|
+
? map(row[pluralType], a =>
|
|
215
221
|
assign(a, {
|
|
216
222
|
onClick: props[type + "Clicked"],
|
|
217
223
|
onRightClick: props[type + "RightClicked"],
|
|
@@ -629,7 +635,7 @@ export default function RowItem(props) {
|
|
|
629
635
|
|
|
630
636
|
function getGapMap(sequence) {
|
|
631
637
|
const gapMap = [0]; //a map of position to how many gaps come before that position [0,0,0,5,5,5,5,17,17,17, ]
|
|
632
|
-
sequence.split("").forEach(
|
|
638
|
+
sequence.split("").forEach(char => {
|
|
633
639
|
if (char === "-") {
|
|
634
640
|
gapMap[Math.max(0, gapMap.length - 1)] =
|
|
635
641
|
(gapMap[Math.max(0, gapMap.length - 1)] || 0) + 1;
|
|
@@ -25,7 +25,7 @@ export const rowHeights = {
|
|
|
25
25
|
|
|
26
26
|
rowHeights.primaryProteinSequence = rowHeights.translations;
|
|
27
27
|
|
|
28
|
-
Object.keys(rowHeights).forEach(
|
|
28
|
+
Object.keys(rowHeights).forEach(k => {
|
|
29
29
|
rowHeights[k].type = k;
|
|
30
30
|
rowHeights[k].marginTop = rowHeights[k].marginTop || 0;
|
|
31
31
|
rowHeights[k].marginBottom = rowHeights[k].marginBottom || 0;
|
|
@@ -33,7 +33,7 @@ Object.keys(rowHeights).forEach((k) => {
|
|
|
33
33
|
rowHeights[k].spaceBetweenAnnotations || 0;
|
|
34
34
|
});
|
|
35
35
|
const translations = {
|
|
36
|
-
getHeight:
|
|
36
|
+
getHeight: props => {
|
|
37
37
|
if (props.annotationVisibility.aminoAcidNumbers) {
|
|
38
38
|
return [rowHeights.aminoAcidNumbers.type, rowHeights.translations.type];
|
|
39
39
|
}
|
|
@@ -88,7 +88,7 @@ const annotationsToCompute = {
|
|
|
88
88
|
}
|
|
89
89
|
};
|
|
90
90
|
|
|
91
|
-
export default
|
|
91
|
+
export default props => {
|
|
92
92
|
let {
|
|
93
93
|
index,
|
|
94
94
|
cache,
|
|
@@ -133,7 +133,7 @@ export default (props) => {
|
|
|
133
133
|
if (hasYOffset) {
|
|
134
134
|
let maxYOffset = 0;
|
|
135
135
|
annotations &&
|
|
136
|
-
annotations.forEach(
|
|
136
|
+
annotations.forEach(a => {
|
|
137
137
|
if (a.yOffset + 1 > maxYOffset) maxYOffset = a.yOffset + 1;
|
|
138
138
|
});
|
|
139
139
|
heightToAdd = maxYOffset * annotationHeight;
|
|
@@ -175,7 +175,7 @@ function getHeights(heightKey, props) {
|
|
|
175
175
|
function getSummedHeights(heightKeys, props) {
|
|
176
176
|
let height = 0;
|
|
177
177
|
let marginHeight = 0;
|
|
178
|
-
(Array.isArray(heightKeys) ? heightKeys : [heightKeys]).forEach(
|
|
178
|
+
(Array.isArray(heightKeys) ? heightKeys : [heightKeys]).forEach(k => {
|
|
179
179
|
const [h, m] = getHeights(k, props);
|
|
180
180
|
height += h;
|
|
181
181
|
marginHeight += m;
|
package/src/RowView/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
export interface RowViewProps {
|
|
3
|
-
editorName: string
|
|
4
|
-
height: number
|
|
5
|
-
width: number
|
|
6
|
-
marginWidth: number
|
|
7
|
-
charWidth: number
|
|
8
|
-
RowItemProps: object
|
|
3
|
+
editorName: string; //the name of the editor instance (this should match what you've set up in your redux store)
|
|
4
|
+
height: number; //default = 400
|
|
5
|
+
width: number;
|
|
6
|
+
marginWidth: number;
|
|
7
|
+
charWidth: number;
|
|
8
|
+
RowItemProps: object; //props passed to RowItem
|
|
9
9
|
}
|
|
10
|
-
export default class RowView extends React.Component
|
|
10
|
+
export default class RowView extends React.Component<RowViewProps> {}
|