msa-parsers 7.0.0 → 8.1.0
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/README.md +4 -4
- package/dist/gff/gffToAnnotations.js +33 -0
- package/dist/gff/gffToAnnotations.js.map +1 -1
- package/dist/msa/BaseMSA.d.ts +3 -7
- package/dist/msa/BaseMSA.js +3 -7
- package/dist/msa/BaseMSA.js.map +1 -1
- package/dist/msa/stockholmParser.js +3 -0
- package/dist/msa/stockholmParser.js.map +1 -1
- package/dist/types.d.ts +7 -0
- package/package.json +3 -3
- package/src/gff/gffToAnnotations.test.ts +34 -0
- package/src/gff/gffToAnnotations.ts +39 -0
- package/src/msa/BaseMSA.ts +3 -7
- package/src/msa/stockholmParser.test.ts +11 -0
- package/src/msa/stockholmParser.ts +3 -0
- package/src/types.ts +7 -0
package/README.md
CHANGED
|
@@ -30,9 +30,9 @@ pnpm add msa-parsers
|
|
|
30
30
|
|
|
31
31
|
### Parsing MSA files
|
|
32
32
|
|
|
33
|
-
`parseMSA` sniffs the format from the content, not from the file name.
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
`parseMSA` sniffs the format from the content, not from the file name. FASTA and
|
|
34
|
+
A3M share a leading `>`, so telling them apart is heuristic; pass a format as
|
|
35
|
+
the third argument to override the guess:
|
|
36
36
|
|
|
37
37
|
```typescript
|
|
38
38
|
import { parseMSA } from 'msa-parsers'
|
|
@@ -77,7 +77,7 @@ const treeWithIds = generateNodeIds(tree)
|
|
|
77
77
|
|
|
78
78
|
Every source of overlay annotations converts to one flat list of `Annotation` (a
|
|
79
79
|
row name, an accession, a name, a description and a 1-based inclusive interval),
|
|
80
|
-
and
|
|
80
|
+
and the viewer draws that list.
|
|
81
81
|
|
|
82
82
|
```typescript
|
|
83
83
|
import {
|
|
@@ -22,6 +22,37 @@ function geneStrand({ type, strand }) {
|
|
|
22
22
|
const directional = strand === '+' ? 1 : strand === '-' ? -1 : undefined;
|
|
23
23
|
return GENE_LEVEL_TYPES.has(type) ? directional : undefined;
|
|
24
24
|
}
|
|
25
|
+
// The nine columns a feature line holds; every other key of a record came from
|
|
26
|
+
// column 9
|
|
27
|
+
const GFF_COLUMNS = new Set([
|
|
28
|
+
'seq_id',
|
|
29
|
+
'source',
|
|
30
|
+
'type',
|
|
31
|
+
'start',
|
|
32
|
+
'end',
|
|
33
|
+
'score',
|
|
34
|
+
'strand',
|
|
35
|
+
'phase',
|
|
36
|
+
]);
|
|
37
|
+
function attributesOf(record) {
|
|
38
|
+
const entries = Object.entries(record).filter(([key, value]) => !GFF_COLUMNS.has(key) && typeof value === 'string');
|
|
39
|
+
return entries.length > 0 ? Object.fromEntries(entries) : undefined;
|
|
40
|
+
}
|
|
41
|
+
// JBrowse and IGV read an RGB triple as well as a named or hex color, and the
|
|
42
|
+
// attribute parser has already turned `255,0,0` into `255 0 0` by splitting on
|
|
43
|
+
// the GFF3 multi-value comma
|
|
44
|
+
const RGB_TRIPLE = /^(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})$/;
|
|
45
|
+
function cssColor(record) {
|
|
46
|
+
const value = (record.color ??
|
|
47
|
+
record.colour ??
|
|
48
|
+
record.Color ??
|
|
49
|
+
record.Colour);
|
|
50
|
+
if (!value) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
const triple = RGB_TRIPLE.exec(value.trim());
|
|
54
|
+
return triple ? `rgb(${triple[1]},${triple[2]},${triple[3]})` : value.trim();
|
|
55
|
+
}
|
|
25
56
|
// InterProScan describes the sequence it scanned before listing the matches
|
|
26
57
|
// against it. Those lines span the whole row and carry no signature, so they
|
|
27
58
|
// would draw a full-width block labelled by an md5.
|
|
@@ -58,6 +89,8 @@ export function gffToAnnotations(gffRecords) {
|
|
|
58
89
|
start: record.start,
|
|
59
90
|
end: record.end,
|
|
60
91
|
strand: geneStrand(record),
|
|
92
|
+
color: cssColor(record),
|
|
93
|
+
attributes: attributesOf(record),
|
|
61
94
|
};
|
|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Aa,EAAE,cAAc,CAAC,CAAC,CAAA;AAErE;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,UAAuB;IACtD,OAAO,UAAU;SACd,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,oBAAoB,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;SACxD,GAAG,CAAC,MAAM,CAAC,EAAE;QACZ,MAAM,SAAS,GACZ,MAAM,CAAC,IAAe;YACtB,MAAM,CAAC,EAAa;YACrB,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,GAAG,EAAE,CAAA;QAClD,MAAM,IAAI,GACP,MAAM,CAAC,cAAyB;YAChC,MAAM,CAAC,IAAe;YACvB,SAAS,CAAA;QACX,OAAO;YACL,EAAE,EAAE,MAAM,CAAC,MAAM;YACjB,SAAS;YACT,IAAI;YACJ,kEAAkE;YAClE,4DAA4D;YAC5D,8CAA8C;YAC9C,WAAW,EACR,MAAM,CAAC,WAAsB;gBAC7B,MAAM,CAAC,IAAe;gBACtB,MAAM,CAAC,cAAyB;gBACjC,IAAI;YACN,WAAW,EAAE,MAAM,CAAC,IAAI;YACxB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,GAAG,EAAE,MAAM,CAAC,GAAG;YACf,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC;YAC1B,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC;YACvB,UAAU,EAAE,YAAY,CAAC,MAAM,CAAC;SACjC,CAAA;IACH,CAAC,CAAC,CAAA;AACN,CAAC"}
|
package/dist/msa/BaseMSA.d.ts
CHANGED
|
@@ -5,13 +5,9 @@ export default abstract class BaseMSA {
|
|
|
5
5
|
abstract getNames(): string[];
|
|
6
6
|
private width?;
|
|
7
7
|
/**
|
|
8
|
-
* Column count of the alignment: the length of its widest row
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* an aligner that stops a row at its last residue -- and taking row 0 makes
|
|
12
|
-
* every column past it unreachable when row 0 is the short one. The viewer's
|
|
13
|
-
* gap analysis already defines the column count this way, so anything else
|
|
14
|
-
* disagrees with it.
|
|
8
|
+
* Column count of the alignment: the length of its widest row, since a
|
|
9
|
+
* hand-edited fasta or some aligners leave rows short. The viewer's gap
|
|
10
|
+
* analysis counts columns the same way.
|
|
15
11
|
*/
|
|
16
12
|
getWidth(): number;
|
|
17
13
|
getTree(): NodeWithIds;
|
package/dist/msa/BaseMSA.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
export default class BaseMSA {
|
|
2
2
|
width;
|
|
3
3
|
/**
|
|
4
|
-
* Column count of the alignment: the length of its widest row
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* an aligner that stops a row at its last residue -- and taking row 0 makes
|
|
8
|
-
* every column past it unreachable when row 0 is the short one. The viewer's
|
|
9
|
-
* gap analysis already defines the column count this way, so anything else
|
|
10
|
-
* disagrees with it.
|
|
4
|
+
* Column count of the alignment: the length of its widest row, since a
|
|
5
|
+
* hand-edited fasta or some aligners leave rows short. The viewer's gap
|
|
6
|
+
* analysis counts columns the same way.
|
|
11
7
|
*/
|
|
12
8
|
getWidth() {
|
|
13
9
|
this.width ??= this.getNames().reduce((max, name) => Math.max(max, this.getRow(name).length), 0);
|
package/dist/msa/BaseMSA.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseMSA.js","sourceRoot":"","sources":["../../src/msa/BaseMSA.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,OAAgB,OAAO;IAK3B,KAAK,CAAS;IAEtB
|
|
1
|
+
{"version":3,"file":"BaseMSA.js","sourceRoot":"","sources":["../../src/msa/BaseMSA.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,OAAgB,OAAO;IAK3B,KAAK,CAAS;IAEtB;;;;OAIG;IACH,QAAQ;QACN,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,QAAQ,EAAE,C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B,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAA;IAClD,CAAC;IACD,OAAO,EAAE,CAAC,CAAC,CAAE,CAAA;AACf,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -58,6 +58,13 @@ export interface Annotation {
|
|
|
58
58
|
start: number;
|
|
59
59
|
end: number;
|
|
60
60
|
strand?: number;
|
|
61
|
+
/**
|
|
62
|
+
* CSS color the feature carries itself, from a GFF3 `color=` attribute. It
|
|
63
|
+
* overrides the palette and any scale a channel resolves.
|
|
64
|
+
*/
|
|
65
|
+
color?: string;
|
|
66
|
+
/** the GFF attributes of column 9, for a channel encoding one of them */
|
|
67
|
+
attributes?: Record<string, string>;
|
|
61
68
|
}
|
|
62
69
|
/**
|
|
63
70
|
* One signature hit. `entry` is the InterPro entry the signature is integrated
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "msa-parsers",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.1.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@gmod/newick": "^1.0.3",
|
|
24
|
-
"clustal-js": "^2.0.
|
|
24
|
+
"clustal-js": "^2.0.18",
|
|
25
25
|
"emf-js": "^2.0.0"
|
|
26
26
|
},
|
|
27
27
|
"publishConfig": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"typescript": "^7.0.2",
|
|
32
|
-
"vitest": "^
|
|
32
|
+
"vitest": "^5.0.0"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"clean": "rimraf dist",
|
|
@@ -41,6 +41,12 @@ test('maps a record onto the annotation fields', () => {
|
|
|
41
41
|
start: 10,
|
|
42
42
|
end: 50,
|
|
43
43
|
strand: undefined,
|
|
44
|
+
color: undefined,
|
|
45
|
+
attributes: {
|
|
46
|
+
Name: 'PF00001',
|
|
47
|
+
signature_desc: '7tm_1',
|
|
48
|
+
description: 'GPCR family',
|
|
49
|
+
},
|
|
44
50
|
},
|
|
45
51
|
])
|
|
46
52
|
})
|
|
@@ -104,3 +110,31 @@ test('falls back from Name to ID to source and positions', () => {
|
|
|
104
110
|
]).map(a => a.accession),
|
|
105
111
|
).toEqual(['domain_123', 'CustomSource_10_50'])
|
|
106
112
|
})
|
|
113
|
+
|
|
114
|
+
test('keeps the column 9 attributes, so a channel can encode one of them', () => {
|
|
115
|
+
expect(
|
|
116
|
+
gffToAnnotations([record({ type: 'gene', Name: 'trpB', gene: 'trpB' })])[0]
|
|
117
|
+
?.attributes,
|
|
118
|
+
).toEqual({ Name: 'trpB', gene: 'trpB' })
|
|
119
|
+
})
|
|
120
|
+
|
|
121
|
+
test('reads a color attribute under any of its spellings', () => {
|
|
122
|
+
expect(
|
|
123
|
+
gffToAnnotations([
|
|
124
|
+
record({ color: '#ff0000' }),
|
|
125
|
+
record({ colour: 'rebeccapurple' }),
|
|
126
|
+
record({ Color: '#00ff00' }),
|
|
127
|
+
record({ Colour: 'blue' }),
|
|
128
|
+
record({}),
|
|
129
|
+
]).map(a => a.color),
|
|
130
|
+
).toEqual(['#ff0000', 'rebeccapurple', '#00ff00', 'blue', undefined])
|
|
131
|
+
})
|
|
132
|
+
|
|
133
|
+
test('normalizes an RGB triple, which the attribute parser hands over space-separated', () => {
|
|
134
|
+
expect(
|
|
135
|
+
gffToAnnotations([
|
|
136
|
+
record({ color: '255 0 0' }),
|
|
137
|
+
record({ color: '0,128,255' }),
|
|
138
|
+
]).map(a => a.color),
|
|
139
|
+
).toEqual(['rgb(255,0,0)', 'rgb(0,128,255)'])
|
|
140
|
+
})
|
|
@@ -26,6 +26,43 @@ function geneStrand({ type, strand }: GFFRecord): number | undefined {
|
|
|
26
26
|
return GENE_LEVEL_TYPES.has(type) ? directional : undefined
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
// The nine columns a feature line holds; every other key of a record came from
|
|
30
|
+
// column 9
|
|
31
|
+
const GFF_COLUMNS = new Set([
|
|
32
|
+
'seq_id',
|
|
33
|
+
'source',
|
|
34
|
+
'type',
|
|
35
|
+
'start',
|
|
36
|
+
'end',
|
|
37
|
+
'score',
|
|
38
|
+
'strand',
|
|
39
|
+
'phase',
|
|
40
|
+
])
|
|
41
|
+
|
|
42
|
+
function attributesOf(record: GFFRecord) {
|
|
43
|
+
const entries = Object.entries(record).filter(
|
|
44
|
+
([key, value]) => !GFF_COLUMNS.has(key) && typeof value === 'string',
|
|
45
|
+
) as [string, string][]
|
|
46
|
+
return entries.length > 0 ? Object.fromEntries(entries) : undefined
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// JBrowse and IGV read an RGB triple as well as a named or hex color, and the
|
|
50
|
+
// attribute parser has already turned `255,0,0` into `255 0 0` by splitting on
|
|
51
|
+
// the GFF3 multi-value comma
|
|
52
|
+
const RGB_TRIPLE = /^(\d{1,3})[\s,]+(\d{1,3})[\s,]+(\d{1,3})$/
|
|
53
|
+
|
|
54
|
+
function cssColor(record: GFFRecord) {
|
|
55
|
+
const value = (record.color ??
|
|
56
|
+
record.colour ??
|
|
57
|
+
record.Color ??
|
|
58
|
+
record.Colour) as string | undefined
|
|
59
|
+
if (!value) {
|
|
60
|
+
return undefined
|
|
61
|
+
}
|
|
62
|
+
const triple = RGB_TRIPLE.exec(value.trim())
|
|
63
|
+
return triple ? `rgb(${triple[1]},${triple[2]},${triple[3]})` : value.trim()
|
|
64
|
+
}
|
|
65
|
+
|
|
29
66
|
// InterProScan describes the sequence it scanned before listing the matches
|
|
30
67
|
// against it. Those lines span the whole row and carry no signature, so they
|
|
31
68
|
// would draw a full-width block labelled by an md5.
|
|
@@ -66,6 +103,8 @@ export function gffToAnnotations(gffRecords: GFFRecord[]): Annotation[] {
|
|
|
66
103
|
start: record.start,
|
|
67
104
|
end: record.end,
|
|
68
105
|
strand: geneStrand(record),
|
|
106
|
+
color: cssColor(record),
|
|
107
|
+
attributes: attributesOf(record),
|
|
69
108
|
}
|
|
70
109
|
})
|
|
71
110
|
}
|
package/src/msa/BaseMSA.ts
CHANGED
|
@@ -8,13 +8,9 @@ export default abstract class BaseMSA {
|
|
|
8
8
|
private width?: number
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* Column count of the alignment: the length of its widest row
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* an aligner that stops a row at its last residue -- and taking row 0 makes
|
|
15
|
-
* every column past it unreachable when row 0 is the short one. The viewer's
|
|
16
|
-
* gap analysis already defines the column count this way, so anything else
|
|
17
|
-
* disagrees with it.
|
|
11
|
+
* Column count of the alignment: the length of its widest row, since a
|
|
12
|
+
* hand-edited fasta or some aligners leave rows short. The viewer's gap
|
|
13
|
+
* analysis counts columns the same way.
|
|
18
14
|
*/
|
|
19
15
|
getWidth(): number {
|
|
20
16
|
this.width ??= this.getNames().reduce(
|
|
@@ -133,6 +133,17 @@ seq2 GHIKL
|
|
|
133
133
|
})
|
|
134
134
|
})
|
|
135
135
|
|
|
136
|
+
test('a header ends the open alignment when its // is missing', () => {
|
|
137
|
+
const db = parseAll(`# STOCKHOLM 1.0
|
|
138
|
+
seq1 ACDEF
|
|
139
|
+
# STOCKHOLM 1.0
|
|
140
|
+
seq2 GHIKL
|
|
141
|
+
//`)
|
|
142
|
+
expect(db).toHaveLength(2)
|
|
143
|
+
expect(db[0]?.seqdata).toEqual({ seq1: 'ACDEF' })
|
|
144
|
+
expect(db[1]?.seqdata).toEqual({ seq2: 'GHIKL' })
|
|
145
|
+
})
|
|
146
|
+
|
|
136
147
|
test('joins a tree split across #=GF NH lines, starting a new one at TN', () => {
|
|
137
148
|
const [aln] = parseAll(`# STOCKHOLM 1.0
|
|
138
149
|
#=GF TN first
|
package/src/types.ts
CHANGED
|
@@ -64,6 +64,13 @@ export interface Annotation {
|
|
|
64
64
|
start: number
|
|
65
65
|
end: number
|
|
66
66
|
strand?: number
|
|
67
|
+
/**
|
|
68
|
+
* CSS color the feature carries itself, from a GFF3 `color=` attribute. It
|
|
69
|
+
* overrides the palette and any scale a channel resolves.
|
|
70
|
+
*/
|
|
71
|
+
color?: string
|
|
72
|
+
/** the GFF attributes of column 9, for a channel encoding one of them */
|
|
73
|
+
attributes?: Record<string, string>
|
|
67
74
|
}
|
|
68
75
|
|
|
69
76
|
/**
|