react-msaview 3.2.1 → 3.2.2
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/bundle/index.js +11 -11
- package/dist/components/msa/renderMSABlock.js +30 -26
- package/dist/components/msa/renderMSABlock.js.map +1 -1
- package/dist/components/tree/dialogs/TreeNodeInfoDialog.js +2 -3
- package/dist/components/tree/dialogs/TreeNodeInfoDialog.js.map +1 -1
- package/dist/components/tree/renderTreeCanvas.js +5 -5
- package/dist/components/tree/renderTreeCanvas.js.map +1 -1
- package/dist/model/DialogQueue.d.ts +1 -1
- package/dist/model.d.ts +23 -24
- package/dist/model.js +37 -13
- package/dist/model.js.map +1 -1
- package/dist/parseNewick.d.ts +4 -4
- package/dist/parseNewick.js +7 -7
- package/dist/parseNewick.js.map +1 -1
- package/dist/parsers/ClustalMSA.d.ts +4 -4
- package/dist/parsers/ClustalMSA.js +2 -2
- package/dist/parsers/ClustalMSA.js.map +1 -1
- package/dist/parsers/EmfMSA.d.ts +27 -0
- package/dist/parsers/EmfMSA.js +53 -0
- package/dist/parsers/EmfMSA.js.map +1 -0
- package/dist/parsers/EmfTree.d.ts +5 -0
- package/dist/parsers/EmfTree.js +8 -0
- package/dist/parsers/EmfTree.js.map +1 -0
- package/dist/parsers/FastaMSA.js +2 -2
- package/dist/parsers/FastaMSA.js.map +1 -1
- package/dist/parsers/StockholmMSA.js +2 -2
- package/dist/parsers/StockholmMSA.js.map +1 -1
- package/dist/reparseTree.js +2 -2
- package/dist/reparseTree.js.map +1 -1
- package/dist/util.d.ts +3 -3
- package/dist/util.js +1 -1
- package/dist/util.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -3
- package/src/components/msa/renderMSABlock.ts +42 -38
- package/src/components/tree/dialogs/TreeNodeInfoDialog.tsx +6 -2
- package/src/components/tree/renderTreeCanvas.ts +2 -2
- package/src/model.ts +38 -19
- package/src/parseNewick.ts +7 -7
- package/src/parsers/ClustalMSA.ts +2 -2
- package/src/parsers/EmfMSA.ts +66 -0
- package/src/parsers/EmfTree.ts +9 -0
- package/src/parsers/FastaMSA.ts +2 -2
- package/src/parsers/StockholmMSA.ts +2 -2
- package/src/reparseTree.ts +3 -3
- package/src/util.ts +5 -5
- package/src/version.ts +1 -1
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { parseEmfAln } from 'emf-js'
|
|
2
|
+
import type { NodeWithIds } from '../util'
|
|
3
|
+
|
|
4
|
+
export default class EmfMSA {
|
|
5
|
+
private MSA: ReturnType<typeof parseEmfAln>
|
|
6
|
+
|
|
7
|
+
constructor(text: string) {
|
|
8
|
+
this.MSA = parseEmfAln(text)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
getMSA() {
|
|
12
|
+
return this.MSA
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
getRow(name: string): string {
|
|
16
|
+
return this.MSA.find(aln => aln.protein === name)?.seq || ''
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
getWidth() {
|
|
20
|
+
return this.MSA[0]!.seq.length
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
getRowData() {
|
|
24
|
+
return undefined
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
getHeader() {
|
|
28
|
+
return ''
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
getNames() {
|
|
32
|
+
return this.MSA.map(aln => aln.protein)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
getStructures() {
|
|
36
|
+
return {}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
get alignmentNames() {
|
|
40
|
+
return []
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
getTree(): NodeWithIds {
|
|
44
|
+
return {
|
|
45
|
+
id: 'root',
|
|
46
|
+
name: 'root',
|
|
47
|
+
noTree: true,
|
|
48
|
+
children: this.getNames().map(name => ({
|
|
49
|
+
id: name,
|
|
50
|
+
name,
|
|
51
|
+
children: [],
|
|
52
|
+
})),
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
get seqConsensus() {
|
|
57
|
+
return undefined
|
|
58
|
+
}
|
|
59
|
+
get secondaryStructureConsensus() {
|
|
60
|
+
return undefined
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
get tracks() {
|
|
64
|
+
return []
|
|
65
|
+
}
|
|
66
|
+
}
|
package/src/parsers/FastaMSA.ts
CHANGED
|
@@ -100,9 +100,9 @@ export default class StockholmMSA {
|
|
|
100
100
|
id: 'root',
|
|
101
101
|
name: 'root',
|
|
102
102
|
noTree: true,
|
|
103
|
-
|
|
103
|
+
children: this.getNames().map(name => ({
|
|
104
104
|
id: name,
|
|
105
|
-
|
|
105
|
+
children: [],
|
|
106
106
|
name,
|
|
107
107
|
})),
|
|
108
108
|
}
|
package/src/reparseTree.ts
CHANGED
|
@@ -3,11 +3,11 @@ import type { NodeWithIds } from './util'
|
|
|
3
3
|
export function reparseTree(tree: NodeWithIds): NodeWithIds {
|
|
4
4
|
return {
|
|
5
5
|
...tree,
|
|
6
|
-
|
|
7
|
-
r.
|
|
6
|
+
children: tree.children.map(r =>
|
|
7
|
+
r.children.length
|
|
8
8
|
? reparseTree(r)
|
|
9
9
|
: {
|
|
10
|
-
|
|
10
|
+
children: [r],
|
|
11
11
|
id: `${r.id}-leafnode`,
|
|
12
12
|
name: `${r.name}-hidden`,
|
|
13
13
|
},
|
package/src/util.ts
CHANGED
|
@@ -14,7 +14,7 @@ export function transform<T>(
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
interface Node {
|
|
17
|
-
|
|
17
|
+
children?: Node[]
|
|
18
18
|
name?: string
|
|
19
19
|
[key: string]: unknown
|
|
20
20
|
}
|
|
@@ -22,7 +22,7 @@ interface Node {
|
|
|
22
22
|
export interface NodeWithIds {
|
|
23
23
|
id: string
|
|
24
24
|
name: string
|
|
25
|
-
|
|
25
|
+
children: NodeWithIds[]
|
|
26
26
|
length?: number
|
|
27
27
|
noTree?: boolean
|
|
28
28
|
}
|
|
@@ -30,7 +30,7 @@ export interface NodeWithIds {
|
|
|
30
30
|
export interface NodeWithIdsAndLength {
|
|
31
31
|
id: string
|
|
32
32
|
name: string
|
|
33
|
-
|
|
33
|
+
children: NodeWithIdsAndLength[]
|
|
34
34
|
noTree?: boolean
|
|
35
35
|
length: number
|
|
36
36
|
}
|
|
@@ -46,8 +46,8 @@ export function generateNodeIds(
|
|
|
46
46
|
...tree,
|
|
47
47
|
id,
|
|
48
48
|
name: tree.name || id,
|
|
49
|
-
|
|
50
|
-
tree.
|
|
49
|
+
children:
|
|
50
|
+
tree.children?.map((b, i) =>
|
|
51
51
|
generateNodeIds(b, `${id}-${i}`, depth + 1),
|
|
52
52
|
) || [],
|
|
53
53
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '3.2.
|
|
1
|
+
export const version = '3.2.2'
|