@teselagen/ove 0.8.8 → 0.8.10
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 +22 -8
- package/index.es.js +22 -8
- package/index.umd.js +22 -8
- package/package.json +2 -2
- package/src/AlignmentView/index.js +15 -7
- package/src/PropertySidePanel/index.js +2 -1
- package/src/helperComponents/PropertiesDialog/GenericAnnotationProperties.js +1 -0
- package/src/utils/getAlignedAminoAcidSequenceProps.js +8 -2
- package/utils/getAlignedAminoAcidSequenceProps.d.ts +12 -0
package/index.cjs.js
CHANGED
|
@@ -19741,6 +19741,9 @@ function tableQueryParamsToHasuraClauses({
|
|
|
19741
19741
|
} else {
|
|
19742
19742
|
if (path2) {
|
|
19743
19743
|
const allPaths = [path2, ...additionalSearchPaths];
|
|
19744
|
+
if (allPaths.length > 1) {
|
|
19745
|
+
return { _or: allPaths.map((p2) => addColumnFilters(p2)) };
|
|
19746
|
+
}
|
|
19744
19747
|
return allPaths.map((p2) => addColumnFilters(p2));
|
|
19745
19748
|
} else {
|
|
19746
19749
|
return addColumnFilters(filterOn);
|
|
@@ -116627,7 +116630,7 @@ function showFileDialog({ multiple = false, onSelect }) {
|
|
|
116627
116630
|
input.click();
|
|
116628
116631
|
}
|
|
116629
116632
|
__name(showFileDialog, "showFileDialog");
|
|
116630
|
-
const version = "0.8.
|
|
116633
|
+
const version = "0.8.9";
|
|
116631
116634
|
const packageJson = {
|
|
116632
116635
|
version
|
|
116633
116636
|
};
|
|
@@ -138107,6 +138110,7 @@ const PropertySidePanel = /* @__PURE__ */ __name(({ properties: properties2, set
|
|
|
138107
138110
|
{
|
|
138108
138111
|
ref: sidebarRef,
|
|
138109
138112
|
style: __spreadValues({
|
|
138113
|
+
position: "relative",
|
|
138110
138114
|
width: isOpen ? 350 : 0,
|
|
138111
138115
|
minWidth: isOpen ? 350 : 0,
|
|
138112
138116
|
maxWidth: isOpen ? 350 : 0,
|
|
@@ -138126,7 +138130,7 @@ const PropertySidePanel = /* @__PURE__ */ __name(({ properties: properties2, set
|
|
|
138126
138130
|
{
|
|
138127
138131
|
style: {
|
|
138128
138132
|
position: "absolute",
|
|
138129
|
-
top:
|
|
138133
|
+
top: 0,
|
|
138130
138134
|
right: 10,
|
|
138131
138135
|
zIndex: 1,
|
|
138132
138136
|
cursor: "pointer"
|
|
@@ -138351,13 +138355,18 @@ function getLabileSites(alignedSequences, threshold = 0.5) {
|
|
|
138351
138355
|
};
|
|
138352
138356
|
}
|
|
138353
138357
|
__name(getLabileSites, "getLabileSites");
|
|
138354
|
-
|
|
138358
|
+
function parseTracks(tracks) {
|
|
138355
138359
|
let sequences = {};
|
|
138356
138360
|
tracks.forEach((at) => {
|
|
138357
138361
|
sequences = __spreadProps(__spreadValues({}, sequences), {
|
|
138358
138362
|
[at.alignmentData.name]: at.alignmentData.sequence
|
|
138359
138363
|
});
|
|
138360
138364
|
});
|
|
138365
|
+
return sequences;
|
|
138366
|
+
}
|
|
138367
|
+
__name(parseTracks, "parseTracks");
|
|
138368
|
+
const getAlignedAminoAcidSequenceProps = /* @__PURE__ */ __name((tracks) => {
|
|
138369
|
+
const sequences = parseTracks(tracks);
|
|
138361
138370
|
const identity4 = calculateIdentityMatrix(sequences);
|
|
138362
138371
|
const { overallIdentity, frequencies } = getIdentityAndFrequencies(sequences);
|
|
138363
138372
|
const labileSites = getLabileSites(sequences, 0.5);
|
|
@@ -138609,6 +138618,10 @@ ${seqDataToCopy}\r
|
|
|
138609
138618
|
alignmentHolderTop.current.scrollLeft = scrollPercentageToUse * (alignmentHolderTop.current.scrollWidth - alignmentHolderTop.current.clientWidth);
|
|
138610
138619
|
}
|
|
138611
138620
|
}, "scrollAlignmentToPercent");
|
|
138621
|
+
const aminoAcidAlignmentProperties = React.useMemo(() => {
|
|
138622
|
+
if (isPairwise || !alignmentTracks[0].sequenceData.isProtein) return;
|
|
138623
|
+
return getAlignedAminoAcidSequenceProps(alignmentTracks);
|
|
138624
|
+
}, [alignmentTracks, isPairwise]);
|
|
138612
138625
|
React.useEffect(() => {
|
|
138613
138626
|
window.scrollAlignmentToPercent = scrollAlignmentToPercent;
|
|
138614
138627
|
if (window.Cypress)
|
|
@@ -138975,10 +138988,6 @@ ${seqDataToCopy}\r
|
|
|
138975
138988
|
annotationLabelVisibility: alignmentVisibilityToolOptions.alignmentAnnotationLabelVisibility
|
|
138976
138989
|
});
|
|
138977
138990
|
}, "estimateRowHeight");
|
|
138978
|
-
const aminoAcidAlignmentProperties = React.useMemo(() => {
|
|
138979
|
-
if (isPairwise || !alignmentTracks[0].sequenceData.isProtein) return;
|
|
138980
|
-
return getAlignedAminoAcidSequenceProps(alignmentTracks);
|
|
138981
|
-
}, [alignmentTracks, isPairwise]);
|
|
138982
138991
|
const renderItem = /* @__PURE__ */ __name((_i, _key, isTemplate, cloneProps) => {
|
|
138983
138992
|
var _a3, _b2, _c, _d, _e;
|
|
138984
138993
|
const isDragDisabled = !allowTrackRearrange || isPairwise;
|
|
@@ -140041,6 +140050,7 @@ const AlignmentView$1 = compose(
|
|
|
140041
140050
|
withEditorProps,
|
|
140042
140051
|
reactRedux.connect(
|
|
140043
140052
|
(state2, ownProps) => {
|
|
140053
|
+
var _a2, _b2;
|
|
140044
140054
|
const {
|
|
140045
140055
|
VectorEditor: {
|
|
140046
140056
|
__allEditorsOptions: { alignments: alignments2 }
|
|
@@ -140105,6 +140115,8 @@ const AlignmentView$1 = compose(
|
|
|
140105
140115
|
togglableAlignmentAnnotationSettings[annotation] = alignmentAnnotationVisibility[annotation];
|
|
140106
140116
|
}
|
|
140107
140117
|
});
|
|
140118
|
+
const tracks = parseTracks(alignmentTracks);
|
|
140119
|
+
const labileSites = getLabileSites(tracks, 0.5);
|
|
140108
140120
|
const annotationsWithCounts = [];
|
|
140109
140121
|
if (alignmentTracks) {
|
|
140110
140122
|
let totalNumOfFeatures = 0;
|
|
@@ -140119,7 +140131,8 @@ const AlignmentView$1 = compose(
|
|
|
140119
140131
|
});
|
|
140120
140132
|
annotationsWithCounts.push({
|
|
140121
140133
|
features: totalNumOfFeatures,
|
|
140122
|
-
parts: totalNumOfParts
|
|
140134
|
+
parts: totalNumOfParts,
|
|
140135
|
+
labileSites: (_b2 = (_a2 = labileSites.sites) == null ? void 0 : _a2.length) != null ? _b2 : 0
|
|
140123
140136
|
});
|
|
140124
140137
|
} else if (pairwiseAlignments) {
|
|
140125
140138
|
pairwiseAlignments.forEach((pairwise) => {
|
|
@@ -143823,6 +143836,7 @@ const genericAnnotationProperties = /* @__PURE__ */ __name(({
|
|
|
143823
143836
|
isProtein: isProtein2,
|
|
143824
143837
|
compact: true,
|
|
143825
143838
|
isInfinite: true,
|
|
143839
|
+
withDisplayOptions: true,
|
|
143826
143840
|
schema: this.schema,
|
|
143827
143841
|
entities: annotationsToUse
|
|
143828
143842
|
}
|
package/index.es.js
CHANGED
|
@@ -19723,6 +19723,9 @@ function tableQueryParamsToHasuraClauses({
|
|
|
19723
19723
|
} else {
|
|
19724
19724
|
if (path2) {
|
|
19725
19725
|
const allPaths = [path2, ...additionalSearchPaths];
|
|
19726
|
+
if (allPaths.length > 1) {
|
|
19727
|
+
return { _or: allPaths.map((p2) => addColumnFilters(p2)) };
|
|
19728
|
+
}
|
|
19726
19729
|
return allPaths.map((p2) => addColumnFilters(p2));
|
|
19727
19730
|
} else {
|
|
19728
19731
|
return addColumnFilters(filterOn);
|
|
@@ -116609,7 +116612,7 @@ function showFileDialog({ multiple = false, onSelect }) {
|
|
|
116609
116612
|
input.click();
|
|
116610
116613
|
}
|
|
116611
116614
|
__name(showFileDialog, "showFileDialog");
|
|
116612
|
-
const version = "0.8.
|
|
116615
|
+
const version = "0.8.9";
|
|
116613
116616
|
const packageJson = {
|
|
116614
116617
|
version
|
|
116615
116618
|
};
|
|
@@ -138089,6 +138092,7 @@ const PropertySidePanel = /* @__PURE__ */ __name(({ properties: properties2, set
|
|
|
138089
138092
|
{
|
|
138090
138093
|
ref: sidebarRef,
|
|
138091
138094
|
style: __spreadValues({
|
|
138095
|
+
position: "relative",
|
|
138092
138096
|
width: isOpen ? 350 : 0,
|
|
138093
138097
|
minWidth: isOpen ? 350 : 0,
|
|
138094
138098
|
maxWidth: isOpen ? 350 : 0,
|
|
@@ -138108,7 +138112,7 @@ const PropertySidePanel = /* @__PURE__ */ __name(({ properties: properties2, set
|
|
|
138108
138112
|
{
|
|
138109
138113
|
style: {
|
|
138110
138114
|
position: "absolute",
|
|
138111
|
-
top:
|
|
138115
|
+
top: 0,
|
|
138112
138116
|
right: 10,
|
|
138113
138117
|
zIndex: 1,
|
|
138114
138118
|
cursor: "pointer"
|
|
@@ -138333,13 +138337,18 @@ function getLabileSites(alignedSequences, threshold = 0.5) {
|
|
|
138333
138337
|
};
|
|
138334
138338
|
}
|
|
138335
138339
|
__name(getLabileSites, "getLabileSites");
|
|
138336
|
-
|
|
138340
|
+
function parseTracks(tracks) {
|
|
138337
138341
|
let sequences = {};
|
|
138338
138342
|
tracks.forEach((at) => {
|
|
138339
138343
|
sequences = __spreadProps(__spreadValues({}, sequences), {
|
|
138340
138344
|
[at.alignmentData.name]: at.alignmentData.sequence
|
|
138341
138345
|
});
|
|
138342
138346
|
});
|
|
138347
|
+
return sequences;
|
|
138348
|
+
}
|
|
138349
|
+
__name(parseTracks, "parseTracks");
|
|
138350
|
+
const getAlignedAminoAcidSequenceProps = /* @__PURE__ */ __name((tracks) => {
|
|
138351
|
+
const sequences = parseTracks(tracks);
|
|
138343
138352
|
const identity4 = calculateIdentityMatrix(sequences);
|
|
138344
138353
|
const { overallIdentity, frequencies } = getIdentityAndFrequencies(sequences);
|
|
138345
138354
|
const labileSites = getLabileSites(sequences, 0.5);
|
|
@@ -138591,6 +138600,10 @@ ${seqDataToCopy}\r
|
|
|
138591
138600
|
alignmentHolderTop.current.scrollLeft = scrollPercentageToUse * (alignmentHolderTop.current.scrollWidth - alignmentHolderTop.current.clientWidth);
|
|
138592
138601
|
}
|
|
138593
138602
|
}, "scrollAlignmentToPercent");
|
|
138603
|
+
const aminoAcidAlignmentProperties = useMemo$1(() => {
|
|
138604
|
+
if (isPairwise || !alignmentTracks[0].sequenceData.isProtein) return;
|
|
138605
|
+
return getAlignedAminoAcidSequenceProps(alignmentTracks);
|
|
138606
|
+
}, [alignmentTracks, isPairwise]);
|
|
138594
138607
|
useEffect(() => {
|
|
138595
138608
|
window.scrollAlignmentToPercent = scrollAlignmentToPercent;
|
|
138596
138609
|
if (window.Cypress)
|
|
@@ -138957,10 +138970,6 @@ ${seqDataToCopy}\r
|
|
|
138957
138970
|
annotationLabelVisibility: alignmentVisibilityToolOptions.alignmentAnnotationLabelVisibility
|
|
138958
138971
|
});
|
|
138959
138972
|
}, "estimateRowHeight");
|
|
138960
|
-
const aminoAcidAlignmentProperties = useMemo$1(() => {
|
|
138961
|
-
if (isPairwise || !alignmentTracks[0].sequenceData.isProtein) return;
|
|
138962
|
-
return getAlignedAminoAcidSequenceProps(alignmentTracks);
|
|
138963
|
-
}, [alignmentTracks, isPairwise]);
|
|
138964
138973
|
const renderItem = /* @__PURE__ */ __name((_i, _key, isTemplate, cloneProps) => {
|
|
138965
138974
|
var _a3, _b2, _c, _d, _e;
|
|
138966
138975
|
const isDragDisabled = !allowTrackRearrange || isPairwise;
|
|
@@ -140023,6 +140032,7 @@ const AlignmentView$1 = compose(
|
|
|
140023
140032
|
withEditorProps,
|
|
140024
140033
|
connect(
|
|
140025
140034
|
(state2, ownProps) => {
|
|
140035
|
+
var _a2, _b2;
|
|
140026
140036
|
const {
|
|
140027
140037
|
VectorEditor: {
|
|
140028
140038
|
__allEditorsOptions: { alignments: alignments2 }
|
|
@@ -140087,6 +140097,8 @@ const AlignmentView$1 = compose(
|
|
|
140087
140097
|
togglableAlignmentAnnotationSettings[annotation] = alignmentAnnotationVisibility[annotation];
|
|
140088
140098
|
}
|
|
140089
140099
|
});
|
|
140100
|
+
const tracks = parseTracks(alignmentTracks);
|
|
140101
|
+
const labileSites = getLabileSites(tracks, 0.5);
|
|
140090
140102
|
const annotationsWithCounts = [];
|
|
140091
140103
|
if (alignmentTracks) {
|
|
140092
140104
|
let totalNumOfFeatures = 0;
|
|
@@ -140101,7 +140113,8 @@ const AlignmentView$1 = compose(
|
|
|
140101
140113
|
});
|
|
140102
140114
|
annotationsWithCounts.push({
|
|
140103
140115
|
features: totalNumOfFeatures,
|
|
140104
|
-
parts: totalNumOfParts
|
|
140116
|
+
parts: totalNumOfParts,
|
|
140117
|
+
labileSites: (_b2 = (_a2 = labileSites.sites) == null ? void 0 : _a2.length) != null ? _b2 : 0
|
|
140105
140118
|
});
|
|
140106
140119
|
} else if (pairwiseAlignments) {
|
|
140107
140120
|
pairwiseAlignments.forEach((pairwise) => {
|
|
@@ -143805,6 +143818,7 @@ const genericAnnotationProperties = /* @__PURE__ */ __name(({
|
|
|
143805
143818
|
isProtein: isProtein2,
|
|
143806
143819
|
compact: true,
|
|
143807
143820
|
isInfinite: true,
|
|
143821
|
+
withDisplayOptions: true,
|
|
143808
143822
|
schema: this.schema,
|
|
143809
143823
|
entities: annotationsToUse
|
|
143810
143824
|
}
|
package/index.umd.js
CHANGED
|
@@ -45994,6 +45994,9 @@ ${latestSubscriptionCallbackError.current.stack}
|
|
|
45994
45994
|
} else {
|
|
45995
45995
|
if (path2) {
|
|
45996
45996
|
const allPaths = [path2, ...additionalSearchPaths];
|
|
45997
|
+
if (allPaths.length > 1) {
|
|
45998
|
+
return { _or: allPaths.map((p2) => addColumnFilters(p2)) };
|
|
45999
|
+
}
|
|
45997
46000
|
return allPaths.map((p2) => addColumnFilters(p2));
|
|
45998
46001
|
} else {
|
|
45999
46002
|
return addColumnFilters(filterOn);
|
|
@@ -144725,7 +144728,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
|
|
|
144725
144728
|
input.click();
|
|
144726
144729
|
}
|
|
144727
144730
|
__name(showFileDialog, "showFileDialog");
|
|
144728
|
-
const version = "0.8.
|
|
144731
|
+
const version = "0.8.9";
|
|
144729
144732
|
const packageJson = {
|
|
144730
144733
|
version
|
|
144731
144734
|
};
|
|
@@ -164603,6 +164606,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
|
|
|
164603
164606
|
{
|
|
164604
164607
|
ref: sidebarRef,
|
|
164605
164608
|
style: __spreadValues({
|
|
164609
|
+
position: "relative",
|
|
164606
164610
|
width: isOpen2 ? 350 : 0,
|
|
164607
164611
|
minWidth: isOpen2 ? 350 : 0,
|
|
164608
164612
|
maxWidth: isOpen2 ? 350 : 0,
|
|
@@ -164622,7 +164626,7 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
|
|
|
164622
164626
|
{
|
|
164623
164627
|
style: {
|
|
164624
164628
|
position: "absolute",
|
|
164625
|
-
top:
|
|
164629
|
+
top: 0,
|
|
164626
164630
|
right: 10,
|
|
164627
164631
|
zIndex: 1,
|
|
164628
164632
|
cursor: "pointer"
|
|
@@ -164847,13 +164851,18 @@ Part of ${annotation.translationType} Translation from BPs ${annotation.start +
|
|
|
164847
164851
|
};
|
|
164848
164852
|
}
|
|
164849
164853
|
__name(getLabileSites, "getLabileSites");
|
|
164850
|
-
|
|
164854
|
+
function parseTracks(tracks) {
|
|
164851
164855
|
let sequences = {};
|
|
164852
164856
|
tracks.forEach((at) => {
|
|
164853
164857
|
sequences = __spreadProps(__spreadValues({}, sequences), {
|
|
164854
164858
|
[at.alignmentData.name]: at.alignmentData.sequence
|
|
164855
164859
|
});
|
|
164856
164860
|
});
|
|
164861
|
+
return sequences;
|
|
164862
|
+
}
|
|
164863
|
+
__name(parseTracks, "parseTracks");
|
|
164864
|
+
const getAlignedAminoAcidSequenceProps = /* @__PURE__ */ __name((tracks) => {
|
|
164865
|
+
const sequences = parseTracks(tracks);
|
|
164857
164866
|
const identity2 = calculateIdentityMatrix(sequences);
|
|
164858
164867
|
const { overallIdentity, frequencies } = getIdentityAndFrequencies(sequences);
|
|
164859
164868
|
const labileSites = getLabileSites(sequences, 0.5);
|
|
@@ -165105,6 +165114,10 @@ ${seqDataToCopy}\r
|
|
|
165105
165114
|
alignmentHolderTop.current.scrollLeft = scrollPercentageToUse * (alignmentHolderTop.current.scrollWidth - alignmentHolderTop.current.clientWidth);
|
|
165106
165115
|
}
|
|
165107
165116
|
}, "scrollAlignmentToPercent");
|
|
165117
|
+
const aminoAcidAlignmentProperties = reactExports.useMemo(() => {
|
|
165118
|
+
if (isPairwise || !alignmentTracks[0].sequenceData.isProtein) return;
|
|
165119
|
+
return getAlignedAminoAcidSequenceProps(alignmentTracks);
|
|
165120
|
+
}, [alignmentTracks, isPairwise]);
|
|
165108
165121
|
reactExports.useEffect(() => {
|
|
165109
165122
|
window.scrollAlignmentToPercent = scrollAlignmentToPercent;
|
|
165110
165123
|
if (window.Cypress)
|
|
@@ -165471,10 +165484,6 @@ ${seqDataToCopy}\r
|
|
|
165471
165484
|
annotationLabelVisibility: alignmentVisibilityToolOptions.alignmentAnnotationLabelVisibility
|
|
165472
165485
|
});
|
|
165473
165486
|
}, "estimateRowHeight");
|
|
165474
|
-
const aminoAcidAlignmentProperties = reactExports.useMemo(() => {
|
|
165475
|
-
if (isPairwise || !alignmentTracks[0].sequenceData.isProtein) return;
|
|
165476
|
-
return getAlignedAminoAcidSequenceProps(alignmentTracks);
|
|
165477
|
-
}, [alignmentTracks, isPairwise]);
|
|
165478
165487
|
const renderItem = /* @__PURE__ */ __name((_i, _key, isTemplate, cloneProps) => {
|
|
165479
165488
|
var _a3, _b2, _c2, _d2, _e;
|
|
165480
165489
|
const isDragDisabled = !allowTrackRearrange || isPairwise;
|
|
@@ -166537,6 +166546,7 @@ ${seqDataToCopy}\r
|
|
|
166537
166546
|
withEditorProps,
|
|
166538
166547
|
connect(
|
|
166539
166548
|
(state2, ownProps) => {
|
|
166549
|
+
var _a2, _b2;
|
|
166540
166550
|
const {
|
|
166541
166551
|
VectorEditor: {
|
|
166542
166552
|
__allEditorsOptions: { alignments: alignments2 }
|
|
@@ -166601,6 +166611,8 @@ ${seqDataToCopy}\r
|
|
|
166601
166611
|
togglableAlignmentAnnotationSettings[annotation] = alignmentAnnotationVisibility[annotation];
|
|
166602
166612
|
}
|
|
166603
166613
|
});
|
|
166614
|
+
const tracks = parseTracks(alignmentTracks);
|
|
166615
|
+
const labileSites = getLabileSites(tracks, 0.5);
|
|
166604
166616
|
const annotationsWithCounts = [];
|
|
166605
166617
|
if (alignmentTracks) {
|
|
166606
166618
|
let totalNumOfFeatures = 0;
|
|
@@ -166615,7 +166627,8 @@ ${seqDataToCopy}\r
|
|
|
166615
166627
|
});
|
|
166616
166628
|
annotationsWithCounts.push({
|
|
166617
166629
|
features: totalNumOfFeatures,
|
|
166618
|
-
parts: totalNumOfParts
|
|
166630
|
+
parts: totalNumOfParts,
|
|
166631
|
+
labileSites: (_b2 = (_a2 = labileSites.sites) == null ? void 0 : _a2.length) != null ? _b2 : 0
|
|
166619
166632
|
});
|
|
166620
166633
|
} else if (pairwiseAlignments) {
|
|
166621
166634
|
pairwiseAlignments.forEach((pairwise) => {
|
|
@@ -170319,6 +170332,7 @@ ${seqDataToCopy}\r
|
|
|
170319
170332
|
isProtein: isProtein2,
|
|
170320
170333
|
compact: true,
|
|
170321
170334
|
isInfinite: true,
|
|
170335
|
+
withDisplayOptions: true,
|
|
170322
170336
|
schema: this.schema,
|
|
170323
170337
|
entities: annotationsToUse
|
|
170324
170338
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teselagen/ove",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.10",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@teselagen/range-utils": "0.3.13",
|
|
20
20
|
"@teselagen/react-list": "0.8.18",
|
|
21
21
|
"@teselagen/sequence-utils": "0.3.35",
|
|
22
|
-
"@teselagen/ui": "0.10.
|
|
22
|
+
"@teselagen/ui": "0.10.9",
|
|
23
23
|
"@use-gesture/react": "10.3.0",
|
|
24
24
|
"biomsa": "^0.2.4",
|
|
25
25
|
"classnames": "^2.3.2",
|
|
@@ -74,7 +74,11 @@ import { coerceInitialValue } from "./coerceInitialValue";
|
|
|
74
74
|
import { tabHeight } from "../constants";
|
|
75
75
|
import LabileSitesLayer from "./LabileSitesLayer";
|
|
76
76
|
import PropertySidePanel from "../PropertySidePanel";
|
|
77
|
-
import {
|
|
77
|
+
import {
|
|
78
|
+
getAlignedAminoAcidSequenceProps,
|
|
79
|
+
getLabileSites,
|
|
80
|
+
parseTracks
|
|
81
|
+
} from "../utils/getAlignedAminoAcidSequenceProps";
|
|
78
82
|
|
|
79
83
|
let charWidthInLinearViewDefault = 12;
|
|
80
84
|
try {
|
|
@@ -244,6 +248,11 @@ export const AlignmentView = props => {
|
|
|
244
248
|
}
|
|
245
249
|
};
|
|
246
250
|
|
|
251
|
+
const aminoAcidAlignmentProperties = useMemo(() => {
|
|
252
|
+
if (isPairwise || !alignmentTracks[0].sequenceData.isProtein) return;
|
|
253
|
+
return getAlignedAminoAcidSequenceProps(alignmentTracks);
|
|
254
|
+
}, [alignmentTracks, isPairwise]);
|
|
255
|
+
|
|
247
256
|
useEffect(() => {
|
|
248
257
|
window.scrollAlignmentToPercent = scrollAlignmentToPercent;
|
|
249
258
|
if (window.Cypress)
|
|
@@ -684,11 +693,6 @@ export const AlignmentView = props => {
|
|
|
684
693
|
});
|
|
685
694
|
};
|
|
686
695
|
|
|
687
|
-
const aminoAcidAlignmentProperties = useMemo(() => {
|
|
688
|
-
if (isPairwise || !alignmentTracks[0].sequenceData.isProtein) return;
|
|
689
|
-
return getAlignedAminoAcidSequenceProps(alignmentTracks);
|
|
690
|
-
}, [alignmentTracks, isPairwise]);
|
|
691
|
-
|
|
692
696
|
const renderItem = (_i, _key, isTemplate, cloneProps) => {
|
|
693
697
|
const isDragDisabled = !allowTrackRearrange || isPairwise;
|
|
694
698
|
let i;
|
|
@@ -1966,6 +1970,9 @@ export default compose(
|
|
|
1966
1970
|
}
|
|
1967
1971
|
});
|
|
1968
1972
|
|
|
1973
|
+
const tracks = parseTracks(alignmentTracks);
|
|
1974
|
+
const labileSites = getLabileSites(tracks, 0.5);
|
|
1975
|
+
|
|
1969
1976
|
const annotationsWithCounts = [];
|
|
1970
1977
|
if (alignmentTracks) {
|
|
1971
1978
|
let totalNumOfFeatures = 0;
|
|
@@ -1980,7 +1987,8 @@ export default compose(
|
|
|
1980
1987
|
});
|
|
1981
1988
|
annotationsWithCounts.push({
|
|
1982
1989
|
features: totalNumOfFeatures,
|
|
1983
|
-
parts: totalNumOfParts
|
|
1990
|
+
parts: totalNumOfParts,
|
|
1991
|
+
labileSites: labileSites.sites?.length ?? 0
|
|
1984
1992
|
});
|
|
1985
1993
|
} else if (pairwiseAlignments) {
|
|
1986
1994
|
pairwiseAlignments.forEach(pairwise => {
|
|
@@ -187,6 +187,7 @@ export default ({ properties, setProperties, style }) => {
|
|
|
187
187
|
<div
|
|
188
188
|
ref={sidebarRef}
|
|
189
189
|
style={{
|
|
190
|
+
position: "relative",
|
|
190
191
|
width: isOpen ? 350 : 0,
|
|
191
192
|
minWidth: isOpen ? 350 : 0,
|
|
192
193
|
maxWidth: isOpen ? 350 : 0,
|
|
@@ -205,7 +206,7 @@ export default ({ properties, setProperties, style }) => {
|
|
|
205
206
|
<Button
|
|
206
207
|
style={{
|
|
207
208
|
position: "absolute",
|
|
208
|
-
top:
|
|
209
|
+
top: 0,
|
|
209
210
|
right: 10,
|
|
210
211
|
zIndex: 1,
|
|
211
212
|
cursor: "pointer"
|
|
@@ -214,7 +214,7 @@ function getIdentityAndFrequencies(alignedSequences) {
|
|
|
214
214
|
};
|
|
215
215
|
}
|
|
216
216
|
|
|
217
|
-
function getLabileSites(alignedSequences, threshold = 0.5) {
|
|
217
|
+
export function getLabileSites(alignedSequences, threshold = 0.5) {
|
|
218
218
|
const sequences = Object.values(alignedSequences);
|
|
219
219
|
const alignmentLength = sequences[0].length;
|
|
220
220
|
|
|
@@ -261,7 +261,7 @@ function getLabileSites(alignedSequences, threshold = 0.5) {
|
|
|
261
261
|
};
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
export
|
|
264
|
+
export function parseTracks(tracks) {
|
|
265
265
|
let sequences = {};
|
|
266
266
|
|
|
267
267
|
tracks.forEach(at => {
|
|
@@ -271,6 +271,12 @@ export const getAlignedAminoAcidSequenceProps = tracks => {
|
|
|
271
271
|
};
|
|
272
272
|
});
|
|
273
273
|
|
|
274
|
+
return sequences;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export const getAlignedAminoAcidSequenceProps = tracks => {
|
|
278
|
+
const sequences = parseTracks(tracks);
|
|
279
|
+
|
|
274
280
|
const identity = calculateIdentityMatrix(sequences);
|
|
275
281
|
const { overallIdentity, frequencies } = getIdentityAndFrequencies(sequences);
|
|
276
282
|
const labileSites = getLabileSites(sequences, 0.5);
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
export function getLabileSites(alignedSequences: any, threshold?: number): {
|
|
2
|
+
sites: {
|
|
3
|
+
position: number;
|
|
4
|
+
conservationScore: number;
|
|
5
|
+
residueVariation: string[];
|
|
6
|
+
frequencies: {};
|
|
7
|
+
}[];
|
|
8
|
+
conservationScores: (number | null)[];
|
|
9
|
+
totalLabileSites: number;
|
|
10
|
+
percentageLabile: number;
|
|
11
|
+
};
|
|
12
|
+
export function parseTracks(tracks: any): {};
|
|
1
13
|
export function getAlignedAminoAcidSequenceProps(tracks: any): {
|
|
2
14
|
overallIdentity: number;
|
|
3
15
|
frequencies: number[];
|