Skip to content

Commit

Permalink
test: add v3000 problem example
Browse files Browse the repository at this point in the history
  • Loading branch information
lpatiny committed Oct 15, 2022
1 parent b0f9819 commit b224f87
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 0 deletions.
21 changes: 21 additions & 0 deletions examples/v3000/load.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
'use strict';

const { readFileSync } = require('fs');
const { join } = require('path');

const { Molecule } = require('../../dist/openchemlib-full.pretty');

const molfile = readFileSync(join(__dirname, 'molfile.txt'), 'utf8');
const molecule = Molecule.fromMolfile(molfile);
console.log('molecule', molecule.getAllAtoms());

const molfileNoSGroup = readFileSync(
join(__dirname, 'molfileNoSGroup.txt'),
'utf8',
);
const moleculeNoSGroup = Molecule.fromMolfile(molfileNoSGroup);
console.log('moleculeNoSGroup', moleculeNoSGroup.getAllAtoms());

const molfileV2000 = readFileSync(join(__dirname, 'molfileV2000.txt'), 'utf8');
const moleculeV2000 = Molecule.fromMolfile(molfileV2000);
console.log('moleculeV2000', moleculeV2000.getAllAtoms());
21 changes: 21 additions & 0 deletions examples/v3000/molfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
first line
ChemDraw10152219412D
third line
0 0 0 0 0 0 V3000
M V30 BEGIN CTAB
M V30 COUNTS 3 2 1 0 0
M V30 BEGIN ATOM
M V30 1 C -0.714471 -0.412500 0.000000 0
M V30 2 C 0.000000 0.000000 0.000000 0
M V30 3 N 0.714471 0.412500 0.000000 0
M V30 END ATOM
M V30 BEGIN BOND
M V30 1 3 2 3
M V30 2 1 1 2
M V30 END BOND
M V30 BEGIN SGROUP
M V30 1 SUP 1 ATOMS=(2 2 3) XBONDS=(1 2) LABEL=CN CSTATE=(4 2 -0.714471 -
M V30 -0.412500 0)
M V30 END SGROUP
M V30 END CTAB
M END
17 changes: 17 additions & 0 deletions examples/v3000/molfileNoSGroup.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
first line
ChemDraw10152219412D
third line
0 0 0 0 0 0 V3000
M V30 BEGIN CTAB
M V30 COUNTS 3 2 0 0 0
M V30 BEGIN ATOM
M V30 1 C -0.714471 -0.412500 0.000000 0
M V30 2 C 0.000000 0.000000 0.000000 0
M V30 3 N 0.714471 0.412500 0.000000 0
M V30 END ATOM
M V30 BEGIN BOND
M V30 1 3 2 3
M V30 2 1 1 2
M V30 END BOND
M V30 END CTAB
M END
16 changes: 16 additions & 0 deletions examples/v3000/molfileV2000.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

ChemDraw10152219562D

3 2 0 0 0 0 0 0 0 0999 V2000
-0.7145 -0.4125 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.7145 0.4125 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
2 3 3 0
1 2 1 0
M STY 1 1 SUP
M SLB 1 1 1
M SAL 1 2 2 3
M SBL 1 1 2
M SMT 1 CN
M SBV 1 2 -0.7145 -0.4125
M END

0 comments on commit b224f87

Please sign in to comment.