@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.
- package/CreateAnnotationsPage.d.ts +4 -3
- package/README.md +1 -1
- package/fileUtils.d.ts +12 -0
- package/html2canvas.esm--JN4fLQL.js +7891 -0
- package/html2canvas.esm-B7d7VJmQ.cjs +7891 -0
- package/index.cjs.js +1305 -1121
- package/index.es.js +1305 -1121
- package/index.umd.js +189161 -0
- package/ove.css +17 -4
- package/package.json +5 -9
- package/redux/findTool.d.ts +1 -0
- package/selectors/searchLayersSelector.d.ts +1 -1
- package/src/AutoAnnotate.js +1 -1
- package/src/CreateAnnotationsPage.js +1 -2
- package/src/Editor/style.css +8 -3
- package/src/FindBar/index.js +32 -1
- package/src/RowItem/SelectionLayer/index.js +42 -4
- package/src/RowItem/SelectionLayer/style.css +8 -0
- package/src/fileUtils.js +103 -0
- package/src/helperComponents/PropertiesDialog/TranslationProperties.js +1 -1
- package/src/redux/findTool.js +9 -0
- package/src/selectors/searchLayersSelector.js +40 -2
- package/style.css +12098 -1
- package/AASliver.js +0 -187
- package/AddLaddersDialog.js +0 -82
- package/AdditionalCutsiteInfoDialog.js +0 -599
- package/AlignmentVisibilityTool.js +0 -105
- package/AnnotationContainerHolder.js +0 -20
- package/AnnotationPositioner.js +0 -27
- package/AutoAnnotate.js +0 -501
- package/AutoAnnotateBpMatchingDialog.js +0 -208
- package/Axis.js +0 -151
- package/AxisNumbers.js +0 -35
- package/Browser.js +0 -106
- package/Caret.js +0 -63
- package/Chromatogram.js +0 -293
- package/CircularDnaSequence.js +0 -73
- package/CircularZoomMinimap.js +0 -16
- package/ColorPicker.js +0 -30
- package/CommandHotkeyHandler.js +0 -44
- package/CreateAnnotationsPage.js +0 -98
- package/Cutsite.js +0 -18
- package/CutsiteProperties.js +0 -176
- package/CutsiteSelectionLayers.js +0 -47
- package/Cutsites.js +0 -271
- package/DeletionLayer.js +0 -28
- package/DropHandler.css +0 -21
- package/DropHandler.js +0 -64
- package/EditCaretPosition.js +0 -234
- package/EditTrackNameDialog.js +0 -30
- package/Feature.js +0 -83
- package/FeatureProperties.js +0 -6
- package/FillWindow.js +0 -47
- package/GenbankView.js +0 -74
- package/GeneralProperties.js +0 -117
- package/GenericAnnotationProperties.js +0 -406
- package/GlobalDialog.js +0 -73
- package/GlobalDialogUtils.js +0 -110
- package/GoToDialog.js +0 -25
- package/HorizontalPanelDragHandle.js +0 -35
- package/Keyboard.js +0 -85
- package/Labels.js +0 -327
- package/Ladder.css +0 -20
- package/Ladder.js +0 -303
- package/MeltingTemp.js +0 -85
- package/Menlo.ttf +0 -0
- package/Minimap.js +0 -515
- package/Mismatches.js +0 -134
- package/Monaco.ttf +0 -0
- package/MultipleSeqsDetectedOnImportDialog.js +0 -74
- package/Orf.js +0 -109
- package/OrfProperties.js +0 -117
- package/Orfs.js +0 -35
- package/PCRTool.js +0 -179
- package/PairwiseAlignmentView.js +0 -68
- package/Part.js +0 -34
- package/PartProperties.js +0 -9
- package/PassThrough.js +0 -3
- package/PerformantSelectionLayer.js +0 -32
- package/PinchHelper.js +0 -24
- package/PointedAnnotation.js +0 -347
- package/PositionAnnotationOnCircle.js +0 -26
- package/Primer.js +0 -41
- package/PrimerProperties.js +0 -19
- package/ReflexContainer.js +0 -802
- package/ReflexElement.js +0 -160
- package/ReflexEvents.js +0 -77
- package/ReflexSplitter.js +0 -205
- package/RenameSequenceDialog.js +0 -7
- package/RotateCircularViewSlider.js +0 -93
- package/SelectDialog.js +0 -150
- package/SequenceName.js +0 -15
- package/SimpleCircularOrLinearView.js +0 -381
- package/SimpleOligoPreview.js +0 -39
- package/SingleEnzymeCutsiteInfo.js +0 -139
- package/ToolbarItem.js +0 -192
- package/Translation.js +0 -198
- package/TranslationProperties.js +0 -149
- package/UncontrolledSliderWithPlusMinusBtns.css +0 -5
- package/UncontrolledSliderWithPlusMinusBtns.js +0 -134
- package/VeTopRightContainer.js +0 -12
- package/ZoomCircularViewSlider.js +0 -62
- package/ZoomLinearView.js +0 -47
- package/addAlignment.js +0 -6
- package/addMetaToActionCreators.js +0 -12
- package/addWrappedAddons.js +0 -20
- package/alignmentTool.js +0 -503
- package/alignments.js +0 -379
- package/annotationLabelVisibility.js +0 -2
- package/annotationSearchSelector.js +0 -24
- package/annotationTypes.js +0 -35
- package/annotationVisibility.js +0 -196
- package/annotationsToSupport.js +0 -104
- package/arrayToObjWithIds.js +0 -17
- package/arrayUtils.js +0 -19
- package/array_move.js +0 -10
- package/calculateTickMarkPositionsForGivenRange.js +0 -47
- package/caretPosition.js +0 -27
- package/cdsFeaturesSelector.js +0 -9
- package/charWidth.js +0 -22
- package/circular.js +0 -19
- package/circularSelector.js +0 -4
- package/clickAndDragUtils.js +0 -576
- package/coerceInitialValue.js +0 -7
- package/combineReducersDontIgnoreKeys.js +0 -12
- package/commandUtils.js +0 -20
- package/constants.js +0 -2
- package/copyOptions.js +0 -34
- package/createFragmentLines.js +0 -120
- package/createMergedDefaultStateReducer.js +0 -30
- package/createMetaAction.js +0 -12
- package/createSequenceInputPopup.js +0 -290
- package/createSequenceInputPopupStyle.css +0 -87
- package/createSimpleDialog.js +0 -89
- package/createYourOwnEnzyme.js +0 -39
- package/cutsiteLabelColorSelector.js +0 -6
- package/cutsiteTool.js +0 -88
- package/cutsitesByRangeSelector.js +0 -5
- package/cutsitesSelector.js +0 -61
- package/darkmode.css +0 -98
- package/defaultConfig.js +0 -150
- package/deletionLayers.js +0 -36
- package/description.js +0 -21
- package/digestTool.js +0 -34
- package/dnaToColor.js +0 -17
- package/downloadTool.js +0 -39
- package/draggableClassnames.js +0 -5
- package/drawAnnotations.js +0 -440
- package/drawDirectedPiePiece.js +0 -142
- package/editTool.js +0 -49
- package/editorSelector.js +0 -2
- package/editorUtils.js +0 -205
- package/estimateRowHeight.js +0 -184
- package/featureLengthsToHide.js +0 -27
- package/featureTool.js +0 -34
- package/features.js +0 -19
- package/featuresSelector.js +0 -8
- package/filteredCutsitesSelector.js +0 -136
- package/filteredFeaturesSelector.js +0 -32
- package/filteredPartsSelector.js +0 -57
- package/filteredPrimersSelector.js +0 -27
- package/filteredRestrictionEnzymesSelector.js +0 -1
- package/find.png +0 -0
- package/findTool.js +0 -79
- package/findToolConstants.js +0 -1
- package/frameTranslations.js +0 -52
- package/fullscreen.png +0 -0
- package/getAdditionalEnzymesSelector.js +0 -46
- package/getAngleForPositionMidpoint.js +0 -3
- package/getAnnotationClassnames.js +0 -12
- package/getAnnotationNameAndStartStopString.js +0 -61
- package/getBpsPerRow.js +0 -19
- package/getCutsiteLabelHeights.js +0 -56
- package/getGapMap.js +0 -12
- package/getGaps.js +0 -27
- package/getInternalLabel.js +0 -40
- package/getOveHotkeyDefs.js +0 -12
- package/getPairwiseOverviewLinearViewOptions.js +0 -38
- package/getRangeAnglesSpecial.js +0 -12
- package/getStructuredBases.js +0 -97
- package/getTrackFromEvent.js +0 -25
- package/getVisibleStartEnd.js +0 -7
- package/getXStartAndWidthFromNonCircularRange.js +0 -12
- package/getXStartAndWidthOfRangeWrtRow.js +0 -27
- package/getXStartAndWidthOfRowAnnotation.js +0 -19
- package/getYOffset.js +0 -15
- package/hoveredAnnotation.js +0 -24
- package/importTool.js +0 -27
- package/index.js +0 -71
- package/inlineFindTool.js +0 -38
- package/isElementInViewport.js +0 -29
- package/isEnzymeFilterAndSelector.js +0 -1
- package/isTargetWithinEl.js +0 -6
- package/labelLineIntensity.js +0 -25
- package/labelSize.js +0 -23
- package/ladderDefaults.js +0 -25
- package/lastSavedId.js +0 -20
- package/lineageLines.js +0 -11
- package/linear.png +0 -0
- package/makeStore.js +0 -34
- package/massageTickSpacing.js +0 -19
- package/materiallyAvailable.js +0 -19
- package/middleware.js +0 -112
- package/minimumOrfSize.js +0 -24
- package/minimumOrfSizeSelector.js +0 -2
- package/modalActions.js +0 -3
- package/moveCaret.js +0 -58
- package/name.js +0 -19
- package/normalizeAngle.js +0 -3
- package/normalizeAngleRange.js +0 -9
- package/oligoTool.js +0 -30
- package/onlyUpdateForKeysDeep.js +0 -31
- package/orfFrameToColorMap.js +0 -10
- package/orfTool.js +0 -136
- package/orfsSelector.js +0 -15
- package/panelsShown.js +0 -294
- package/partLengthsToHide.js +0 -23
- package/partOverhangs.js +0 -6
- package/partTagSearch.js +0 -69
- package/partTool.js +0 -45
- package/parts.js +0 -19
- package/partsSelector.js +0 -8
- package/pie.png +0 -0
- package/polarToSpecialCartesian.js +0 -7
- package/positionCutsites.js +0 -6
- package/prepareRowData.js +0 -64
- package/primerBases.js +0 -221
- package/primerLengthsToHide.js +0 -27
- package/primers.js +0 -19
- package/primersSelector.js +0 -8
- package/print.png +0 -0
- package/printTool.js +0 -31
- package/propertiesTool.js +0 -40
- package/proteinUtils.js +0 -3
- package/pureNoFunc.js +0 -18
- package/readOnly.js +0 -25
- package/redoTool.js +0 -30
- package/reflex-styles.css +0 -128
- package/reflex-styles.css.map +0 -9
- package/relaxLabelAngles.js +0 -157
- package/relaxLabels_DEPRECATED.js +0 -105
- package/replacementLayers.js +0 -36
- package/restrictionEnzymes.js +0 -52
- package/restrictionEnzymesSelector.js +0 -34
- package/rowviewContants.js +0 -3
- package/ruler.css +0 -89
- package/save.png +0 -0
- package/saveTool.js +0 -44
- package/searchLayersSelector.js +0 -71
- package/selectedAnnotations.js +0 -89
- package/selectedAnnotationsSelector.js +0 -1
- package/selectedCutsitesSelector.js +0 -21
- package/selectedPartTags.js +0 -21
- package/selectionLayer.js +0 -25
- package/sequence.js +0 -12
- package/sequenceDataHistory.js +0 -43
- package/sequenceDataSelector.js +0 -2
- package/sequenceLengthSelector.js +0 -5
- package/sequenceSelector.js +0 -4
- package/sharedActionCreators.js +0 -0
- package/shouldFlipText.js +0 -4
- package/shouldRerender.js +0 -27
- package/showFileDialog.js +0 -25
- package/showGCContent.js +0 -23
- package/show_cut_sites.png +0 -0
- package/show_features.png +0 -0
- package/show_orfs.png +0 -0
- package/show_primers.png +0 -0
- package/simpleDialog.css +0 -13
- package/specialCutsiteFilterOptions.js +0 -22
- package/tagsToBoldSelector.js +0 -2
- package/toggle_views.svg +0 -1
- package/toolBar.js +0 -23
- package/translationSearchMatchesSelector.js +0 -14
- package/translations.js +0 -20
- package/translationsRawSelector.js +0 -8
- package/translationsSelector.js +0 -137
- package/typeField.js +0 -24
- package/undoTool.js +0 -30
- package/updateEditor.js +0 -200
- package/updateLabelsForInViewFeatures.js +0 -55
- package/updateLabelsForInViewFeaturesCircView.js +0 -41
- package/updateTrackHelper.js +0 -58
- package/uppercaseSequenceMapFont.js +0 -25
- package/upsertDeleteActionGenerator.js +0 -31
- package/useAAColorType.js +0 -8
- package/useAdditionalOrfStartCodons.js +0 -24
- package/useAnnotationLimits.js +0 -42
- package/useChromatogramPrefs.js +0 -31
- package/useFormValue.js +0 -7
- package/useLadders.js +0 -6
- package/useMeltingTemp.js +0 -7
- package/useTmType.js +0 -10
- package/userDefinedHandlersAndOpts.js +0 -61
- package/utils.js +0 -37
- package/versionHistory.js +0 -26
- package/versionHistoryTool.js +0 -21
- package/viewSubmenu.js +0 -479
- package/visibilityTool.js +0 -39
- package/withHover.js +0 -113
- package/withRestrictionEnzymes.js +0 -15
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { DialogFooter, wrapDialog } from "@teselagen/ui";
|
|
2
|
-
|
|
3
|
-
import { Button, Callout, Card } from "@blueprintjs/core";
|
|
4
|
-
|
|
5
|
-
import { hideDialog } from "../GlobalDialogUtils";
|
|
6
|
-
import SimpleCircularOrLinearView from "../SimpleCircularOrLinearView";
|
|
7
|
-
import React, { useState } from "react";
|
|
8
|
-
import { tidyUpSequenceData } from "@teselagen/sequence-utils";
|
|
9
|
-
|
|
10
|
-
export const MultipleSeqsDetectedOnImportDialog = wrapDialog({
|
|
11
|
-
title: "Multiple Sequences Detected"
|
|
12
|
-
// style: { height: 600, width: 800 }
|
|
13
|
-
})(({ results, finishDisplayingSeq }) => {
|
|
14
|
-
const [_selectedSeqData, setSelectedSeqData] = useState(
|
|
15
|
-
results[0].parsedSequence
|
|
16
|
-
);
|
|
17
|
-
const selectedSeqData = tidyUpSequenceData(_selectedSeqData);
|
|
18
|
-
return (
|
|
19
|
-
<div>
|
|
20
|
-
<div className="bp3-dialog-body">
|
|
21
|
-
<Callout intent="primary">
|
|
22
|
-
Multiple sequences were detected in the input file. Please choose one
|
|
23
|
-
to continue
|
|
24
|
-
</Callout>
|
|
25
|
-
<br></br>
|
|
26
|
-
<div style={{ display: "flex" }}>
|
|
27
|
-
<div style={{ maxHeight: 300, overflowY: "auto" }}>
|
|
28
|
-
{results.map((res, i) => {
|
|
29
|
-
const { parsedSequence } = res;
|
|
30
|
-
if (!parsedSequence) return null;
|
|
31
|
-
const { name } = parsedSequence;
|
|
32
|
-
return (
|
|
33
|
-
<div key={i}>
|
|
34
|
-
<Button
|
|
35
|
-
active={parsedSequence === selectedSeqData}
|
|
36
|
-
onClick={() => {
|
|
37
|
-
setSelectedSeqData(parsedSequence);
|
|
38
|
-
}}
|
|
39
|
-
minimal
|
|
40
|
-
>
|
|
41
|
-
{name}
|
|
42
|
-
</Button>
|
|
43
|
-
</div>
|
|
44
|
-
);
|
|
45
|
-
})}
|
|
46
|
-
</div>
|
|
47
|
-
|
|
48
|
-
<Card elevation={1}>
|
|
49
|
-
<SimpleCircularOrLinearView
|
|
50
|
-
sequenceData={selectedSeqData || { sequence: "" }}
|
|
51
|
-
// tabHeight={tabHeight}
|
|
52
|
-
editorName="previewEditor"
|
|
53
|
-
height={null}
|
|
54
|
-
isProtein={selectedSeqData && selectedSeqData.isProtein}
|
|
55
|
-
annotationLabelVisibility={{
|
|
56
|
-
features: true,
|
|
57
|
-
parts: true,
|
|
58
|
-
cutsites: false,
|
|
59
|
-
primers: true
|
|
60
|
-
}}
|
|
61
|
-
></SimpleCircularOrLinearView>
|
|
62
|
-
</Card>
|
|
63
|
-
</div>
|
|
64
|
-
</div>
|
|
65
|
-
<DialogFooter
|
|
66
|
-
text="Select"
|
|
67
|
-
onClick={() => {
|
|
68
|
-
finishDisplayingSeq(selectedSeqData);
|
|
69
|
-
hideDialog();
|
|
70
|
-
}}
|
|
71
|
-
></DialogFooter>
|
|
72
|
-
</div>
|
|
73
|
-
);
|
|
74
|
-
});
|
package/Orf.js
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import getAnnotationNameAndStartStopString from "../utils/getAnnotationNameAndStartStopString";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import orfFrameToColorMap from "../constants/orfFrameToColorMap";
|
|
4
|
-
|
|
5
|
-
function Orf(props) {
|
|
6
|
-
const {
|
|
7
|
-
height,
|
|
8
|
-
rangeType,
|
|
9
|
-
normalizedInternalStartCodonIndices = [],
|
|
10
|
-
forward,
|
|
11
|
-
frame = 0,
|
|
12
|
-
annotation,
|
|
13
|
-
width,
|
|
14
|
-
onClick,
|
|
15
|
-
isProtein,
|
|
16
|
-
onRightClick,
|
|
17
|
-
charWidth,
|
|
18
|
-
readOnly,
|
|
19
|
-
gapsInside,
|
|
20
|
-
gapsBefore
|
|
21
|
-
} = props;
|
|
22
|
-
const heightToUse = height / 1.5;
|
|
23
|
-
const color = orfFrameToColorMap[frame];
|
|
24
|
-
let arrow = null;
|
|
25
|
-
let endCircle = null;
|
|
26
|
-
const circle = (
|
|
27
|
-
<circle
|
|
28
|
-
key="circle"
|
|
29
|
-
r={heightToUse / 2}
|
|
30
|
-
cx={heightToUse / 2}
|
|
31
|
-
cy={heightToUse / 2}
|
|
32
|
-
/>
|
|
33
|
-
);
|
|
34
|
-
if (rangeType === "end" || rangeType === "beginningAndEnd") {
|
|
35
|
-
arrow = (
|
|
36
|
-
<path
|
|
37
|
-
transform={`translate(${
|
|
38
|
-
width + gapsInside - Math.max(charWidth, 5)
|
|
39
|
-
},0) scale(${Math.max(charWidth, 8) / 64},${heightToUse / 64})`}
|
|
40
|
-
d={
|
|
41
|
-
rangeType === "start"
|
|
42
|
-
? "M0 16 L0 48 L16 64 L48 64 L64 48 L64 16 L48 0 L16 0 Z"
|
|
43
|
-
: "M0 64 L64 32 L0 0 Z"
|
|
44
|
-
}
|
|
45
|
-
/>
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
if (rangeType === "start" || rangeType === "beginningAndEnd") {
|
|
49
|
-
endCircle = circle;
|
|
50
|
-
}
|
|
51
|
-
const internalStartCodonCircles = normalizedInternalStartCodonIndices.map(
|
|
52
|
-
function (internalStartCodon, index) {
|
|
53
|
-
return React.cloneElement(circle, {
|
|
54
|
-
key: index,
|
|
55
|
-
transform: `translate(${charWidth * internalStartCodon},0)`
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
);
|
|
59
|
-
return (
|
|
60
|
-
<g
|
|
61
|
-
onClick={function (event) {
|
|
62
|
-
onClick({ annotation, event, gapsInside, gapsBefore });
|
|
63
|
-
}}
|
|
64
|
-
onContextMenu={function (event) {
|
|
65
|
-
onRightClick({ annotation, event, gapsInside, gapsBefore });
|
|
66
|
-
}}
|
|
67
|
-
className={`veRowViewOrf clickable frame${frame}`}
|
|
68
|
-
strokeWidth="1"
|
|
69
|
-
stroke={color}
|
|
70
|
-
fillOpacity={1}
|
|
71
|
-
fill={color}
|
|
72
|
-
transform={
|
|
73
|
-
forward ? null : `translate(${width + gapsInside},0) scale(-1,1)`
|
|
74
|
-
}
|
|
75
|
-
>
|
|
76
|
-
<path
|
|
77
|
-
transform={
|
|
78
|
-
(rangeType === "start" ? `translate(${charWidth},0)` : "") +
|
|
79
|
-
`scale(${
|
|
80
|
-
(width + gapsInside - (rangeType === "middle" ? 0 : charWidth)) / 64
|
|
81
|
-
},${heightToUse / 64})`
|
|
82
|
-
}
|
|
83
|
-
d="M0 40 L64 40 L64 20 L0 20 Z"
|
|
84
|
-
/>
|
|
85
|
-
{arrow}
|
|
86
|
-
{endCircle}
|
|
87
|
-
{internalStartCodonCircles}
|
|
88
|
-
<title>
|
|
89
|
-
{" "}
|
|
90
|
-
{getAnnotationNameAndStartStopString(annotation, {
|
|
91
|
-
startText: "Open Reading Frame:",
|
|
92
|
-
isProtein,
|
|
93
|
-
readOnly
|
|
94
|
-
})}{" "}
|
|
95
|
-
</title>
|
|
96
|
-
</g>
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// Orf.propTypes = {
|
|
101
|
-
// width: PropTypes.number.isRequired,
|
|
102
|
-
// charWidth: PropTypes.number.isRequired,
|
|
103
|
-
// frame: PropTypes.number.isRequired,
|
|
104
|
-
// height: PropTypes.number.isRequired,
|
|
105
|
-
// rangeType: PropTypes.string.isRequired,
|
|
106
|
-
// forward: PropTypes.bool.isRequired
|
|
107
|
-
// };
|
|
108
|
-
|
|
109
|
-
export default Orf;
|
package/OrfProperties.js
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
DataTable,
|
|
4
|
-
withSelectedEntities,
|
|
5
|
-
createCommandMenu
|
|
6
|
-
} from "@teselagen/ui";
|
|
7
|
-
import { map } from "lodash-es";
|
|
8
|
-
// import { Button } from "@blueprintjs/core";
|
|
9
|
-
import { getRangeLength } from "@teselagen/range-utils";
|
|
10
|
-
import { getOrfColor } from "../../constants/orfFrameToColorMap";
|
|
11
|
-
import { connectToEditor } from "../../withEditorProps";
|
|
12
|
-
import { compose } from "recompose";
|
|
13
|
-
import selectors from "../../selectors";
|
|
14
|
-
|
|
15
|
-
import getCommands from "../../commands";
|
|
16
|
-
import { sizeSchema } from "./utils";
|
|
17
|
-
import { orfsSubmenu } from "../../MenuBar/viewSubmenu";
|
|
18
|
-
import { getVisFilter } from "./GenericAnnotationProperties";
|
|
19
|
-
|
|
20
|
-
class OrfProperties extends React.Component {
|
|
21
|
-
constructor(props) {
|
|
22
|
-
super(props);
|
|
23
|
-
this.commands = getCommands(this);
|
|
24
|
-
}
|
|
25
|
-
onRowSelect = ([record]) => {
|
|
26
|
-
if (!record) return;
|
|
27
|
-
const { dispatch, editorName } = this.props;
|
|
28
|
-
dispatch({
|
|
29
|
-
type: "SELECTION_LAYER_UPDATE",
|
|
30
|
-
payload: record,
|
|
31
|
-
meta: {
|
|
32
|
-
editorName
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
render() {
|
|
37
|
-
const { orfs, sequenceLength, annotationVisibility } = this.props;
|
|
38
|
-
const orfsToUse = map(orfs, orf => {
|
|
39
|
-
return {
|
|
40
|
-
...orf,
|
|
41
|
-
color: getOrfColor(orf),
|
|
42
|
-
frame: orf.frame + 1,
|
|
43
|
-
...(orf.strand === undefined && {
|
|
44
|
-
strand: orf.forward ? 1 : -1
|
|
45
|
-
}),
|
|
46
|
-
size: getRangeLength(orf, sequenceLength),
|
|
47
|
-
sizeAa: Math.floor(getRangeLength(orf, sequenceLength) / 3 - 1)
|
|
48
|
-
};
|
|
49
|
-
});
|
|
50
|
-
return (
|
|
51
|
-
<React.Fragment>
|
|
52
|
-
<DataTable
|
|
53
|
-
topLeftItems={getVisFilter(
|
|
54
|
-
createCommandMenu(orfsSubmenu, this.commands, {
|
|
55
|
-
useTicks: true
|
|
56
|
-
})
|
|
57
|
-
)}
|
|
58
|
-
annotationVisibility={annotationVisibility} //we need to pass this in order to force the DT to rerender
|
|
59
|
-
noPadding
|
|
60
|
-
noFullscreenButton
|
|
61
|
-
onRowSelect={this.onRowSelect}
|
|
62
|
-
withSearch={false}
|
|
63
|
-
formName="orfProperties"
|
|
64
|
-
noRouter
|
|
65
|
-
compact
|
|
66
|
-
isInfinite
|
|
67
|
-
schema={{
|
|
68
|
-
fields: [
|
|
69
|
-
{
|
|
70
|
-
path: "color",
|
|
71
|
-
type: "string",
|
|
72
|
-
render: color => {
|
|
73
|
-
return (
|
|
74
|
-
<div style={{ height: 20, width: 20, background: color }} />
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
path: "sizeAa",
|
|
80
|
-
displayName: "Size (aa)",
|
|
81
|
-
type: "number"
|
|
82
|
-
},
|
|
83
|
-
sizeSchema(this.props.isProtein),
|
|
84
|
-
{ path: "frame", type: "number" },
|
|
85
|
-
{ path: "strand", type: "number" }
|
|
86
|
-
]
|
|
87
|
-
}}
|
|
88
|
-
entities={orfsToUse}
|
|
89
|
-
/>
|
|
90
|
-
<br />
|
|
91
|
-
</React.Fragment>
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export default compose(
|
|
97
|
-
connectToEditor(editorState => {
|
|
98
|
-
const {
|
|
99
|
-
readOnly,
|
|
100
|
-
annotationVisibility = {},
|
|
101
|
-
sequenceData: { sequence = "" } = {},
|
|
102
|
-
sequenceData,
|
|
103
|
-
minimumOrfSize,
|
|
104
|
-
useAdditionalOrfStartCodons
|
|
105
|
-
} = editorState;
|
|
106
|
-
return {
|
|
107
|
-
readOnly,
|
|
108
|
-
annotationVisibility,
|
|
109
|
-
useAdditionalOrfStartCodons,
|
|
110
|
-
orfs: selectors.orfsSelector(editorState),
|
|
111
|
-
sequenceLength: sequence.length,
|
|
112
|
-
sequenceData,
|
|
113
|
-
minimumOrfSize
|
|
114
|
-
};
|
|
115
|
-
}),
|
|
116
|
-
withSelectedEntities("orfProperties")
|
|
117
|
-
)(OrfProperties);
|
package/Orfs.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import Orf from "./Orf";
|
|
3
|
-
import StackedAnnotations from "./StackedAnnotations";
|
|
4
|
-
|
|
5
|
-
function getExtraInnerCompProps(annotationRange, props) {
|
|
6
|
-
const { row } = props;
|
|
7
|
-
const { annotation, start, end } = annotationRange;
|
|
8
|
-
const { frame, internalStartCodonIndices = [] } = annotation;
|
|
9
|
-
const normalizedInternalStartCodonIndices = internalStartCodonIndices
|
|
10
|
-
.filter(function (position) {
|
|
11
|
-
if (
|
|
12
|
-
position >= row.start &&
|
|
13
|
-
position >= start &&
|
|
14
|
-
position <= end &&
|
|
15
|
-
position <= row.end
|
|
16
|
-
) {
|
|
17
|
-
return true;
|
|
18
|
-
} else return false;
|
|
19
|
-
})
|
|
20
|
-
.map(function (position) {
|
|
21
|
-
return position - start;
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
return { normalizedInternalStartCodonIndices, frame };
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function Orfs(props) {
|
|
28
|
-
return (
|
|
29
|
-
<StackedAnnotations
|
|
30
|
-
{...{ ...props, getExtraInnerCompProps, InnerComp: Orf }}
|
|
31
|
-
/>
|
|
32
|
-
);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export default Orfs;
|
package/PCRTool.js
DELETED
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import { compose } from "recompose";
|
|
2
|
-
import React from "react";
|
|
3
|
-
|
|
4
|
-
import withEditorInteractions from "../withEditorInteractions";
|
|
5
|
-
import { ReactSelectField, tgFormValues } from "@teselagen/ui";
|
|
6
|
-
import { reduxForm } from "redux-form";
|
|
7
|
-
import { flatMap, forEach, keyBy } from "lodash-es";
|
|
8
|
-
import SimpleCircularOrLinearView from "../SimpleCircularOrLinearView";
|
|
9
|
-
import {
|
|
10
|
-
getReverseComplementSequenceString,
|
|
11
|
-
getSequenceDataBetweenRange,
|
|
12
|
-
tidyUpSequenceData,
|
|
13
|
-
shiftAnnotationsByLen
|
|
14
|
-
} from "@teselagen/sequence-utils";
|
|
15
|
-
import { getRangeLength, getSequenceWithinRange } from "@teselagen/range-utils";
|
|
16
|
-
|
|
17
|
-
function PCRTool(props) {
|
|
18
|
-
const {
|
|
19
|
-
sequenceData,
|
|
20
|
-
dimensions: { width, height },
|
|
21
|
-
forwardPrimer,
|
|
22
|
-
reversePrimer,
|
|
23
|
-
primerClicked
|
|
24
|
-
} = props;
|
|
25
|
-
const origSeqLen = sequenceData.sequence.length;
|
|
26
|
-
forEach(sequenceData.primers, p => (p.originalId = p.id));
|
|
27
|
-
const fPrimer = sequenceData.primers[forwardPrimer];
|
|
28
|
-
const rPrimer = sequenceData.primers[reversePrimer];
|
|
29
|
-
let seqBetween;
|
|
30
|
-
if (fPrimer && rPrimer) {
|
|
31
|
-
const r = {
|
|
32
|
-
start: fPrimer.start,
|
|
33
|
-
end: rPrimer.end
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const newSeqData = getSequenceDataBetweenRange(sequenceData, r);
|
|
37
|
-
|
|
38
|
-
if (rPrimer.bases) {
|
|
39
|
-
// remove rPrimer length from end of seq
|
|
40
|
-
const rPrimerLen = getRangeLength(rPrimer, origSeqLen);
|
|
41
|
-
|
|
42
|
-
newSeqData.sequence = getSequenceWithinRange(
|
|
43
|
-
{ start: 0, end: newSeqData.sequence.length - rPrimerLen - 1 },
|
|
44
|
-
newSeqData.sequence
|
|
45
|
-
);
|
|
46
|
-
// tack back in the rPrimer.bases
|
|
47
|
-
newSeqData.sequence =
|
|
48
|
-
newSeqData.sequence + getReverseComplementSequenceString(rPrimer.bases);
|
|
49
|
-
const newRPrimer = keyBy(newSeqData.primers, "id")[reversePrimer];
|
|
50
|
-
|
|
51
|
-
newRPrimer.end = newSeqData.sequence.length - 1;
|
|
52
|
-
}
|
|
53
|
-
if (fPrimer.bases) {
|
|
54
|
-
const fPrimerLength = getRangeLength(fPrimer, origSeqLen);
|
|
55
|
-
const newSeqLen1 = newSeqData.sequence.length;
|
|
56
|
-
// remove fPrimer length from start of seq
|
|
57
|
-
newSeqData.sequence = getSequenceWithinRange(
|
|
58
|
-
{ start: fPrimerLength, end: newSeqData.sequence.length },
|
|
59
|
-
newSeqData.sequence
|
|
60
|
-
);
|
|
61
|
-
// add back in the fPrimer.bases
|
|
62
|
-
newSeqData.sequence = fPrimer.bases + newSeqData.sequence;
|
|
63
|
-
// shift the existing annotations by the difference in seqLen before and after that operation
|
|
64
|
-
const newSeqLen2 = newSeqData.sequence.length;
|
|
65
|
-
const diff = newSeqLen2 - newSeqLen1;
|
|
66
|
-
shiftAnnotationsByLen({
|
|
67
|
-
seqData: newSeqData,
|
|
68
|
-
insertLength: diff,
|
|
69
|
-
caretPosition: 0
|
|
70
|
-
});
|
|
71
|
-
const newFPrimer = keyBy(newSeqData.primers, "id")[forwardPrimer];
|
|
72
|
-
newFPrimer.start = 0;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
seqBetween = tidyUpSequenceData(newSeqData, {
|
|
76
|
-
provideNewIdsForAnnotations: true
|
|
77
|
-
});
|
|
78
|
-
seqBetween.name = `PCR Product from ${sequenceData.name} `;
|
|
79
|
-
}
|
|
80
|
-
const getPrimers = opts => {
|
|
81
|
-
return flatMap(
|
|
82
|
-
sequenceData.primers,
|
|
83
|
-
({ name, id, forward, start, end }) => {
|
|
84
|
-
if (opts.forward && !forward) return [];
|
|
85
|
-
if (!opts.forward && forward) return [];
|
|
86
|
-
return {
|
|
87
|
-
label: (
|
|
88
|
-
<div
|
|
89
|
-
style={{
|
|
90
|
-
width: "100%",
|
|
91
|
-
display: "flex",
|
|
92
|
-
alignItems: "center",
|
|
93
|
-
justifyContent: "space-between"
|
|
94
|
-
}}
|
|
95
|
-
>
|
|
96
|
-
<div>{name}</div>
|
|
97
|
-
<div
|
|
98
|
-
style={{
|
|
99
|
-
marginLeft: 8,
|
|
100
|
-
fontStyle: "italic",
|
|
101
|
-
color: "grey",
|
|
102
|
-
fontSize: 11
|
|
103
|
-
}}
|
|
104
|
-
>
|
|
105
|
-
({start + 1} - {end + 1})
|
|
106
|
-
</div>
|
|
107
|
-
</div>
|
|
108
|
-
),
|
|
109
|
-
value: id
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
);
|
|
113
|
-
};
|
|
114
|
-
const forwardPrimers = getPrimers({ forward: true });
|
|
115
|
-
const reversePrimers = getPrimers({ forward: false });
|
|
116
|
-
return (
|
|
117
|
-
<div
|
|
118
|
-
className="createPcrTool"
|
|
119
|
-
style={{ padding: 10, overflowY: "auto", height }}
|
|
120
|
-
>
|
|
121
|
-
<ReactSelectField
|
|
122
|
-
noResultsText="Create a new primer in the forward direction to use it in this tool"
|
|
123
|
-
inlineLabel
|
|
124
|
-
tooltipError
|
|
125
|
-
options={forwardPrimers}
|
|
126
|
-
defaultValue={
|
|
127
|
-
forwardPrimer ??
|
|
128
|
-
(forwardPrimers[0] ? forwardPrimers[0].value : undefined)
|
|
129
|
-
}
|
|
130
|
-
name="forwardPrimer"
|
|
131
|
-
label="Forward Primer:"
|
|
132
|
-
/>
|
|
133
|
-
<ReactSelectField
|
|
134
|
-
noResultsText="Create a new primer in the reverse direction to use it in this tool"
|
|
135
|
-
inlineLabel
|
|
136
|
-
tooltipError
|
|
137
|
-
options={reversePrimers}
|
|
138
|
-
defaultValue={
|
|
139
|
-
reversePrimer ??
|
|
140
|
-
(reversePrimers[0] ? reversePrimers[0].value : undefined)
|
|
141
|
-
}
|
|
142
|
-
name="reversePrimer"
|
|
143
|
-
label="Reverse Primer:"
|
|
144
|
-
/>
|
|
145
|
-
<div style={{ fontWeight: "600", fontSize: 13 }}>Output Product:</div>
|
|
146
|
-
{seqBetween ? (
|
|
147
|
-
<SimpleCircularOrLinearView
|
|
148
|
-
noWarnings
|
|
149
|
-
withZoomLinearView
|
|
150
|
-
withZoomCircularView
|
|
151
|
-
withChoosePreviewType
|
|
152
|
-
withDownload
|
|
153
|
-
smallSlider
|
|
154
|
-
withCaretEnabled
|
|
155
|
-
width={width - 50}
|
|
156
|
-
height={Math.max(height - 250, 400)}
|
|
157
|
-
sequenceData={seqBetween}
|
|
158
|
-
primerClicked={args => {
|
|
159
|
-
primerClicked({
|
|
160
|
-
...args,
|
|
161
|
-
annotation: sequenceData.primers[args.annotation.originalId]
|
|
162
|
-
});
|
|
163
|
-
}}
|
|
164
|
-
></SimpleCircularOrLinearView>
|
|
165
|
-
) : (
|
|
166
|
-
<div style={{ marginTop: 5, fontStyle: "italic", color: "grey" }}>
|
|
167
|
-
Please choose a forward and reverse primer to see the resulting PCR
|
|
168
|
-
sequence
|
|
169
|
-
</div>
|
|
170
|
-
)}
|
|
171
|
-
</div>
|
|
172
|
-
);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
export default compose(
|
|
176
|
-
withEditorInteractions,
|
|
177
|
-
reduxForm({ form: "PCRTool" }),
|
|
178
|
-
tgFormValues("forwardPrimer", "reversePrimer")
|
|
179
|
-
)(PCRTool);
|
package/PairwiseAlignmentView.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { getPairwiseOverviewLinearViewOptions } from "./getPairwiseOverviewLinearViewOptions";
|
|
3
|
-
import { AlignmentView } from "./index";
|
|
4
|
-
|
|
5
|
-
//this view is shown if we detect pairwise alignments
|
|
6
|
-
export class PairwiseAlignmentView extends React.Component {
|
|
7
|
-
state = {
|
|
8
|
-
currentPairwiseAlignmentIndex: undefined
|
|
9
|
-
};
|
|
10
|
-
render() {
|
|
11
|
-
const { pairwiseAlignments, pairwiseOverviewAlignmentTracks } = this.props;
|
|
12
|
-
const { currentPairwiseAlignmentIndex } = this.state;
|
|
13
|
-
if (currentPairwiseAlignmentIndex > -1) {
|
|
14
|
-
//we can render the AlignmentView directly
|
|
15
|
-
//get the alignmentTracks based on currentPairwiseAlignmentIndex
|
|
16
|
-
const alignmentTracks = pairwiseAlignments[currentPairwiseAlignmentIndex];
|
|
17
|
-
|
|
18
|
-
const templateLength = alignmentTracks[0].alignmentData.sequence.length;
|
|
19
|
-
return (
|
|
20
|
-
<AlignmentView
|
|
21
|
-
{...{
|
|
22
|
-
...this.props,
|
|
23
|
-
sequenceData: {
|
|
24
|
-
//pass fake seq data in so editor interactions work
|
|
25
|
-
sequence: Array.from(templateLength)
|
|
26
|
-
.map(() => "a")
|
|
27
|
-
.join("")
|
|
28
|
-
},
|
|
29
|
-
allowTrackRearrange: false,
|
|
30
|
-
alignmentTracks,
|
|
31
|
-
hasTemplate: true,
|
|
32
|
-
isPairwise: true,
|
|
33
|
-
currentPairwiseAlignmentIndex,
|
|
34
|
-
handleBackButtonClicked: () => {
|
|
35
|
-
this.setState({
|
|
36
|
-
currentPairwiseAlignmentIndex: undefined
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}}
|
|
40
|
-
/>
|
|
41
|
-
);
|
|
42
|
-
} else {
|
|
43
|
-
//we haven't yet selected an alignment to view
|
|
44
|
-
// render the AlignmentView zoomed out for each track in pairwiseOverviewAlignmentTracks
|
|
45
|
-
// when the view eye icon is hit (maybe next to the name?)
|
|
46
|
-
return (
|
|
47
|
-
<AlignmentView
|
|
48
|
-
{...{
|
|
49
|
-
...this.props,
|
|
50
|
-
alignmentTracks: pairwiseOverviewAlignmentTracks,
|
|
51
|
-
allowTrackRearrange: false,
|
|
52
|
-
allowTrimming: false,
|
|
53
|
-
hasTemplate: true,
|
|
54
|
-
isPairwise: true,
|
|
55
|
-
isInPairwiseOverviewView: true,
|
|
56
|
-
isFullyZoomedOut: true,
|
|
57
|
-
noClickDragHandlers: true,
|
|
58
|
-
linearViewOptions: getPairwiseOverviewLinearViewOptions,
|
|
59
|
-
handleSelectTrack: trackIndex => {
|
|
60
|
-
//set currentPairwiseAlignmentIndex
|
|
61
|
-
this.setState({ currentPairwiseAlignmentIndex: trackIndex - 1 });
|
|
62
|
-
}
|
|
63
|
-
}}
|
|
64
|
-
/>
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
package/Part.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { startsWith } from "lodash-es";
|
|
3
|
-
import drawDirectedPiePiece from "./drawDirectedPiePiece";
|
|
4
|
-
|
|
5
|
-
export default function Part({
|
|
6
|
-
radius,
|
|
7
|
-
arrowheadLength = 0.5,
|
|
8
|
-
annotationHeight,
|
|
9
|
-
totalAngle,
|
|
10
|
-
color,
|
|
11
|
-
overlapsSelf,
|
|
12
|
-
className
|
|
13
|
-
}) {
|
|
14
|
-
const path = drawDirectedPiePiece({
|
|
15
|
-
radius,
|
|
16
|
-
overlapsSelf,
|
|
17
|
-
annotationHeight,
|
|
18
|
-
totalAngle,
|
|
19
|
-
arrowheadLength,
|
|
20
|
-
tailThickness: 1 //feature specific
|
|
21
|
-
});
|
|
22
|
-
const colorToUse = startsWith(color, "override_")
|
|
23
|
-
? color.replace("override_", "")
|
|
24
|
-
: "#ac68cc";
|
|
25
|
-
return (
|
|
26
|
-
<path
|
|
27
|
-
className={className}
|
|
28
|
-
strokeWidth="0.5"
|
|
29
|
-
stroke={colorToUse}
|
|
30
|
-
// fill={colorToUse}
|
|
31
|
-
d={path.print()}
|
|
32
|
-
/>
|
|
33
|
-
);
|
|
34
|
-
}
|
package/PartProperties.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { partsSubmenu } from "../../MenuBar/viewSubmenu";
|
|
2
|
-
import genericAnnotationProperties from "./GenericAnnotationProperties";
|
|
3
|
-
export default genericAnnotationProperties({
|
|
4
|
-
annotationType: "part",
|
|
5
|
-
noColor: true,
|
|
6
|
-
visSubmenu: partsSubmenu,
|
|
7
|
-
withTags: true,
|
|
8
|
-
noType: true
|
|
9
|
-
});
|
package/PassThrough.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import SelectionLayer from "../RowItem/SelectionLayer";
|
|
3
|
-
import { view } from "@risingstack/react-easy-state";
|
|
4
|
-
|
|
5
|
-
export const PerformantSelectionLayer = view(({ easyStore, ...rest }) => {
|
|
6
|
-
const seqLen = rest.sequenceLength - 1;
|
|
7
|
-
|
|
8
|
-
return (
|
|
9
|
-
<SelectionLayer
|
|
10
|
-
regions={[
|
|
11
|
-
{ ...easyStore.selectionLayer, ignoreGaps: true },
|
|
12
|
-
{
|
|
13
|
-
start: Math.floor(
|
|
14
|
-
(easyStore.percentScrolledPreZoom || easyStore.percentScrolled) *
|
|
15
|
-
seqLen
|
|
16
|
-
),
|
|
17
|
-
end: Math.floor(
|
|
18
|
-
(easyStore.percentScrolledPreZoom || easyStore.percentScrolled) *
|
|
19
|
-
seqLen
|
|
20
|
-
),
|
|
21
|
-
className: "zoomSelection",
|
|
22
|
-
ignoreGaps: true,
|
|
23
|
-
style: {
|
|
24
|
-
zIndex: -1,
|
|
25
|
-
opacity: 0
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
]}
|
|
29
|
-
{...rest}
|
|
30
|
-
/>
|
|
31
|
-
);
|
|
32
|
-
});
|
package/PinchHelper.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { usePinch } from "@use-gesture/react";
|
|
2
|
-
import React from "react";
|
|
3
|
-
/**
|
|
4
|
-
* wrapper for the react usePinch gesture
|
|
5
|
-
* @param {*} children child components to be enveloped
|
|
6
|
-
* @param {*} onPinch the action to be performed when pinch gesture is registered
|
|
7
|
-
*/
|
|
8
|
-
export default function PinchHelper({ children, onPinch }) {
|
|
9
|
-
const target = React.useRef();
|
|
10
|
-
|
|
11
|
-
usePinch(
|
|
12
|
-
arg => {
|
|
13
|
-
if (onPinch) onPinch(arg);
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
target
|
|
17
|
-
}
|
|
18
|
-
);
|
|
19
|
-
return (
|
|
20
|
-
<div ref={target} className="tg-pinch-helper">
|
|
21
|
-
{children}
|
|
22
|
-
</div>
|
|
23
|
-
);
|
|
24
|
-
}
|