msa-parsers 1.0.5 → 5.0.3
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/LICENSE +21 -0
- package/README.md +89 -0
- package/dist/gff/gffToInterPro.d.ts +1 -1
- package/dist/gff/index.d.ts +3 -3
- package/dist/gff/index.js +3 -3
- package/dist/gff/index.js.map +1 -1
- package/dist/gff/interProToGFF.d.ts +1 -1
- package/dist/gff/parseGFF.d.ts +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/msa/A3mMSA.d.ts +1 -1
- package/dist/msa/ClustalMSA.d.ts +1 -1
- package/dist/msa/EmfMSA.d.ts +1 -1
- package/dist/msa/FastaMSA.d.ts +1 -1
- package/dist/msa/StockholmMSA.d.ts +3 -3
- package/dist/msa/StockholmMSA.js +4 -4
- package/dist/msa/StockholmMSA.js.map +1 -1
- package/dist/msa/index.d.ts +11 -11
- package/dist/msa/index.js +11 -11
- package/dist/msa/index.js.map +1 -1
- package/dist/util.d.ts +1 -1
- package/package.json +19 -10
- package/src/gff/gffToInterPro.test.ts +2 -2
- package/src/gff/gffToInterPro.ts +1 -1
- package/src/gff/index.ts +3 -3
- package/src/gff/interProToGFF.test.ts +2 -2
- package/src/gff/interProToGFF.ts +1 -1
- package/src/gff/parseGFF.test.ts +1 -1
- package/src/gff/parseGFF.ts +1 -1
- package/src/index.ts +5 -5
- package/src/msa/A3mMSA.test.ts +1 -1
- package/src/msa/A3mMSA.ts +1 -1
- package/src/msa/ClustalMSA.ts +1 -1
- package/src/msa/EmfMSA.ts +1 -1
- package/src/msa/FastaMSA.ts +1 -1
- package/src/msa/StockholmMSA.ts +6 -6
- package/src/msa/index.test.ts +4 -4
- package/src/msa/index.ts +11 -11
- package/src/msa/stockholmParser.test.ts +1 -1
- package/src/util.ts +1 -1
- package/dist/gff/gffToInterPro.test.d.ts +0 -1
- package/dist/gff/gffToInterPro.test.js +0 -181
- package/dist/gff/gffToInterPro.test.js.map +0 -1
- package/dist/gff/interProToGFF.test.d.ts +0 -1
- package/dist/gff/interProToGFF.test.js +0 -189
- package/dist/gff/interProToGFF.test.js.map +0 -1
- package/dist/gff/parseGFF.test.d.ts +0 -1
- package/dist/gff/parseGFF.test.js +0 -92
- package/dist/gff/parseGFF.test.js.map +0 -1
- package/dist/msa/A3mMSA.test.d.ts +0 -1
- package/dist/msa/A3mMSA.test.js +0 -155
- package/dist/msa/A3mMSA.test.js.map +0 -1
- package/dist/msa/index.test.d.ts +0 -1
- package/dist/msa/index.test.js +0 -60
- package/dist/msa/index.test.js.map +0 -1
- package/dist/msa/stockholmParser.test.d.ts +0 -1
- package/dist/msa/stockholmParser.test.js +0 -111
- package/dist/msa/stockholmParser.test.js.map +0 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Colin Diesh
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# msa-parsers
|
|
2
|
+
|
|
3
|
+
A TypeScript library for parsing multiple sequence alignment (MSA) files and
|
|
4
|
+
related formats.
|
|
5
|
+
|
|
6
|
+
Part of [react-msaview](../) (JBrowseMSA).
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install msa-parsers
|
|
12
|
+
# or
|
|
13
|
+
yarn add msa-parsers
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Supported formats
|
|
17
|
+
|
|
18
|
+
### MSA formats
|
|
19
|
+
|
|
20
|
+
- **Stockholm** - Stockholm format (used by Pfam, Rfam)
|
|
21
|
+
- **FASTA** - Aligned FASTA format
|
|
22
|
+
- **Clustal** - ClustalW/ClustalX format
|
|
23
|
+
- **A3M** - A3M format (used by HHsuite)
|
|
24
|
+
- **EMF** - Ensembl Multi Format
|
|
25
|
+
|
|
26
|
+
### Other formats
|
|
27
|
+
|
|
28
|
+
- **Newick** - Phylogenetic tree format
|
|
29
|
+
- **GFF** - General Feature Format (with InterProScan conversion utilities)
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
### Parsing MSA files
|
|
34
|
+
|
|
35
|
+
The `parseMSA` function auto-detects the format:
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { parseMSA } from 'msa-parsers'
|
|
39
|
+
|
|
40
|
+
const msa = parseMSA(fileContents)
|
|
41
|
+
|
|
42
|
+
// Get sequence names
|
|
43
|
+
const names = msa.getNames()
|
|
44
|
+
|
|
45
|
+
// Get a specific row
|
|
46
|
+
const sequence = msa.getRow('sequence_name')
|
|
47
|
+
|
|
48
|
+
// Get alignment width
|
|
49
|
+
const width = msa.getWidth()
|
|
50
|
+
|
|
51
|
+
// Get phylogenetic tree (if available)
|
|
52
|
+
const tree = msa.getTree()
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Using specific parsers
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
import { FastaMSA, StockholmMSA, ClustalMSA } from 'msa-parsers'
|
|
59
|
+
|
|
60
|
+
const fasta = new FastaMSA(fastaContents)
|
|
61
|
+
const stockholm = new StockholmMSA(stockholmContents)
|
|
62
|
+
const clustal = new ClustalMSA(clustalContents)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Parsing Newick trees
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
import { parseNewick, generateNodeIds } from 'msa-parsers'
|
|
69
|
+
|
|
70
|
+
const tree = parseNewick('(A:0.1,B:0.2,(C:0.3,D:0.4):0.5);')
|
|
71
|
+
const treeWithIds = generateNodeIds(tree)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### GFF and InterProScan utilities
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
import { parseGFF, gffToInterProResults, interProToGFF } from 'msa-parsers'
|
|
78
|
+
|
|
79
|
+
// Parse GFF file
|
|
80
|
+
const records = parseGFF(gffContents)
|
|
81
|
+
|
|
82
|
+
// Convert between GFF and InterProScan formats
|
|
83
|
+
const interProResults = gffToInterProResults(records)
|
|
84
|
+
const gffString = interProToGFF(interProResults, seqId)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## License
|
|
88
|
+
|
|
89
|
+
MIT
|
package/dist/gff/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { parseGFF } from './parseGFF';
|
|
2
|
-
export { gffToInterProResponse, gffToInterProResults } from './gffToInterPro';
|
|
3
|
-
export { interProResponseToGFF, interProToGFF } from './interProToGFF';
|
|
1
|
+
export { parseGFF } from './parseGFF.ts';
|
|
2
|
+
export { gffToInterProResponse, gffToInterProResults } from './gffToInterPro.ts';
|
|
3
|
+
export { interProResponseToGFF, interProToGFF } from './interProToGFF.ts';
|
package/dist/gff/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { parseGFF } from
|
|
2
|
-
export { gffToInterProResponse, gffToInterProResults } from
|
|
3
|
-
export { interProResponseToGFF, interProToGFF } from
|
|
1
|
+
export { parseGFF } from "./parseGFF.js";
|
|
2
|
+
export { gffToInterProResponse, gffToInterProResults } from "./gffToInterPro.js";
|
|
3
|
+
export { interProResponseToGFF, interProToGFF } from "./interProToGFF.js";
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/dist/gff/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/gff/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/gff/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAA;AAChF,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA"}
|
package/dist/gff/parseGFF.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { GFFRecord } from '../types';
|
|
1
|
+
import type { GFFRecord } from '../types.ts';
|
|
2
2
|
export declare function parseGFF(str?: string): GFFRecord[];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './types';
|
|
2
|
-
export { generateNodeIds } from './util';
|
|
3
|
-
export { A3mMSA, ClustalMSA, EmfMSA, FastaMSA, StockholmMSA, getUngappedSequence, parseEmfTree, parseMSA, parseNewick, stockholmSniff, } from './msa';
|
|
4
|
-
export type { MSAParserType } from './msa';
|
|
5
|
-
export { gffToInterProResponse, gffToInterProResults, interProResponseToGFF, interProToGFF, parseGFF, } from './gff';
|
|
1
|
+
export * from './types.ts';
|
|
2
|
+
export { generateNodeIds } from './util.ts';
|
|
3
|
+
export { A3mMSA, ClustalMSA, EmfMSA, FastaMSA, StockholmMSA, getUngappedSequence, parseEmfTree, parseMSA, parseNewick, stockholmSniff, } from './msa/index.ts';
|
|
4
|
+
export type { MSAParserType } from './msa/index.ts';
|
|
5
|
+
export { gffToInterProResponse, gffToInterProResults, interProResponseToGFF, interProToGFF, parseGFF, } from './gff/index.ts';
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Types
|
|
2
|
-
export * from
|
|
2
|
+
export * from "./types.js";
|
|
3
3
|
// Utilities
|
|
4
|
-
export { generateNodeIds } from
|
|
4
|
+
export { generateNodeIds } from "./util.js";
|
|
5
5
|
// MSA parsers
|
|
6
|
-
export { A3mMSA, ClustalMSA, EmfMSA, FastaMSA, StockholmMSA, getUngappedSequence, parseEmfTree, parseMSA, parseNewick, stockholmSniff, } from
|
|
6
|
+
export { A3mMSA, ClustalMSA, EmfMSA, FastaMSA, StockholmMSA, getUngappedSequence, parseEmfTree, parseMSA, parseNewick, stockholmSniff, } from "./msa/index.js";
|
|
7
7
|
// GFF parsing
|
|
8
|
-
export { gffToInterProResponse, gffToInterProResults, interProResponseToGFF, interProToGFF, parseGFF, } from
|
|
8
|
+
export { gffToInterProResponse, gffToInterProResults, interProResponseToGFF, interProToGFF, parseGFF, } from "./gff/index.js";
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,YAAY,CAAA;AAE1B,YAAY;AACZ,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE3C,cAAc;AACd,OAAO,EACL,MAAM,EACN,UAAU,EACV,MAAM,EACN,QAAQ,EACR,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,cAAc,GACf,MAAM,gBAAgB,CAAA;AAGvB,cAAc;AACd,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,EACb,QAAQ,GACT,MAAM,gBAAgB,CAAA"}
|
package/dist/msa/A3mMSA.d.ts
CHANGED
package/dist/msa/ClustalMSA.d.ts
CHANGED
package/dist/msa/EmfMSA.d.ts
CHANGED
package/dist/msa/FastaMSA.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { NodeWithIds } from '../types';
|
|
2
|
-
import type { StockholmData } from './stockholmParser';
|
|
1
|
+
import type { NodeWithIds } from '../types.ts';
|
|
2
|
+
import type { StockholmData } from './stockholmParser.ts';
|
|
3
3
|
export default class StockholmMSA {
|
|
4
4
|
private data;
|
|
5
5
|
private MSA;
|
|
@@ -51,4 +51,4 @@ export default class StockholmMSA {
|
|
|
51
51
|
};
|
|
52
52
|
})[];
|
|
53
53
|
}
|
|
54
|
-
export { sniff as stockholmSniff } from './stockholmParser';
|
|
54
|
+
export { sniff as stockholmSniff } from './stockholmParser.ts';
|
package/dist/msa/StockholmMSA.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import parseNewick from
|
|
2
|
-
import { parseAll } from
|
|
3
|
-
import { generateNodeIds } from
|
|
1
|
+
import parseNewick from "./parseNewick.js";
|
|
2
|
+
import { parseAll } from "./stockholmParser.js";
|
|
3
|
+
import { generateNodeIds } from "../util.js";
|
|
4
4
|
export default class StockholmMSA {
|
|
5
5
|
data;
|
|
6
6
|
MSA;
|
|
@@ -109,5 +109,5 @@ export default class StockholmMSA {
|
|
|
109
109
|
];
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
export { sniff as stockholmSniff } from
|
|
112
|
+
export { sniff as stockholmSniff } from "./stockholmParser.js";
|
|
113
113
|
//# sourceMappingURL=StockholmMSA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StockholmMSA.js","sourceRoot":"","sources":["../../src/msa/StockholmMSA.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,
|
|
1
|
+
{"version":3,"file":"StockholmMSA.js","sourceRoot":"","sources":["../../src/msa/StockholmMSA.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAK5C,MAAM,CAAC,OAAO,OAAO,YAAY;IACvB,IAAI,CAAiB;IACrB,GAAG,CAAe;IAE1B,YAAY,IAAY,EAAE,gBAAwB;QAChD,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;QAC1B,IAAI,CAAC,IAAI,GAAG,GAAG,CAAA;QACf,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC,gBAAgB,CAAE,CAAA;IACnC,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,GAAG,CAAA;IACjB,CAAC;IAED,MAAM,CAAC,IAAY;QACjB,OAAO,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA;IACrC,CAAC;IAED,QAAQ;QACN,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAE,CAAA;QAC9C,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAA;IACjC,CAAC;IAED,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CA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SA from './A3mMSA';
|
|
2
|
-
import ClustalMSA from './ClustalMSA';
|
|
3
|
-
import EmfMSA from './EmfMSA';
|
|
4
|
-
import FastaMSA from './FastaMSA';
|
|
5
|
-
import StockholmMSA from './StockholmMSA';
|
|
1
|
+
import A3mMSA from './A3mMSA.ts';
|
|
2
|
+
import ClustalMSA from './ClustalMSA.ts';
|
|
3
|
+
import EmfMSA from './EmfMSA.ts';
|
|
4
|
+
import FastaMSA from './FastaMSA.ts';
|
|
5
|
+
import StockholmMSA from './StockholmMSA.ts';
|
|
6
6
|
export { parseEmfTree } from 'emf-js';
|
|
7
|
-
export { default as parseNewick } from './parseNewick';
|
|
7
|
+
export { default as parseNewick } from './parseNewick.ts';
|
|
8
8
|
export type MSAParserType = StockholmMSA | A3mMSA | FastaMSA | EmfMSA | ClustalMSA;
|
|
9
9
|
export declare function parseMSA(text: string, currentAlignment?: number): MSAParserType;
|
|
10
10
|
/**
|
|
11
11
|
* Get ungapped sequence from an aligned row
|
|
12
12
|
*/
|
|
13
13
|
export declare function getUngappedSequence(alignedSeq: string): string;
|
|
14
|
-
export { default as A3mMSA } from './A3mMSA';
|
|
15
|
-
export { default as ClustalMSA } from './ClustalMSA';
|
|
16
|
-
export { default as EmfMSA } from './EmfMSA';
|
|
17
|
-
export { default as FastaMSA } from './FastaMSA';
|
|
18
|
-
export { default as StockholmMSA, stockholmSniff } from './StockholmMSA';
|
|
14
|
+
export { default as A3mMSA } from './A3mMSA.ts';
|
|
15
|
+
export { default as ClustalMSA } from './ClustalMSA.ts';
|
|
16
|
+
export { default as EmfMSA } from './EmfMSA.ts';
|
|
17
|
+
export { default as FastaMSA } from './FastaMSA.ts';
|
|
18
|
+
export { default as StockholmMSA, stockholmSniff } from './StockholmMSA.ts';
|
package/dist/msa/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import A3mMSA from
|
|
2
|
-
import ClustalMSA from
|
|
3
|
-
import EmfMSA from
|
|
4
|
-
import FastaMSA from
|
|
5
|
-
import StockholmMSA, { stockholmSniff } from
|
|
1
|
+
import A3mMSA from "./A3mMSA.js";
|
|
2
|
+
import ClustalMSA from "./ClustalMSA.js";
|
|
3
|
+
import EmfMSA from "./EmfMSA.js";
|
|
4
|
+
import FastaMSA from "./FastaMSA.js";
|
|
5
|
+
import StockholmMSA, { stockholmSniff } from "./StockholmMSA.js";
|
|
6
6
|
export { parseEmfTree } from 'emf-js';
|
|
7
|
-
export { default as parseNewick } from
|
|
7
|
+
export { default as parseNewick } from "./parseNewick.js";
|
|
8
8
|
export function parseMSA(text, currentAlignment = 0) {
|
|
9
9
|
if (stockholmSniff(text)) {
|
|
10
10
|
return new StockholmMSA(text, currentAlignment);
|
|
@@ -26,9 +26,9 @@ export function parseMSA(text, currentAlignment = 0) {
|
|
|
26
26
|
export function getUngappedSequence(alignedSeq) {
|
|
27
27
|
return alignedSeq.replaceAll(/[.-]/g, '');
|
|
28
28
|
}
|
|
29
|
-
export { default as A3mMSA } from
|
|
30
|
-
export { default as ClustalMSA } from
|
|
31
|
-
export { default as EmfMSA } from
|
|
32
|
-
export { default as FastaMSA } from
|
|
33
|
-
export { default as StockholmMSA, stockholmSniff } from
|
|
29
|
+
export { default as A3mMSA } from "./A3mMSA.js";
|
|
30
|
+
export { default as ClustalMSA } from "./ClustalMSA.js";
|
|
31
|
+
export { default as EmfMSA } from "./EmfMSA.js";
|
|
32
|
+
export { default as FastaMSA } from "./FastaMSA.js";
|
|
33
|
+
export { default as StockholmMSA, stockholmSniff } from "./StockholmMSA.js";
|
|
34
34
|
//# sourceMappingURL=index.js.map
|
package/dist/msa/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/msa/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/msa/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CA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AAO,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA"}
|
package/dist/util.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Node, NodeWithIds } from './types';
|
|
1
|
+
import type { Node, NodeWithIds } from './types.ts';
|
|
2
2
|
export declare function generateNodeIds(tree: Node, parent?: string, depth?: number): NodeWithIds;
|
package/package.json
CHANGED
|
@@ -1,25 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "msa-parsers",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.3",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"default": "./dist/index.js"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
7
12
|
"types": "dist/index.d.ts",
|
|
8
13
|
"files": [
|
|
9
14
|
"dist",
|
|
10
15
|
"src"
|
|
11
16
|
],
|
|
12
|
-
"scripts": {
|
|
13
|
-
"clean": "rimraf dist",
|
|
14
|
-
"build": "tsc",
|
|
15
|
-
"watch": "tsc --watch",
|
|
16
|
-
"test": "vitest"
|
|
17
|
-
},
|
|
18
17
|
"dependencies": {
|
|
19
18
|
"clustal-js": "^2.0.13",
|
|
20
19
|
"emf-js": "^2.0.0"
|
|
21
20
|
},
|
|
22
21
|
"publishConfig": {
|
|
23
22
|
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"typescript": "^5.9.3",
|
|
26
|
+
"vitest": "^4.0.18"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"clean": "rimraf dist",
|
|
30
|
+
"build": "tsc",
|
|
31
|
+
"watch": "tsc --watch",
|
|
32
|
+
"test": "vitest"
|
|
24
33
|
}
|
|
25
|
-
}
|
|
34
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { describe, expect, test } from 'vitest'
|
|
2
2
|
|
|
3
|
-
import { gffToInterProResponse, gffToInterProResults } from './gffToInterPro'
|
|
3
|
+
import { gffToInterProResponse, gffToInterProResults } from './gffToInterPro.ts'
|
|
4
4
|
|
|
5
|
-
import type { GFFRecord } from '../types'
|
|
5
|
+
import type { GFFRecord } from '../types.ts'
|
|
6
6
|
|
|
7
7
|
describe('gffToInterProResults', () => {
|
|
8
8
|
test('converts empty array', () => {
|
package/src/gff/gffToInterPro.ts
CHANGED
package/src/gff/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { parseGFF } from './parseGFF'
|
|
2
|
-
export { gffToInterProResponse, gffToInterProResults } from './gffToInterPro'
|
|
3
|
-
export { interProResponseToGFF, interProToGFF } from './interProToGFF'
|
|
1
|
+
export { parseGFF } from './parseGFF.ts'
|
|
2
|
+
export { gffToInterProResponse, gffToInterProResults } from './gffToInterPro.ts'
|
|
3
|
+
export { interProResponseToGFF, interProToGFF } from './interProToGFF.ts'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { describe, expect, test } from 'vitest'
|
|
2
2
|
|
|
3
|
-
import { interProResponseToGFF, interProToGFF } from './interProToGFF'
|
|
3
|
+
import { interProResponseToGFF, interProToGFF } from './interProToGFF.ts'
|
|
4
4
|
|
|
5
|
-
import type { InterProScanResults } from '../types'
|
|
5
|
+
import type { InterProScanResults } from '../types.ts'
|
|
6
6
|
|
|
7
7
|
describe('interProToGFF', () => {
|
|
8
8
|
test('converts empty results', () => {
|
package/src/gff/interProToGFF.ts
CHANGED
package/src/gff/parseGFF.test.ts
CHANGED
package/src/gff/parseGFF.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Types
|
|
2
|
-
export * from './types'
|
|
2
|
+
export * from './types.ts'
|
|
3
3
|
|
|
4
4
|
// Utilities
|
|
5
|
-
export { generateNodeIds } from './util'
|
|
5
|
+
export { generateNodeIds } from './util.ts'
|
|
6
6
|
|
|
7
7
|
// MSA parsers
|
|
8
8
|
export {
|
|
@@ -16,8 +16,8 @@ export {
|
|
|
16
16
|
parseMSA,
|
|
17
17
|
parseNewick,
|
|
18
18
|
stockholmSniff,
|
|
19
|
-
} from './msa'
|
|
20
|
-
export type { MSAParserType } from './msa'
|
|
19
|
+
} from './msa/index.ts'
|
|
20
|
+
export type { MSAParserType } from './msa/index.ts'
|
|
21
21
|
|
|
22
22
|
// GFF parsing
|
|
23
23
|
export {
|
|
@@ -26,4 +26,4 @@ export {
|
|
|
26
26
|
interProResponseToGFF,
|
|
27
27
|
interProToGFF,
|
|
28
28
|
parseGFF,
|
|
29
|
-
} from './gff'
|
|
29
|
+
} from './gff/index.ts'
|
package/src/msa/A3mMSA.test.ts
CHANGED
package/src/msa/A3mMSA.ts
CHANGED
package/src/msa/ClustalMSA.ts
CHANGED
package/src/msa/EmfMSA.ts
CHANGED
package/src/msa/FastaMSA.ts
CHANGED
package/src/msa/StockholmMSA.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import parseNewick from './parseNewick'
|
|
2
|
-
import { parseAll } from './stockholmParser'
|
|
3
|
-
import { generateNodeIds } from '../util'
|
|
1
|
+
import parseNewick from './parseNewick.ts'
|
|
2
|
+
import { parseAll } from './stockholmParser.ts'
|
|
3
|
+
import { generateNodeIds } from '../util.ts'
|
|
4
4
|
|
|
5
|
-
import type { NodeWithIds } from '../types'
|
|
6
|
-
import type { StockholmData } from './stockholmParser'
|
|
5
|
+
import type { NodeWithIds } from '../types.ts'
|
|
6
|
+
import type { StockholmData } from './stockholmParser.ts'
|
|
7
7
|
|
|
8
8
|
export default class StockholmMSA {
|
|
9
9
|
private data: StockholmData[]
|
|
@@ -138,4 +138,4 @@ export default class StockholmMSA {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
export { sniff as stockholmSniff } from './stockholmParser'
|
|
141
|
+
export { sniff as stockholmSniff } from './stockholmParser.ts'
|
package/src/msa/index.test.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { describe, expect, test } from 'vitest'
|
|
2
2
|
|
|
3
|
-
import A3mMSA from './A3mMSA'
|
|
4
|
-
import ClustalMSA from './ClustalMSA'
|
|
5
|
-
import FastaMSA from './FastaMSA'
|
|
6
|
-
import { getUngappedSequence, parseMSA } from './index'
|
|
3
|
+
import A3mMSA from './A3mMSA.ts'
|
|
4
|
+
import ClustalMSA from './ClustalMSA.ts'
|
|
5
|
+
import FastaMSA from './FastaMSA.ts'
|
|
6
|
+
import { getUngappedSequence, parseMSA } from './index.ts'
|
|
7
7
|
|
|
8
8
|
describe('parseMSA', () => {
|
|
9
9
|
test('parses FASTA format', () => {
|
package/src/msa/index.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import A3mMSA from './A3mMSA'
|
|
2
|
-
import ClustalMSA from './ClustalMSA'
|
|
3
|
-
import EmfMSA from './EmfMSA'
|
|
4
|
-
import FastaMSA from './FastaMSA'
|
|
5
|
-
import StockholmMSA, { stockholmSniff } from './StockholmMSA'
|
|
1
|
+
import A3mMSA from './A3mMSA.ts'
|
|
2
|
+
import ClustalMSA from './ClustalMSA.ts'
|
|
3
|
+
import EmfMSA from './EmfMSA.ts'
|
|
4
|
+
import FastaMSA from './FastaMSA.ts'
|
|
5
|
+
import StockholmMSA, { stockholmSniff } from './StockholmMSA.ts'
|
|
6
6
|
|
|
7
7
|
export { parseEmfTree } from 'emf-js'
|
|
8
|
-
export { default as parseNewick } from './parseNewick'
|
|
8
|
+
export { default as parseNewick } from './parseNewick.ts'
|
|
9
9
|
|
|
10
10
|
export type MSAParserType =
|
|
11
11
|
| StockholmMSA
|
|
@@ -37,8 +37,8 @@ export function getUngappedSequence(alignedSeq: string): string {
|
|
|
37
37
|
return alignedSeq.replaceAll(/[.-]/g, '')
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
export { default as A3mMSA } from './A3mMSA'
|
|
41
|
-
export { default as ClustalMSA } from './ClustalMSA'
|
|
42
|
-
export { default as EmfMSA } from './EmfMSA'
|
|
43
|
-
export { default as FastaMSA } from './FastaMSA'
|
|
44
|
-
export { default as StockholmMSA, stockholmSniff } from './StockholmMSA'
|
|
40
|
+
export { default as A3mMSA } from './A3mMSA.ts'
|
|
41
|
+
export { default as ClustalMSA } from './ClustalMSA.ts'
|
|
42
|
+
export { default as EmfMSA } from './EmfMSA.ts'
|
|
43
|
+
export { default as FastaMSA } from './FastaMSA.ts'
|
|
44
|
+
export { default as StockholmMSA, stockholmSniff } from './StockholmMSA.ts'
|
package/src/util.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|