Skip to content

Commit 39504c5

Browse files
committed
feat: add coordinates in autoLabelDatabase
1 parent 6fe0f67 commit 39504c5

File tree

2 files changed

+28
-16
lines changed

2 files changed

+28
-16
lines changed

data/autoLabel/createJson.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,20 @@ async function createAutoLabelingJson() {
1919
'utf8',
2020
);
2121
const molecule = Molecule.fromMolfile(molfile);
22+
const mf = molecule.getMolecularFormula().formula;
23+
const mw = molecule.getMolecularFormula().relativeWeight;
2224
molecule.setFragment(true);
2325

2426
const canonizer = new Canonizer(molecule, { encodeAtomCustomLabels: true });
2527

2628
const idCode = canonizer.getIDCode();
29+
const coordinates = canonizer.getEncodedCoordinates(false);
2730

2831
moleculeDatabase.push({
2932
idCode,
30-
mf: molecule.getMolecularFormula().formula,
31-
mw: molecule.getMolecularFormula().relativeWeight,
33+
coordinates,
34+
mf,
35+
mw,
3236
label: file.replace('.mol', ''),
3337
});
3438
}

src/util/autoLabelDatabase.ts

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,54 @@ export const autoLabelDatabase = [
22
{
33
idCode:
44
'fmo@@@LddTTVbvebQbrTyjUcNBfjjjjjjjjjh@Oz[PG]cAhMv\\anulMvLSnqiuFzNYwXt[c][B[iZS]SJ{lXmin}c]vLflw\\sn{Fs^{lZlGnqnt^{FGI{lYmgni`q^zfSU{jZLwnilw^zfKC{jZmOninr~zf[@',
5-
mf: 'C27',
6-
mw: 324.29699999999997,
5+
coordinates:
6+
'!BetK~gzaBM`BWO_z`esvhOZ`}etK~gy]BjDK~hL~esyhqXNLxi]BWP`QLesvWPi\\}?i~WP`',
7+
mf: 'C27H48',
8+
mw: 372.67812,
79
label: 'cholesterol',
810
},
911
{
1012
idCode:
1113
'flm@@@LddTTVbvebyjUcNBfjjjjjjj@C~fTAwXpZC]gH[m[C]cD{lZ]Qncf]vMFxwVpfzVdwTrn{FKZ[oXw]cIkMwL{nqlwn{FkA{l[mGnqar^{F[@',
12-
mf: 'C19',
13-
mw: 228.20899999999997,
14+
coordinates: '!BetK~gzaBM`BWO_z`esvhOZ`}etK~gy]BjDK~hL~esyhqXNLx',
15+
mf: 'C19H32',
16+
mw: 260.46308,
1417
label: 'steroid',
1518
},
1619
{
1720
idCode:
1821
'fhe@@@LdbbbTReryHQmN|Fjjjjjj`@iE@TzCFCHavFMFIUjTYcFK\\npfLfeMeQ[TfLqlufMV]YoL[lEcM`',
19-
mf: 'C17',
20-
mw: 204.18699999999998,
22+
coordinates: '!BbOvw?_x@?g~H@k\\B?g~w@k_}bOvH?_x@GvVH@a|ZTq`',
23+
mf: 'C17H28',
24+
mw: 232.40931999999998,
2125
label: 'steroid-core',
2226
},
2327
{
2428
idCode: 'daDD@@qJYnnjjh@hrPwXrMvlS]STwRsMums]s@',
25-
mf: 'C6O2',
26-
mw: 104.06400000000001,
29+
coordinates: '!Bm?vH?[_|?g?~_x`BbOt',
30+
mf: 'C6H12O2',
31+
mw: 116.15928000000001,
2732
label: 'pyranose',
2833
},
2934
{
3035
idCode: 'gOp`AdifMjj`OzUHwXr[iXmuMV{f[]k@',
31-
mf: 'C5O2',
32-
mw: 92.053,
36+
coordinates: '!BTv]`YW?~KF_~_q`l',
37+
mf: 'C5H10O2',
38+
mw: 102.1324,
3339
label: 'furanose',
3440
},
3541
{
3642
idCode: 'gOp`Adigkjj`OzUHwXr[mXmuMVzV[]s@',
37-
mf: 'C5O2',
38-
mw: 92.053,
43+
coordinates: '!Bm?vH?[_|?g?~_xc}',
44+
mf: 'C5H10O2',
45+
mw: 102.1324,
3946
label: 'pyranose-core',
4047
},
4148
{
4249
idCode: 'gFp`AdidvjhC~aRMvLfzVK]SUny`',
43-
mf: 'C4O2',
44-
mw: 80.042,
50+
coordinates: '!BTv]`YW?~KF_~_p',
51+
mf: 'C4H8O2',
52+
mw: 88.10552,
4553
label: 'furanose-core',
4654
},
4755
];

0 commit comments

Comments
 (0)