@teselagen/ove 0.8.39 → 0.8.41

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.
@@ -0,0 +1,2 @@
1
+ export function AlignmentSearchBar(props: any): import("react/jsx-runtime").JSX.Element;
2
+ export default AlignmentSearchBar;
@@ -1,20 +1,2 @@
1
- import { default as React } from '../../../../node_modules/react';
2
- declare const _default: import('../../../../node_modules/react-redux').ConnectedComponent<typeof Mismatches, {
3
- context?: import('../../../../node_modules/react-redux/es/components/Context').ReactReduxContextInstance | undefined;
4
- store?: import('../../../../node_modules/redux').Store | undefined;
5
- } | {
6
- store?: import('../../../../node_modules/redux').Store | undefined;
7
- }>;
8
- export default _default;
9
- declare class Mismatches extends React.Component<any, any, any> {
10
- constructor(props: any);
11
- constructor(props: any, context: any);
12
- UNSAFE_componentWillMount(): void;
13
- getGapMap: (sequence: any) => number[];
14
- getMismatchList: (alignmentData: any, mismatches: any) => {
15
- mismatches: number;
16
- start: number;
17
- end: number;
18
- }[];
19
- render(): import("react/jsx-runtime").JSX.Element;
20
- }
1
+ export function FindMismatches(props: any): import("react/jsx-runtime").JSX.Element;
2
+ export default FindMismatches;
@@ -0,0 +1,53 @@
1
+ /**
2
+ * @typedef {"mismatch"|"insertion"|"deletion"|"gap"} DifferenceType
3
+ *
4
+ * @typedef {Object} AlignmentDifference
5
+ * @property {number} position - 0-based column index in the aligned sequence
6
+ * @property {DifferenceType} type
7
+ * @property {string[]} bases - bases at this column for each track (template first)
8
+ */
9
+ /**
10
+ * Group consecutive same-type differences into regions.
11
+ * Mismatches are never grouped — each is its own entry.
12
+ * Insertions, deletions, and gaps that are side-by-side are collapsed into
13
+ * one entry with a `start` and `end` (both inclusive, 0-based).
14
+ *
15
+ * @param {AlignmentDifference[]} differences
16
+ * @returns {Array<AlignmentDifference & { start: number, end: number }>}
17
+ */
18
+ export function groupConsecutiveDifferences(differences: AlignmentDifference[]): Array<AlignmentDifference & {
19
+ start: number;
20
+ end: number;
21
+ }>;
22
+ /**
23
+ * Classify alignment columns into difference types relative to the template track.
24
+ *
25
+ * Template is alignedSeqs[0]. Non-template tracks are alignedSeqs[1+].
26
+ *
27
+ * Classification rules (per column):
28
+ * - "gap" : no non-template track is in its aligned region at this position
29
+ * - "insertion" : template has '-', at least one aligned non-template has a non-gap base
30
+ * - "deletion" : template has a non-gap base, at least one aligned non-template has '-'
31
+ * - "mismatch" : no gaps among aligned tracks, unique base set has more than one member
32
+ *
33
+ * Only tracks whose aligned region covers position i participate in classification.
34
+ * This correctly handles multi-read alignments (e.g. Sanger) where reads cover
35
+ * different sub-ranges of the full alignment.
36
+ *
37
+ * @param {string[]} alignedSeqs - Aligned sequence strings, all same length
38
+ * @returns {AlignmentDifference[]}
39
+ */
40
+ export function findAlignmentDifferences(alignedSeqs: string[]): AlignmentDifference[];
41
+ export default findAlignmentDifferences;
42
+ export type DifferenceType = "mismatch" | "insertion" | "deletion" | "gap";
43
+ export type AlignmentDifference = {
44
+ /**
45
+ * - 0-based column index in the aligned sequence
46
+ */
47
+ position: number;
48
+ type: DifferenceType;
49
+ /**
50
+ * - bases at this column for each track (template first)
51
+ */
52
+ bases: string[];
53
+ };
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @typedef {Object} Mismatch
3
+ * @property {number} position
4
+ * @property {string[]} bases
5
+ */
6
+ /**
7
+ * @typedef {Object} FindMismatchesProps
8
+ * @property {Array<{
9
+ * alignmentData: {
10
+ * sequence: string
11
+ * }
12
+ * }>} alignmentJson
13
+ * @property {string} id
14
+ */
15
+ export function scrollToAlignmentSelection(): void;
16
+ export function updateCaretPosition({ start, end }: {
17
+ start: any;
18
+ end: any;
19
+ }): void;
20
+ export type Mismatch = {
21
+ position: number;
22
+ bases: string[];
23
+ };
24
+ export type FindMismatchesProps = {
25
+ alignmentJson: Array<{
26
+ alignmentData: {
27
+ sequence: string;
28
+ };
29
+ }>;
30
+ id: string;
31
+ };