@datagrok/bio 2.12.13 → 2.12.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 +1 -1
- package/src/utils/helm-to-molfile/converter/mol-atoms-v3k.ts +4 -4
- package/src/utils/helm-to-molfile/converter/polymer.ts +1 -1
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"name": "Aleksandr Tanas",
|
|
6
6
|
"email": "atanas@datagrok.ai"
|
|
7
7
|
},
|
|
8
|
-
"version": "2.12.
|
|
8
|
+
"version": "2.12.14",
|
|
9
9
|
"description": "Bioinformatics support (import/export of sequences, conversion, visualization, analysis). [See more](https://github.com/datagrok-ai/public/blob/master/packages/Bio/README.md) for details.",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {MolfileHandlerBase} from '@datagrok-libraries/chem-meta/src/parsing-utils/molfile-handler-base';
|
|
2
2
|
import {MolfileAtoms} from './mol-atoms';
|
|
3
3
|
|
|
4
|
-
const PRECISION =
|
|
4
|
+
const PRECISION = 4;
|
|
5
5
|
|
|
6
6
|
export class MolfileAtomsV3K extends MolfileAtoms {
|
|
7
7
|
constructor(private molfileHandler: MolfileHandlerBase) {
|
|
@@ -21,13 +21,13 @@ export class MolfileAtomsV3K extends MolfileAtoms {
|
|
|
21
21
|
|
|
22
22
|
get atomLines(): string[] {
|
|
23
23
|
// todo: optimize, optionally port to molfile-handler
|
|
24
|
-
const coordinateRegex = /^(M V30
|
|
24
|
+
const coordinateRegex = /^(M V30 [^-]*)(-?\d+\.\d+)( )(-?\d+\.\d+)( -?\d+\.\d+.*)$/;
|
|
25
25
|
const rGroupsRegex = /\sRGROUPS=\(\d+(\s+\d+)*\)/;
|
|
26
26
|
|
|
27
27
|
return this.rawAtomLines.map((line: string, idx: number) => {
|
|
28
28
|
const coordinates = this.coordinates[idx];
|
|
29
|
-
const x = coordinates.x.toFixed(PRECISION);
|
|
30
|
-
const y = coordinates.y.toFixed(PRECISION);
|
|
29
|
+
const x = coordinates.x.toFixed(PRECISION) + '00';
|
|
30
|
+
const y = coordinates.y.toFixed(PRECISION) + '00';
|
|
31
31
|
|
|
32
32
|
return line.replace(coordinateRegex, (match, p1, p2, p3, p4, p5) => {
|
|
33
33
|
return p1 + x + p3 + y + p5;
|
|
@@ -72,7 +72,7 @@ export class Polymer {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
private getV3KHeader(atomCount: number, bondCount: number): string {
|
|
75
|
-
const countsLine = `${V3K_CONST.COUNTS_LINE_START}${atomCount} ${bondCount}
|
|
75
|
+
const countsLine = `${V3K_CONST.COUNTS_LINE_START}${atomCount} ${bondCount} 0 0 1`;
|
|
76
76
|
return `${V3K_CONST.DUMMY_HEADER}\n${V3K_CONST.BEGIN_CTAB}\n${countsLine}`;
|
|
77
77
|
}
|
|
78
78
|
|