@datagrok/sequence-translator 1.3.13 → 1.3.14
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/CHANGELOG.md +4 -0
- package/dist/package-test.js +1 -1
- package/dist/package-test.js.map +1 -1
- package/dist/package.js +1 -1
- package/dist/package.js.map +1 -1
- package/package.json +2 -2
- package/src/polytool/cyclized.ts +0 -56
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datagrok/sequence-translator",
|
|
3
3
|
"friendlyName": "Sequence Translator",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.14",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Alexey Choposky",
|
|
7
7
|
"email": "achopovsky@datagrok.ai"
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
}
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@datagrok-libraries/bio": "
|
|
25
|
+
"@datagrok-libraries/bio": "5.42.12",
|
|
26
26
|
"@datagrok-libraries/chem-meta": "^1.2.5",
|
|
27
27
|
"@datagrok-libraries/tutorials": "^1.3.13",
|
|
28
28
|
"@datagrok-libraries/utils": "^4.2.29",
|
package/src/polytool/cyclized.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import {GAP_SYMBOL, INotationProvider, ISeqSplitted, SeqSplittedBase, SplitterFunc}
|
|
2
|
-
from '@datagrok-libraries/bio/src/utils/macromolecule/types';
|
|
3
|
-
import {getSplitterWithSeparator, StringListSeqSplitted} from '@datagrok-libraries/bio/src/utils/macromolecule/utils';
|
|
4
|
-
import {GapOriginals} from '@datagrok-libraries/bio/src/utils/seq-handler';
|
|
5
|
-
import {NOTATION} from '@datagrok-libraries/bio/src/utils/macromolecule';
|
|
6
|
-
|
|
7
|
-
export class CyclizedNotationProvider implements INotationProvider {
|
|
8
|
-
private readonly separatorSplitter: SplitterFunc;
|
|
9
|
-
public readonly splitter: SplitterFunc;
|
|
10
|
-
|
|
11
|
-
constructor(
|
|
12
|
-
public readonly separator: string
|
|
13
|
-
) {
|
|
14
|
-
this.separatorSplitter = getSplitterWithSeparator(this.separator);
|
|
15
|
-
this.splitter = this._splitter.bind(this);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
private _splitter(seq: string): ISeqSplitted {
|
|
19
|
-
const baseSS: ISeqSplitted = this.separatorSplitter(seq);
|
|
20
|
-
return new CyclizedSeqSplitted(baseSS.originals, GapOriginals[NOTATION.SEPARATOR]);
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/** Gets canonical monomers for original ones with cyclization marks */
|
|
25
|
-
export class CyclizedSeqSplitted extends StringListSeqSplitted {
|
|
26
|
-
private readonly seqCList: (string | null)[];
|
|
27
|
-
|
|
28
|
-
private _canonicals: string[] | null = null;
|
|
29
|
-
override get canonicals(): SeqSplittedBase {
|
|
30
|
-
if (!this._canonicals) {
|
|
31
|
-
const len = this.length;
|
|
32
|
-
this._canonicals = new Array<string>(len);
|
|
33
|
-
for (let posIdx = 0; posIdx < len; ++posIdx)
|
|
34
|
-
this._canonicals[posIdx] = this.getCanonical(posIdx);
|
|
35
|
-
}
|
|
36
|
-
return this._canonicals;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
override getCanonical(posIdx: number): string {
|
|
40
|
-
if (this.isGap(posIdx)) return GAP_SYMBOL;
|
|
41
|
-
|
|
42
|
-
let cmRes: string | null = this.seqCList[posIdx];
|
|
43
|
-
if (cmRes === null) {
|
|
44
|
-
const om = this.getOriginal(posIdx);
|
|
45
|
-
cmRes = om;
|
|
46
|
-
if (om[om.length - 1] === ')')
|
|
47
|
-
cmRes = this.seqCList[posIdx] = om.replace(/\(\d+\)$/, '');
|
|
48
|
-
}
|
|
49
|
-
return cmRes;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
constructor(seqOList: SeqSplittedBase, gapOriginalMonomer: string) {
|
|
53
|
-
super(seqOList, gapOriginalMonomer);
|
|
54
|
-
this.seqCList = new Array<string | null>(this.length).fill(null);
|
|
55
|
-
}
|
|
56
|
-
}
|