clustal-js
Advanced tools
Comparing version 2.0.1 to 2.0.2
export declare function parseClustalIter(arr: Iterator<string>): { | ||
consensus: string; | ||
alns: { | ||
id: any; | ||
seq: any; | ||
id: string; | ||
seq: string; | ||
}[]; | ||
@@ -12,8 +12,9 @@ header: { | ||
}; | ||
interface Row { | ||
id: string; | ||
seq: string; | ||
} | ||
export declare function parsePairwiseIter(arr: string): { | ||
consensus: string; | ||
alns: { | ||
id: any; | ||
seq: any; | ||
}[]; | ||
alns: [Row, Row]; | ||
}; | ||
@@ -23,4 +24,4 @@ export declare function parse(contents: string): { | ||
alns: { | ||
id: any; | ||
seq: any; | ||
id: string; | ||
seq: string; | ||
}[]; | ||
@@ -34,6 +35,4 @@ header: { | ||
consensus: string; | ||
alns: { | ||
id: any; | ||
seq: any; | ||
}[]; | ||
alns: [Row, Row]; | ||
}; | ||
export {}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.parsePairwise = exports.parse = exports.parsePairwiseIter = exports.parseClustalIter = void 0; | ||
exports.parseClustalIter = parseClustalIter; | ||
exports.parsePairwiseIter = parsePairwiseIter; | ||
exports.parse = parse; | ||
exports.parsePairwise = parsePairwise; | ||
const pairwise_1 = require("./pairwise"); | ||
@@ -23,3 +26,2 @@ const util_1 = require("./util"); | ||
} | ||
exports.parseClustalIter = parseClustalIter; | ||
function parsePairwiseIter(arr) { | ||
@@ -35,5 +37,10 @@ const res = (0, pairwise_1.parsePairwiseBlocks)(arr.split('\n')[Symbol.iterator]()); | ||
} | ||
return { consensus, alns }; | ||
if (alns.length !== 2) { | ||
throw new Error('More than two sequences in pairwise alignment'); | ||
} | ||
return { | ||
consensus, | ||
alns: alns, | ||
}; | ||
} | ||
exports.parsePairwiseIter = parsePairwiseIter; | ||
function parse(contents) { | ||
@@ -43,10 +50,8 @@ const iter = contents.split('\n')[Symbol.iterator](); | ||
} | ||
exports.parse = parse; | ||
function parsePairwise(contents) { | ||
const res = contents | ||
return parsePairwiseIter(contents | ||
.split('\n') | ||
.filter(f => !f.startsWith('#')) | ||
.join('\n'); | ||
return parsePairwiseIter(res); | ||
.join('\n')); | ||
} | ||
exports.parsePairwise = parsePairwise; | ||
//# sourceMappingURL=index.js.map |
export declare function getSeqBounds(line: string): readonly [number, number]; | ||
export declare function parsePairwiseBlock(arr: Iterator<string>): { | ||
ids: any[]; | ||
seqs: any[]; | ||
ids: string[]; | ||
seqs: string[]; | ||
consensus: string; | ||
} | undefined; | ||
export declare function parsePairwiseBlocks(arr: Iterator<string>): { | ||
ids: any[]; | ||
seqs: any[]; | ||
ids: string[]; | ||
seqs: string[]; | ||
consensus: string; | ||
} | undefined; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.parsePairwiseBlocks = exports.parsePairwiseBlock = exports.getSeqBounds = void 0; | ||
exports.getSeqBounds = getSeqBounds; | ||
exports.parsePairwiseBlock = parsePairwiseBlock; | ||
exports.parsePairwiseBlocks = parsePairwiseBlocks; | ||
const util_1 = require("./util"); | ||
@@ -13,3 +15,2 @@ function getSeqBounds(line) { | ||
} | ||
exports.getSeqBounds = getSeqBounds; | ||
// Use the first block to get the sequence identifiers | ||
@@ -24,7 +25,7 @@ function parsePairwiseBlock(arr) { | ||
while (line) { | ||
if (line[0] !== ' ') { | ||
block.push(line); | ||
if (line.startsWith(' ')) { | ||
consensusLine = line; | ||
} | ||
else { | ||
consensusLine = line; | ||
block.push(line); | ||
} | ||
@@ -45,3 +46,2 @@ line = arr.next().value; | ||
} | ||
exports.parsePairwiseBlock = parsePairwiseBlock; | ||
function parsePairwiseBlocks(arr) { | ||
@@ -60,2 +60,2 @@ let block; | ||
} | ||
exports.parsePairwiseBlocks = parsePairwiseBlocks; | ||
//# sourceMappingURL=pairwise.js.map |
@@ -6,13 +6,13 @@ export declare function parseVersion(line: string): string; | ||
}; | ||
export declare function getFirstNonEmptyLine(arr: Iterator<string>): any; | ||
export declare function getFirstNonEmptyLine(arr: Iterator<string>): string; | ||
export declare function getSeqBounds(line: string): readonly [number, number]; | ||
export declare function parseBlock(arr: Iterator<string>): { | ||
ids: any[]; | ||
seqs: any[]; | ||
ids: string[]; | ||
seqs: string[]; | ||
consensus: string; | ||
} | undefined; | ||
export declare function parseBlocks(arr: Iterator<string>): { | ||
ids: any[]; | ||
seqs: any[]; | ||
ids: string[]; | ||
seqs: string[]; | ||
consensus: string; | ||
} | undefined; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.parseBlocks = exports.parseBlock = exports.getSeqBounds = exports.getFirstNonEmptyLine = exports.parseHeader = exports.parseVersion = void 0; | ||
exports.parseVersion = parseVersion; | ||
exports.parseHeader = parseHeader; | ||
exports.getFirstNonEmptyLine = getFirstNonEmptyLine; | ||
exports.getSeqBounds = getSeqBounds; | ||
exports.parseBlock = parseBlock; | ||
exports.parseBlocks = parseBlocks; | ||
function parseVersion(line) { | ||
const res = line.match(/\(?(\d+(\.\d+)+)\)?/); | ||
const res = /\(?(\d+(\.\d+)+)\)?/.exec(line); | ||
return res && res.length > 1 ? res[1] : ''; | ||
} | ||
exports.parseVersion = parseVersion; | ||
function parseHeader(info) { | ||
@@ -17,3 +21,2 @@ const knownHeaders = ['CLUSTAL', 'PROBCONS', 'MUSCLE', 'MSAPROBS', 'Kalign']; | ||
} | ||
exports.parseHeader = parseHeader; | ||
function getFirstNonEmptyLine(arr) { | ||
@@ -27,3 +30,2 @@ // There should be two blank lines after the header line | ||
} | ||
exports.getFirstNonEmptyLine = getFirstNonEmptyLine; | ||
function getSeqBounds(line) { | ||
@@ -36,3 +38,2 @@ const fields = line.split(/\s+/); | ||
} | ||
exports.getSeqBounds = getSeqBounds; | ||
// Use the first block to get the sequence identifiers | ||
@@ -47,7 +48,7 @@ function parseBlock(arr) { | ||
while (line) { | ||
if (line[0] !== ' ') { | ||
block.push(line); | ||
if (line[0].startsWith(' ')) { | ||
consensusLine = line; | ||
} | ||
else { | ||
consensusLine = line; | ||
block.push(line); | ||
} | ||
@@ -68,3 +69,2 @@ line = arr.next().value; | ||
} | ||
exports.parseBlock = parseBlock; | ||
function parseBlocks(arr) { | ||
@@ -83,2 +83,2 @@ let block; | ||
} | ||
exports.parseBlocks = parseBlocks; | ||
//# sourceMappingURL=util.js.map |
{ | ||
"name": "clustal-js", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"main": "dist/index.js", | ||
"module": "esm/index.js", | ||
"repository": "cmdcolin/clustal-js", | ||
"files": [ | ||
"dist" | ||
"dist", | ||
"esm", | ||
"src" | ||
], | ||
@@ -12,19 +15,21 @@ "license": "MIT", | ||
"@types/jest": "^29.5.12", | ||
"@types/node": "^20.11.16", | ||
"@typescript-eslint/eslint-plugin": "^6.21.0", | ||
"@typescript-eslint/parser": "^6.21.0", | ||
"eslint": "^8.56.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"eslint-plugin-unicorn": "^50.0.1", | ||
"@types/node": "^22.0.0", | ||
"@typescript-eslint/eslint-plugin": "^8.1.0", | ||
"@typescript-eslint/parser": "^8.1.0", | ||
"eslint": "^9.9.0", | ||
"eslint-plugin-unicorn": "^55.0.0", | ||
"jest": "^29.7.0", | ||
"prettier": "^3.2.5", | ||
"ts-jest": "^29.1.2", | ||
"typescript": "^5.3.3" | ||
"rimraf": "^6.0.1", | ||
"ts-jest": "^29.2.4", | ||
"typescript": "^5.3.3", | ||
"typescript-eslint": "^8.1.0" | ||
}, | ||
"scripts": { | ||
"clean": "rimraf dist", | ||
"clean": "rimraf dist esm", | ||
"test": "jest", | ||
"lint": "eslint --ext .ts src test", | ||
"build": "tsc", | ||
"lint": "eslint --report-unused-disable-directives --max-warnings 0", | ||
"build": "npm run build:esm && npm run build:es5", | ||
"build:esm": "tsc --target es2018 --outDir esm", | ||
"build:es5": "tsc --target es2015 --module commonjs --outDir dist", | ||
"prebuild": "npm run clean", | ||
@@ -31,0 +36,0 @@ "preversion": "npm run lint && npm test && npm run build", |
@@ -1,2 +0,3 @@ | ||
[![Build Status](https://travis-ci.com/cmdcolin/clustal-js.svg?branch=master)](https://travis-ci.com/cmdcolin/clustal-js) | ||
[![NPM version](https://img.shields.io/npm/v/@gmod/bam.svg?style=flat-square)](https://npmjs.org/package/@gmod/bam) | ||
[![Build Status](https://img.shields.io/github/actions/workflow/status/cmdcolin/clustal-js/push.yml?branch=master)](https://github.com/cmdcolin/clustal-js/actions?query=branch%3Amaster+workflow%3APush+) | ||
@@ -3,0 +4,0 @@ # clustal-js |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
42806
24
658
161