@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.
- package/index.cjs.js +1055 -996
- package/index.es.js +1055 -996
- package/index.umd.js +189036 -0
- package/ove.css +1 -1
- package/package.json +2 -6
- package/src/helperComponents/PropertiesDialog/TranslationProperties.js +1 -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/style.css +0 -10
- 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
package/alignments.js
DELETED
|
@@ -1,379 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
tidyUpSequenceData /* generateSequenceData */,
|
|
3
|
-
condensePairwiseAlignmentDifferences
|
|
4
|
-
} from "@teselagen/sequence-utils";
|
|
5
|
-
import { convertBasePosTraceToPerBpTrace } from "@teselagen/bio-parsers";
|
|
6
|
-
import shortid from "shortid";
|
|
7
|
-
|
|
8
|
-
import addDashesForMatchStartAndEndForTracks from "./utils/addDashesForMatchStartAndEndForTracks";
|
|
9
|
-
|
|
10
|
-
import { /* createReducer, */ createAction } from "redux-act";
|
|
11
|
-
import { omit } from "lodash-es";
|
|
12
|
-
|
|
13
|
-
const alignmentAnnotationSettings = {
|
|
14
|
-
axis: true,
|
|
15
|
-
axisNumbers: true,
|
|
16
|
-
chromatogram: false,
|
|
17
|
-
dnaColors: false,
|
|
18
|
-
features: false,
|
|
19
|
-
parts: false,
|
|
20
|
-
reverseSequence: false,
|
|
21
|
-
sequence: true,
|
|
22
|
-
translations: true,
|
|
23
|
-
orfs: false,
|
|
24
|
-
orfTranslations: false,
|
|
25
|
-
cdsFeatureTranslations: false,
|
|
26
|
-
cutsites: false,
|
|
27
|
-
primers: false,
|
|
28
|
-
compactNames: false
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const defaultVisibilities = {
|
|
32
|
-
alignmentAnnotationVisibility: alignmentAnnotationSettings,
|
|
33
|
-
pairwise_alignmentAnnotationVisibility: alignmentAnnotationSettings,
|
|
34
|
-
alignmentAnnotationLabelVisibility: {
|
|
35
|
-
features: false,
|
|
36
|
-
parts: false,
|
|
37
|
-
cutsites: false
|
|
38
|
-
},
|
|
39
|
-
pairwise_alignmentAnnotationLabelVisibility: {
|
|
40
|
-
features: false,
|
|
41
|
-
parts: false,
|
|
42
|
-
cutsites: false
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
const defaultVisibilityTypes = Object.keys(defaultVisibilities);
|
|
46
|
-
|
|
47
|
-
try {
|
|
48
|
-
defaultVisibilityTypes.forEach(type => {
|
|
49
|
-
const newVal = JSON.parse(window.localStorage.getItem(type));
|
|
50
|
-
if (newVal)
|
|
51
|
-
defaultVisibilities[type] = {
|
|
52
|
-
...defaultVisibilities[type],
|
|
53
|
-
...newVal
|
|
54
|
-
};
|
|
55
|
-
});
|
|
56
|
-
} catch (e) {
|
|
57
|
-
console.error("error setting localstorage visibility config", e);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// ------------------------------------
|
|
61
|
-
// Actions
|
|
62
|
-
// ------------------------------------
|
|
63
|
-
export const upsertAlignmentRun = createAction("UPSERT_ALIGNMENT_RUN");
|
|
64
|
-
export const removeAlignmentFromRedux = createAction(
|
|
65
|
-
"REMOVE_ALIGNMENT_FROM_REDUX"
|
|
66
|
-
);
|
|
67
|
-
export const updateAlignmentViewVisibility = createAction(
|
|
68
|
-
"UPDATE_ALIGNMENT_VIEW_VISIBILITY"
|
|
69
|
-
);
|
|
70
|
-
export const alignmentRunUpdate = createAction("ALIGNMENT_RUN_UPDATE");
|
|
71
|
-
|
|
72
|
-
const highlightRangeProps = {
|
|
73
|
-
color: "red",
|
|
74
|
-
hideCarets: true,
|
|
75
|
-
ignoreGaps: true
|
|
76
|
-
};
|
|
77
|
-
function addHighlightedDifferences(alignmentTracks) {
|
|
78
|
-
return alignmentTracks.map(track => {
|
|
79
|
-
if (track.isUnmapped) {
|
|
80
|
-
return track;
|
|
81
|
-
}
|
|
82
|
-
const sequenceData = tidyUpSequenceData(track.sequenceData, {
|
|
83
|
-
doNotRemoveInvalidChars: true
|
|
84
|
-
});
|
|
85
|
-
const matchHighlightRanges = getRangeMatchesBetweenTemplateAndNonTemplate(
|
|
86
|
-
alignmentTracks[0].alignmentData.sequence,
|
|
87
|
-
track.alignmentData.sequence
|
|
88
|
-
);
|
|
89
|
-
// .filter by the user-specified mismatch overrides (initially [])
|
|
90
|
-
const mismatches = matchHighlightRanges.filter(({ isMatch }) => !isMatch);
|
|
91
|
-
return {
|
|
92
|
-
...track,
|
|
93
|
-
sequenceData,
|
|
94
|
-
matchHighlightRanges,
|
|
95
|
-
additionalSelectionLayers: matchHighlightRanges
|
|
96
|
-
.filter(({ isMatch }) => !isMatch)
|
|
97
|
-
.map(range => {
|
|
98
|
-
return { ...range, ...highlightRangeProps };
|
|
99
|
-
}),
|
|
100
|
-
mismatches
|
|
101
|
-
};
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
// alignmentTracks = addHighlightedDifferences(alignmentTracks);
|
|
106
|
-
|
|
107
|
-
// ------------------------------------
|
|
108
|
-
// Reducer
|
|
109
|
-
// ------------------------------------
|
|
110
|
-
|
|
111
|
-
export default (state = {}, { payload = {}, type }) => {
|
|
112
|
-
if (type === "ALIGNMENT_RUN_UPDATE") {
|
|
113
|
-
const { alignmentId } = payload;
|
|
114
|
-
const newState = {
|
|
115
|
-
...state,
|
|
116
|
-
[alignmentId]: {
|
|
117
|
-
...state[alignmentId],
|
|
118
|
-
...payload
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
return newState;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
if (type === "UPDATE_ALIGNMENT_VIEW_VISIBILITY") {
|
|
125
|
-
defaultVisibilityTypes.forEach(type => {
|
|
126
|
-
if (
|
|
127
|
-
(type.startsWith("pairwise_") && payload.pairwiseAlignments) ||
|
|
128
|
-
(!type.startsWith("pairwise_") && !payload.pairwiseAlignments)
|
|
129
|
-
) {
|
|
130
|
-
defaultVisibilities[type] = {
|
|
131
|
-
...defaultVisibilities[type],
|
|
132
|
-
...payload[type.replace("pairwise_", "")]
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
localStorage.setItem(
|
|
136
|
-
type,
|
|
137
|
-
JSON.stringify({
|
|
138
|
-
...defaultVisibilities[type],
|
|
139
|
-
...payload[type.replace("pairwise_", "")]
|
|
140
|
-
})
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
return {
|
|
145
|
-
...state,
|
|
146
|
-
[payload.id]: { ...payload }
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
if (type === "UPSERT_ALIGNMENT_RUN") {
|
|
150
|
-
const { id } = payload;
|
|
151
|
-
const payloadToUse = {
|
|
152
|
-
stateTrackingId: state[id]?.stateTrackingId ? shortid() : "initialLoadId",
|
|
153
|
-
alignmentType: state[id]?.alignmentType,
|
|
154
|
-
...payload,
|
|
155
|
-
//assign default visibilities
|
|
156
|
-
...defaultVisibilityTypes.reduce((acc, type) => {
|
|
157
|
-
if (
|
|
158
|
-
(type.startsWith("pairwise_") && payload.pairwiseAlignments) ||
|
|
159
|
-
(!type.startsWith("pairwise_") && !payload.pairwiseAlignments)
|
|
160
|
-
) {
|
|
161
|
-
acc[type.replace("pairwise_", "")] = {
|
|
162
|
-
...defaultVisibilities[type],
|
|
163
|
-
...payload[type.replace("pairwise_", "")]
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
return acc;
|
|
167
|
-
}, {})
|
|
168
|
-
};
|
|
169
|
-
if (payloadToUse.pairwiseAlignments) {
|
|
170
|
-
if (
|
|
171
|
-
payloadToUse.pairwiseAlignments[0][0].alignmentData.matchStart !==
|
|
172
|
-
undefined
|
|
173
|
-
) {
|
|
174
|
-
payloadToUse.pairwiseAlignments = payloadToUse.pairwiseAlignments.map(
|
|
175
|
-
addDashesForMatchStartAndEndForTracks
|
|
176
|
-
);
|
|
177
|
-
}
|
|
178
|
-
const templateSeq = payloadToUse.pairwiseAlignments[0][0];
|
|
179
|
-
//we need to get all of the sequences in a single alignment (turning inserts into single BP red highlights)
|
|
180
|
-
const pairwiseOverviewAlignmentTracks = [
|
|
181
|
-
{
|
|
182
|
-
//add the template seq as the first track in the Pairwise Alignment Overview
|
|
183
|
-
...templateSeq,
|
|
184
|
-
sequenceData: tidyUpSequenceData(templateSeq.sequenceData, {
|
|
185
|
-
doNotRemoveInvalidChars: true
|
|
186
|
-
}),
|
|
187
|
-
alignmentData: { sequence: templateSeq.sequenceData.sequence } //remove the gaps from the template sequence
|
|
188
|
-
}
|
|
189
|
-
]; // start with just the template seq in there!
|
|
190
|
-
|
|
191
|
-
payloadToUse.pairwiseAlignments.forEach(([template, alignedSeq]) => {
|
|
192
|
-
const condensedSeq = condensePairwiseAlignmentDifferences(
|
|
193
|
-
template.alignmentData.sequence,
|
|
194
|
-
alignedSeq.alignmentData.sequence
|
|
195
|
-
);
|
|
196
|
-
let re = /r+/gi;
|
|
197
|
-
let match;
|
|
198
|
-
const additionalSelectionLayers = [];
|
|
199
|
-
while ((match = re.exec(condensedSeq)) != null) {
|
|
200
|
-
additionalSelectionLayers.push({
|
|
201
|
-
start: match.index,
|
|
202
|
-
end: match.index + match[0].length - 1,
|
|
203
|
-
...highlightRangeProps
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
re = /g+/gi;
|
|
207
|
-
// let match;
|
|
208
|
-
while ((match = re.exec(condensedSeq)) != null) {
|
|
209
|
-
additionalSelectionLayers.push({
|
|
210
|
-
start: match.index,
|
|
211
|
-
end: match.index + match[0].length - 1,
|
|
212
|
-
...highlightRangeProps,
|
|
213
|
-
color: "grey"
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
const alignedSeqMinusInserts = {
|
|
218
|
-
...alignedSeq,
|
|
219
|
-
sequenceData: {
|
|
220
|
-
...tidyUpSequenceData(alignedSeq.sequenceData, {
|
|
221
|
-
doNotRemoveInvalidChars: true
|
|
222
|
-
}),
|
|
223
|
-
sequence: template.sequenceData.sequence
|
|
224
|
-
},
|
|
225
|
-
additionalSelectionLayers,
|
|
226
|
-
alignmentData: {
|
|
227
|
-
sequence: condensedSeq
|
|
228
|
-
}
|
|
229
|
-
};
|
|
230
|
-
pairwiseOverviewAlignmentTracks.push(alignedSeqMinusInserts);
|
|
231
|
-
});
|
|
232
|
-
payloadToUse.pairwiseOverviewAlignmentTracks =
|
|
233
|
-
pairwiseOverviewAlignmentTracks;
|
|
234
|
-
payloadToUse.pairwiseAlignments = payloadToUse.pairwiseAlignments.map(
|
|
235
|
-
addHighlightedDifferences
|
|
236
|
-
);
|
|
237
|
-
}
|
|
238
|
-
if (payloadToUse.alignmentTracks) {
|
|
239
|
-
payloadToUse.alignmentTracks = addHighlightedDifferences(
|
|
240
|
-
payloadToUse.alignmentTracks
|
|
241
|
-
);
|
|
242
|
-
}
|
|
243
|
-
//check for issues
|
|
244
|
-
let hasError = checkForIssues(
|
|
245
|
-
payloadToUse.alignmentTracks,
|
|
246
|
-
payload.alignmentType
|
|
247
|
-
);
|
|
248
|
-
(payloadToUse.pairwiseAlignments || []).forEach(alignment => {
|
|
249
|
-
const error = alignment;
|
|
250
|
-
if (error) {
|
|
251
|
-
hasError = error;
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
return {
|
|
255
|
-
...state,
|
|
256
|
-
[payload.id]: {
|
|
257
|
-
...payloadToUse,
|
|
258
|
-
hasError
|
|
259
|
-
}
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
if (type === "REMOVE_ALIGNMENT_FROM_REDUX") {
|
|
263
|
-
const { id } = payload;
|
|
264
|
-
state = omit(state, [id]);
|
|
265
|
-
}
|
|
266
|
-
return state;
|
|
267
|
-
};
|
|
268
|
-
|
|
269
|
-
//returns an array like so: [{start: 0, end: 4, isMatch: false}, {start,end,isMatch} ... etc]
|
|
270
|
-
function getRangeMatchesBetweenTemplateAndNonTemplate(tempSeq, nonTempSeq) {
|
|
271
|
-
//assume all sequences are the same length (with gap characters "-" in some places)
|
|
272
|
-
//loop through all non template sequences and compare them with the template
|
|
273
|
-
|
|
274
|
-
const seqLength = nonTempSeq.length;
|
|
275
|
-
const ranges = [];
|
|
276
|
-
// const startIndex = "".match/[-]/ Math.max(0, .indexOf("-"));
|
|
277
|
-
const nonTempSeqWithoutLeadingDashes = nonTempSeq.replace(/^-+/g, "");
|
|
278
|
-
const nonTempSeqWithoutTrailingDashes = nonTempSeq.replace(/-+$/g, "");
|
|
279
|
-
|
|
280
|
-
const startIndex = seqLength - nonTempSeqWithoutLeadingDashes.length;
|
|
281
|
-
const endIndex =
|
|
282
|
-
seqLength - (seqLength - nonTempSeqWithoutTrailingDashes.length);
|
|
283
|
-
for (let index = startIndex; index < endIndex; index++) {
|
|
284
|
-
const isMatch =
|
|
285
|
-
tempSeq[index].toLowerCase() === nonTempSeq[index].toLowerCase();
|
|
286
|
-
const previousRange = ranges[ranges.length - 1];
|
|
287
|
-
if (previousRange) {
|
|
288
|
-
if (previousRange.isMatch === isMatch) {
|
|
289
|
-
previousRange.end++;
|
|
290
|
-
} else {
|
|
291
|
-
ranges.push({
|
|
292
|
-
start: index,
|
|
293
|
-
end: index,
|
|
294
|
-
isMatch
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
} else {
|
|
298
|
-
ranges.push({
|
|
299
|
-
start: startIndex,
|
|
300
|
-
end: startIndex,
|
|
301
|
-
isMatch
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
return ranges;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
function checkForIssues(alignmentTracks, alignmentType) {
|
|
309
|
-
if (
|
|
310
|
-
!alignmentTracks ||
|
|
311
|
-
!alignmentTracks[0] ||
|
|
312
|
-
!alignmentTracks[0].alignmentData
|
|
313
|
-
) {
|
|
314
|
-
return;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
const alignmentTrackLength = alignmentTracks[0].alignmentData.sequence.length;
|
|
318
|
-
let hasError;
|
|
319
|
-
alignmentTracks.some(track => {
|
|
320
|
-
if (track.alignmentData.sequence.length !== alignmentTrackLength) {
|
|
321
|
-
console.error("incorrect length", alignmentTracks);
|
|
322
|
-
|
|
323
|
-
return "incorrect length";
|
|
324
|
-
}
|
|
325
|
-
if (
|
|
326
|
-
track.chromatogramData &&
|
|
327
|
-
track.sequenceData.sequence.length !==
|
|
328
|
-
track.chromatogramData.baseCalls.length
|
|
329
|
-
) {
|
|
330
|
-
console.error("incorrect chromatogram length", alignmentTracks);
|
|
331
|
-
|
|
332
|
-
return "incorrect chromatogram length";
|
|
333
|
-
}
|
|
334
|
-
if (track.chromatogramData && !track.chromatogramData.baseTraces) {
|
|
335
|
-
if (!track.chromatogramData.basePos) {
|
|
336
|
-
console.error("corrupted chromatogram data", alignmentTracks);
|
|
337
|
-
return "corrupted chromatogram data";
|
|
338
|
-
}
|
|
339
|
-
track.chromatogramData = convertBasePosTraceToPerBpTrace(
|
|
340
|
-
track.chromatogramData
|
|
341
|
-
);
|
|
342
|
-
}
|
|
343
|
-
if (
|
|
344
|
-
alignmentType !== "Parallel Part Creation" &&
|
|
345
|
-
track.sequenceData.sequence.length !==
|
|
346
|
-
track.alignmentData.sequence.replace(/-/g, "").length
|
|
347
|
-
) {
|
|
348
|
-
console.error(
|
|
349
|
-
"sequence data length does not match alignment data w/o gaps"
|
|
350
|
-
);
|
|
351
|
-
console.error(
|
|
352
|
-
"track.sequenceData.sequence:",
|
|
353
|
-
track.sequenceData.sequence
|
|
354
|
-
);
|
|
355
|
-
console.error(
|
|
356
|
-
"track.sequenceData.sequence.length:",
|
|
357
|
-
track.sequenceData.sequence.length
|
|
358
|
-
);
|
|
359
|
-
console.error(
|
|
360
|
-
"track.alignmentData.sequence:",
|
|
361
|
-
track.alignmentData.sequence
|
|
362
|
-
);
|
|
363
|
-
console.error(
|
|
364
|
-
'track.alignmentData.sequence.replace(/-/g,""):',
|
|
365
|
-
track.alignmentData.sequence.replace(/-/g, "")
|
|
366
|
-
);
|
|
367
|
-
console.error(
|
|
368
|
-
'track.alignmentData.sequence.replace(/-/g,"").length:',
|
|
369
|
-
track.alignmentData.sequence.replace(/-/g, "").length
|
|
370
|
-
);
|
|
371
|
-
hasError = "sequence data length does not match alignment data w/o gaps";
|
|
372
|
-
return true;
|
|
373
|
-
}
|
|
374
|
-
return false;
|
|
375
|
-
});
|
|
376
|
-
if (hasError) {
|
|
377
|
-
return hasError;
|
|
378
|
-
}
|
|
379
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { createSelector } from "reselect";
|
|
2
|
-
import { filter } from "lodash-es";
|
|
3
|
-
export const searchableTypes = ["parts", "features", "primers"];
|
|
4
|
-
|
|
5
|
-
function annotationSearchSelector(isOpen, searchString, ...rest) {
|
|
6
|
-
if (!searchString || !isOpen) {
|
|
7
|
-
return [];
|
|
8
|
-
}
|
|
9
|
-
return searchableTypes.map((type, i) => {
|
|
10
|
-
const annotations = rest[i];
|
|
11
|
-
return filter(annotations, ann =>
|
|
12
|
-
ann.name
|
|
13
|
-
.toLowerCase()
|
|
14
|
-
.includes(searchString ? searchString.toLowerCase() : "")
|
|
15
|
-
);
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export default createSelector(
|
|
20
|
-
state => state.findTool && state.findTool.isOpen,
|
|
21
|
-
state => state.findTool && state.findTool.searchText,
|
|
22
|
-
...searchableTypes.map(type => state => state.sequenceData[type]),
|
|
23
|
-
annotationSearchSelector
|
|
24
|
-
);
|
package/annotationTypes.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export const userDefinedTypes = [
|
|
2
|
-
"parts",
|
|
3
|
-
"features",
|
|
4
|
-
"translations",
|
|
5
|
-
"primers"
|
|
6
|
-
];
|
|
7
|
-
|
|
8
|
-
export const userDefinedTypesMap = userDefinedTypes.reduce(function (
|
|
9
|
-
nextVal,
|
|
10
|
-
key
|
|
11
|
-
) {
|
|
12
|
-
nextVal[key] = key;
|
|
13
|
-
return nextVal;
|
|
14
|
-
// looks like this:
|
|
15
|
-
//{
|
|
16
|
-
// parts: 'parts',
|
|
17
|
-
// features: 'features',
|
|
18
|
-
// translations: 'translations',
|
|
19
|
-
// primers: 'primers',
|
|
20
|
-
// }
|
|
21
|
-
}, {});
|
|
22
|
-
|
|
23
|
-
export const derivedDataTypes = ["cutsites", "orfs"];
|
|
24
|
-
export const derivedDataTypesMap = derivedDataTypes.reduce(function (
|
|
25
|
-
nextVal,
|
|
26
|
-
key
|
|
27
|
-
) {
|
|
28
|
-
nextVal[key] = key;
|
|
29
|
-
return nextVal;
|
|
30
|
-
}, {});
|
|
31
|
-
export function getSingular(type) {
|
|
32
|
-
return type.slice(0, -1);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export const allTypes = [...userDefinedTypes, ...derivedDataTypes];
|
package/annotationVisibility.js
DELETED
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
import { omit } from "lodash-es";
|
|
2
|
-
|
|
3
|
-
//./caretPosition.js
|
|
4
|
-
|
|
5
|
-
import createAction from "./utils/createMetaAction";
|
|
6
|
-
import createMergedDefaultStateReducer from "./utils/createMergedDefaultStateReducer";
|
|
7
|
-
|
|
8
|
-
export const visibilityDefaultValues = {
|
|
9
|
-
featureTypesToHide: {},
|
|
10
|
-
featureIndividualToHide: {},
|
|
11
|
-
partIndividualToHide: {},
|
|
12
|
-
primerIndividualToHide: {},
|
|
13
|
-
features: true,
|
|
14
|
-
warnings: true,
|
|
15
|
-
assemblyPieces: true,
|
|
16
|
-
chromatogram: true,
|
|
17
|
-
lineageAnnotations: true,
|
|
18
|
-
translations: true,
|
|
19
|
-
parts: true,
|
|
20
|
-
orfs: false,
|
|
21
|
-
orfTranslations: false,
|
|
22
|
-
cdsFeatureTranslations: true,
|
|
23
|
-
axis: true,
|
|
24
|
-
cutsites: true,
|
|
25
|
-
// cutsites: true,
|
|
26
|
-
cutsitesInSequence: true,
|
|
27
|
-
primers: true,
|
|
28
|
-
dnaColors: false,
|
|
29
|
-
sequence: true,
|
|
30
|
-
reverseSequence: true,
|
|
31
|
-
fivePrimeThreePrimeHints: true,
|
|
32
|
-
axisNumbers: true
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
// ------------------------------------
|
|
36
|
-
// Actions
|
|
37
|
-
// ------------------------------------
|
|
38
|
-
export const annotationVisibilityToggle = createAction(
|
|
39
|
-
"annotationVisibilityToggle"
|
|
40
|
-
);
|
|
41
|
-
//eg: annotationVisibilityToggle('features')
|
|
42
|
-
export const annotationVisibilityHide = createAction(
|
|
43
|
-
"annotationVisibilityHide"
|
|
44
|
-
);
|
|
45
|
-
export const annotationVisibilityShow = createAction(
|
|
46
|
-
"annotationVisibilityShow"
|
|
47
|
-
);
|
|
48
|
-
export const hideFeatureTypes = createAction("hideFeatureTypes");
|
|
49
|
-
export const showFeatureTypes = createAction("showFeatureTypes");
|
|
50
|
-
export const resetFeatureTypesToHide = createAction("resetFeatureTypesToHide");
|
|
51
|
-
export const hideFeatureIndividual = createAction("hideFeatureIndividual");
|
|
52
|
-
export const showFeatureIndividual = createAction("showFeatureIndividual");
|
|
53
|
-
export const resetFeatureIndividualToHide = createAction(
|
|
54
|
-
"resetFeatureIndividualToHide"
|
|
55
|
-
);
|
|
56
|
-
export const hidePrimerIndividual = createAction("hidePrimerIndividual");
|
|
57
|
-
export const showPrimerIndividual = createAction("showPrimerIndividual");
|
|
58
|
-
export const resetPrimerIndividualToHide = createAction(
|
|
59
|
-
"resetPrimerIndividualToHide"
|
|
60
|
-
);
|
|
61
|
-
export const hidePartIndividual = createAction("hidePartIndividual");
|
|
62
|
-
export const showPartIndividual = createAction("showPartIndividual");
|
|
63
|
-
export const resetPartIndividualToHide = createAction(
|
|
64
|
-
"resetPartIndividualToHide"
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
// ------------------------------------
|
|
68
|
-
// Reducer
|
|
69
|
-
// ------------------------------------
|
|
70
|
-
const annotationVisibility = createMergedDefaultStateReducer(
|
|
71
|
-
{
|
|
72
|
-
[resetPartIndividualToHide]: state => {
|
|
73
|
-
return {
|
|
74
|
-
...state,
|
|
75
|
-
partIndividualToHide: {}
|
|
76
|
-
};
|
|
77
|
-
},
|
|
78
|
-
[showPartIndividual]: (state, payload) => {
|
|
79
|
-
return {
|
|
80
|
-
...state,
|
|
81
|
-
parts: true,
|
|
82
|
-
partIndividualToHide: omit(state.partIndividualToHide, payload)
|
|
83
|
-
};
|
|
84
|
-
},
|
|
85
|
-
[hidePartIndividual]: (state, payload) => {
|
|
86
|
-
return {
|
|
87
|
-
...state,
|
|
88
|
-
partIndividualToHide: {
|
|
89
|
-
...state.partIndividualToHide,
|
|
90
|
-
...payload.reduce((acc, key) => {
|
|
91
|
-
acc[key] = true;
|
|
92
|
-
return acc;
|
|
93
|
-
}, {})
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
},
|
|
97
|
-
[resetFeatureIndividualToHide]: state => {
|
|
98
|
-
return {
|
|
99
|
-
...state,
|
|
100
|
-
featureIndividualToHide: {}
|
|
101
|
-
};
|
|
102
|
-
},
|
|
103
|
-
[showFeatureIndividual]: (state, payload) => {
|
|
104
|
-
return {
|
|
105
|
-
...state,
|
|
106
|
-
features: true,
|
|
107
|
-
featureIndividualToHide: omit(state.featureIndividualToHide, payload)
|
|
108
|
-
};
|
|
109
|
-
},
|
|
110
|
-
[hideFeatureIndividual]: (state, payload) => {
|
|
111
|
-
return {
|
|
112
|
-
...state,
|
|
113
|
-
featureIndividualToHide: {
|
|
114
|
-
...state.featureIndividualToHide,
|
|
115
|
-
...payload.reduce((acc, key) => {
|
|
116
|
-
acc[key] = true;
|
|
117
|
-
return acc;
|
|
118
|
-
}, {})
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
},
|
|
122
|
-
[resetPrimerIndividualToHide]: state => {
|
|
123
|
-
return {
|
|
124
|
-
...state,
|
|
125
|
-
primerIndividualToHide: {}
|
|
126
|
-
};
|
|
127
|
-
},
|
|
128
|
-
[showPrimerIndividual]: (state, payload) => {
|
|
129
|
-
return {
|
|
130
|
-
...state,
|
|
131
|
-
primers: true,
|
|
132
|
-
primerIndividualToHide: omit(state.primerIndividualToHide, payload)
|
|
133
|
-
};
|
|
134
|
-
},
|
|
135
|
-
[hidePrimerIndividual]: (state, payload) => {
|
|
136
|
-
return {
|
|
137
|
-
...state,
|
|
138
|
-
primerIndividualToHide: {
|
|
139
|
-
...state.primerIndividualToHide,
|
|
140
|
-
...payload.reduce((acc, key) => {
|
|
141
|
-
acc[key] = true;
|
|
142
|
-
return acc;
|
|
143
|
-
}, {})
|
|
144
|
-
}
|
|
145
|
-
};
|
|
146
|
-
},
|
|
147
|
-
[resetFeatureTypesToHide]: state => {
|
|
148
|
-
return {
|
|
149
|
-
...state,
|
|
150
|
-
featureTypesToHide: {}
|
|
151
|
-
};
|
|
152
|
-
},
|
|
153
|
-
[showFeatureTypes]: (state, payload) => {
|
|
154
|
-
return {
|
|
155
|
-
...state,
|
|
156
|
-
featureTypesToHide: omit(state.featureTypesToHide, payload)
|
|
157
|
-
};
|
|
158
|
-
},
|
|
159
|
-
[hideFeatureTypes]: (state, payload) => {
|
|
160
|
-
return {
|
|
161
|
-
...state,
|
|
162
|
-
featureTypesToHide: {
|
|
163
|
-
...state.featureTypesToHide,
|
|
164
|
-
...payload.reduce((acc, key) => {
|
|
165
|
-
acc[key] = true;
|
|
166
|
-
return acc;
|
|
167
|
-
}, {})
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
},
|
|
171
|
-
[annotationVisibilityToggle]: (state, payload) => {
|
|
172
|
-
return {
|
|
173
|
-
...state,
|
|
174
|
-
[payload]: !state[payload],
|
|
175
|
-
...(payload === "orfs" && state.orfs === state.orfTranslations
|
|
176
|
-
? { orfTranslations: !state.orfTranslations }
|
|
177
|
-
: null)
|
|
178
|
-
};
|
|
179
|
-
},
|
|
180
|
-
[annotationVisibilityHide]: (state, payload) => {
|
|
181
|
-
return {
|
|
182
|
-
...state,
|
|
183
|
-
[payload]: false
|
|
184
|
-
};
|
|
185
|
-
},
|
|
186
|
-
[annotationVisibilityShow]: (state, payload) => {
|
|
187
|
-
return {
|
|
188
|
-
...state,
|
|
189
|
-
[payload]: true
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
},
|
|
193
|
-
visibilityDefaultValues
|
|
194
|
-
);
|
|
195
|
-
|
|
196
|
-
export default annotationVisibility;
|