@teselagen/ove 0.8.8 → 0.8.9

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.
@@ -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 { getAlignedAminoAcidSequenceProps } from "../utils/getAlignedAminoAcidSequenceProps";
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: 5,
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 const getAlignedAminoAcidSequenceProps = tracks => {
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 +1 @@
1
- export function addWrappedAddons(anns: any, seqLen: any): any[];
1
+ export function addWrappedAddons(anns: any, seqLen: any): any;
@@ -35,4 +35,4 @@ export function getStripedPattern({ color, id }: {
35
35
  color: any;
36
36
  id: any;
37
37
  }): import("react/jsx-runtime").JSX.Element;
38
- export function getEnzymeAliases(enzyme: any): any[];
38
+ export function getEnzymeAliases(enzyme: any): any;
@@ -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[];
@@ -41,17 +41,17 @@ export function updateSelectionOrCaret({ shiftHeld, sequenceLength, newRangeOrCa
41
41
  newRangeOrCaret: any;
42
42
  caretPosition: any;
43
43
  selectionLayer: any;
44
- selectionLayerUpdate?: ((...args: any[]) => void) | undefined;
45
- caretPositionUpdate?: ((...args: any[]) => void) | undefined;
44
+ selectionLayerUpdate?: any;
45
+ caretPositionUpdate?: any;
46
46
  doNotWrapOrigin: any;
47
- }): void;
47
+ }): any;
48
48
  export function editorDragged({ nearestCaretPos, doNotWrapOrigin, caretPosition, easyStore, caretPositionUpdate, selectionLayerUpdate, selectionLayer, sequenceLength }: {
49
49
  nearestCaretPos: any;
50
50
  doNotWrapOrigin: any;
51
51
  caretPosition?: number | undefined;
52
52
  easyStore: any;
53
- caretPositionUpdate?: ((...args: any[]) => void) | undefined;
54
- selectionLayerUpdate?: ((...args: any[]) => void) | undefined;
53
+ caretPositionUpdate?: any;
54
+ selectionLayerUpdate?: any;
55
55
  selectionLayer?: {
56
56
  start: number;
57
57
  end: number;