Skip to content

Commit

Permalink
Merge pull request #21 from C-Accel-CRIPT/feat/pppdb
Browse files Browse the repository at this point in the history
feat(typescript): add PPPDB ingestion script
  • Loading branch information
bearmit authored Aug 7, 2023
2 parents 9054fdc + ee49c6e commit 9086851
Show file tree
Hide file tree
Showing 125 changed files with 5,437 additions and 19 deletions.
20 changes: 8 additions & 12 deletions scripts/typescript/src/afrl/afrl-csv-to-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -294,25 +294,25 @@ export class AFRLtoJSON {
if (conc_vol_fraction && !isNaN(conc_vol_fraction)) {
const property: IProperty = {
key: "conc_vol_fraction",
value: String(conc_vol_fraction), // FIXME: backend does not accept numbers,
// "components_relative" does not exist on new API, using "component" instead.
value: conc_vol_fraction,
component: [polymer],
citation,
node: ['Property'],
type: 'value', // FIXME: is this correct from a chemist point of view?
unit: null,
};
mixture.property.push(property);
}

if (conc_mass_fraction && !isNaN(conc_mass_fraction)) {
const property: IProperty = {
key: "conc_mass_fraction",
value: String(conc_mass_fraction), // FIXME: backend does not accept numbers
// "components_relative" does not exist on new API, using "component" instead.
value: conc_mass_fraction,
component: [polymer],
citation,
node: ['Property'],
type: 'value', // FIXME: is this correct from a chemist point of view?
unit: null,
}
mixture.property.push(property);
}
Expand All @@ -321,8 +321,7 @@ export class AFRLtoJSON {

const temp_cloud_property = {
key: "temp_cloud",
value: String(temp_cloud), // FIXME: backend does not accept numbers
// "components_relative" does not exist on new API, using "component" instead.
value: temp_cloud,
component: [polymer],
citation,
node: ['Property'],
Expand All @@ -343,15 +342,12 @@ export class AFRLtoJSON {


if (one_phase_direction) {

// FIXME: uncomment once backend accepts custom vocab (starts with a "+")
/*
temp_cloud_property.condition.push({
node: ['Condition'],
key: "+one_phase_direction", // Not sure this will work, needs custom vocabulary (starts with a "+").
key: "+one_phase_direction",
type: 'value',
value: one_phase_direction,
model_version: MODEL_VERSION,
} as ICondition);*/
} as ICondition);

this.record_error(`one_phase_direction cannot be stored in CRIPT, +one_phase_direction vocab is not allowed.`)
}
Expand Down
3 changes: 3 additions & 0 deletions scripts/typescript/src/pppdb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# PPPDB XLSX to JSON

This script is able to convert an xlsx file to CRIPT JSON.
69 changes: 69 additions & 0 deletions scripts/typescript/src/pppdb/data/molfiles/AF1600.mol
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
AF1600.mol
ChemDraw05121709532D

23 22 0 0 0 0 0 0 0 0999 V2000
-2.8922 0.6611 0.0000 * 0 0 0 0 0 0 0 0 0 0 0 0
-2.1777 1.0736 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.4632 0.6611 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.7487 1.0736 0.0000 * 0 0 0 0 0 0 0 0 0 0 0 0
-1.4632 -0.1639 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0
-1.4632 1.4861 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0
-2.1777 1.8986 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0
-2.1777 0.2486 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0
1.8758 0.6085 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1.0508 0.6085 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.7958 -0.1761 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
1.4633 -0.6611 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
2.1307 -0.1761 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
2.1777 -1.0736 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.7488 -1.0736 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
2.8922 -0.6611 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0
2.8922 -1.4861 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0
2.1777 -1.8986 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0
-0.0481 -0.8600 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0
0.0343 -1.4861 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0
0.7488 -1.8986 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0
2.5902 1.0210 0.0000 * 0 0 0 0 0 0 0 0 0 0 0 0
0.3363 1.0210 0.0000 * 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0
2 3 1 0
3 4 1 0
3 5 1 0
3 6 1 0
2 7 1 0
2 8 1 0
9 10 1 0
10 11 1 0
11 12 1 0
12 13 1 0
13 9 1 0
12 14 1 0
12 15 1 0
14 16 1 0
14 17 1 0
14 18 1 0
15 19 1 0
15 20 1 0
15 21 1 0
9 22 1 0
10 23 1 0
M STY 3 1 COP 2 SRU 3 SRU
M SLB 1 1 1
M SST 1 1 RAN
M SAL 1 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
M SAL 1 8 16 17 18 19 20 21 22 23
M SDI 1 4 4.6533 3.1935 4.6533 -2.6915
M SDI 1 4 -4.1742 -2.6915 -4.1742 3.1935
M SLB 1 2 2
M SCN 3 1 HT 2 HT 3 HT
M SAL 2 6 2 3 5 6 7 8
M SBL 2 2 1 3
M SMT 2 n
M SDI 2 4 -2.6068 0.5718 -2.6068 1.1769
M SDI 2 4 -1.0667 1.1769 -1.0667 0.5718
M SLB 1 3 3
M SAL 3 13 9 10 11 12 13 14 15 16 17 18 19 20 21
M SBL 3 2 22 21
M SDI 3 4 0.6658 0.3610 0.6658 1.3785
M SDI 3 4 2.2883 1.3785 2.2883 0.3610
M END
34 changes: 34 additions & 0 deletions scripts/typescript/src/pppdb/data/molfiles/EX.mol
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
P040013.mol
pdic2mol0408101600 0.00000 0.00000 0

15 14 0 0 0 0 1 V2000
0.0000 0.0000 0.0000 * 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 0.0000 0.0000 * 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 0.0000 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 0.0000 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0
2 3 1 0
3 4 1 0
2 5 1 0
5 6 2 0
5 7 1 0
7 8 1 0
8 9 1 0
9 10 1 0
10 11 1 0
11 12 1 0
12 13 1 0
13 14 1 0
14 15 1 0
M END
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Poly(n-butyl_methacrylate).mol
ChemDraw01051714562D

12 11 0 0 0 0 0 0 0 0999 V2000
-2.1434 0.8250 0.0000 * 0 0 0 0 0 0 0 0 0 0 0 0
-1.4289 1.2375 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.7145 0.8250 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 1.2375 0.0000 * 0 0 0 0 0 0 0 0 0 0 0 0
-0.7145 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 -0.4125 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
-1.4289 -0.4125 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 -1.2375 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.7145 1.6500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.7145 -1.6500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1.4289 -1.2375 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
2.1434 -1.6500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0
2 3 1 0
3 4 1 0
3 5 1 0
5 6 1 0
5 7 2 0
6 8 1 0
3 9 1 0
8 10 1 0
10 11 1 0
11 12 1 0
M STY 1 1 SRU
M SLB 1 1 1
M SCN 1 1 HT
M SAL 1 10 2 3 5 6 7 8 9 10 11 12
M SBL 1 2 3 1
M SDI 1 4 -0.3477 1.4358 -0.3477 0.6658
M SDI 1 4 -1.8877 0.6658 -1.8877 1.4358
M END
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Poly(chloromethylstyrene) .mol
ChemDraw01051714582D

12 12 0 0 0 0 0 0 0 0999 V2000
-1.0717 1.6500 0.0000 * 0 0 0 0 0 0 0 0 0 0 0 0
-0.3572 2.0625 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.3572 1.6500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1.0717 2.0625 0.0000 * 0 0 0 0 0 0 0 0 0 0 0 0
0.3572 0.8250 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.3572 0.4125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.3572 -0.4125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.3572 -0.8250 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1.0717 -0.4125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1.0717 0.4125 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.3572 -1.6500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1.0717 -2.0625 0.0000 Cl 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0
2 3 1 0
3 4 1 0
3 5 1 0
5 6 2 0
6 7 1 0
7 8 2 0
8 9 1 0
9 10 2 0
10 5 1 0
8 11 1 0
11 12 1 0
M STY 1 1 SRU
M SLB 1 1 1
M SCN 1 1 HT
M SAL 1 10 2 3 5 6 7 8 9 10 11 12
M SBL 1 2 1 3
M SDI 1 4 -0.8700 1.4990 -0.8700 2.2415
M SDI 1 4 0.7250 2.2415 0.7250 1.4990
M END
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Poly(n-hexyl_methacrylate).mol
ChemDraw01051714562D

14 13 0 0 0 0 0 0 0 0999 V2000
-2.8578 0.8250 0.0000 * 0 0 0 0 0 0 0 0 0 0 0 0
-2.1433 1.2375 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.4289 0.8250 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.7145 1.2375 0.0000 * 0 0 0 0 0 0 0 0 0 0 0 0
-1.4289 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.7145 -0.4125 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
-2.1433 -0.4125 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
-0.7145 -1.2375 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.4289 1.6500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.0000 -1.6500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.7145 -1.2375 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1.4289 -1.6500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
2.1433 -1.2375 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
2.8578 -1.6500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0
2 3 1 0
3 4 1 0
3 5 1 0
5 6 1 0
5 7 2 0
6 8 1 0
3 9 1 0
8 10 1 0
10 11 1 0
11 12 1 0
12 13 1 0
13 14 1 0
M STY 1 1 SRU
M SLB 1 1 1
M SCN 1 1 HT
M SAL 1 12 2 3 5 6 7 8 9 10 11 12 13 14
M SBL 1 2 1 3
M SDI 1 4 -2.5477 0.7208 -2.5477 1.4083
M SDI 1 4 -1.0077 1.4083 -1.0077 0.7208
M END
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
Poly(n-pentyl_methacrylate).mol
ChemDraw01051714562D

13 12 0 0 0 0 0 0 0 0999 V2000
-2.5005 0.8250 0.0000 * 0 0 0 0 0 0 0 0 0 0 0 0
-1.7861 1.2375 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.0717 0.8250 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.3572 1.2375 0.0000 * 0 0 0 0 0 0 0 0 0 0 0 0
-1.0717 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.3572 -0.4125 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
-1.7861 -0.4125 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
-0.3572 -1.2375 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.0717 1.6500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.3572 -1.6500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1.0717 -1.2375 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1.7861 -1.6500 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
2.5005 -1.2375 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0
2 3 1 0
3 4 1 0
3 5 1 0
5 6 1 0
5 7 2 0
6 8 1 0
3 9 1 0
8 10 1 0
10 11 1 0
11 12 1 0
12 13 1 0
M STY 1 1 SRU
M SLB 1 1 1
M SCN 1 1 HT
M SAL 1 11 2 3 5 6 7 8 9 10 11 12 13
M SBL 1 2 1 3
M SDI 1 4 -2.2452 0.6933 -2.2452 1.3258
M SDI 1 4 -0.6227 1.3258 -0.6227 0.6933
M END
38 changes: 38 additions & 0 deletions scripts/typescript/src/pppdb/data/molfiles/chitosan.mol
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
chitosan.mol
ChemDraw01041714502D

13 13 0 0 0 0 0 0 0 0999 V2000
-0.6035 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.1910 -0.7145 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.6071 -0.5054 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1.4004 -0.7145 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.9879 0.0000 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
0.1898 -0.2091 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.2227 0.5054 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.1898 1.2199 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
2.1971 -0.5010 0.0000 * 0 0 0 0 0 0 0 0 0 0 0 0
-1.4004 -0.2136 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
-2.1971 -0.4271 0.0000 * 0 0 0 0 0 0 0 0 0 0 0 0
-0.9879 -0.5010 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
1.0196 -1.2199 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0
2 3 1 0
3 4 1 0
4 5 1 0
5 6 1 0
6 1 1 0
6 7 1 0
7 8 1 0
4 9 1 0
1 10 1 0
10 11 1 0
2 12 1 0
3 13 1 0
M STY 1 1 SRU
M SLB 1 1 1
M SCN 1 1 HT
M SAL 1 11 1 2 3 4 5 6 7 8 10 12 13
M SBL 1 2 9 11
M SDI 1 4 1.9087 0.5108 1.9087 -1.2767
M SDI 1 4 -1.9138 -1.2767 -1.9138 0.5108
M END
27 changes: 27 additions & 0 deletions scripts/typescript/src/pppdb/data/molfiles/d-polyethylene.mol
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
d-polyethylene.mol
ChemDraw01051717582D

8 7 0 0 0 0 0 0 0 0999 V2000
-1.0717 -0.2062 0.0000 * 0 0 0 0 0 0 0 0 0 0 0 0
-0.3572 0.2062 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.3572 -0.2062 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1.0717 0.2062 0.0000 * 0 0 0 0 0 0 0 0 0 0 0 0
-0.3572 1.0312 0.0000 D 0 0 0 0 0 0 0 0 0 0 0 0
-0.3572 -0.6188 0.0000 D 0 0 0 0 0 0 0 0 0 0 0 0
0.3572 0.6188 0.0000 D 0 0 0 0 0 0 0 0 0 0 0 0
0.3572 -1.0312 0.0000 D 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0
2 3 1 0
3 4 1 0
2 5 1 0
2 6 1 0
3 7 1 0
3 8 1 0
M STY 1 1 SRU
M SLB 1 1 1
M SCN 1 1 HT
M SAL 1 6 2 3 5 6 7 8
M SBL 1 2 1 3
M SDI 1 4 -0.7863 -0.2955 -0.7863 0.3095
M SDI 1 4 0.7537 0.3095 0.7537 -0.2955
M END
Loading

0 comments on commit 9086851

Please sign in to comment.