Closed greatlse closed 3 years ago
Hi kazuyaujihara,
I found an error when I tried to use StructureDiagramGenerator to get the 2d coodinates for a structure. The version NCDK is 1.5.6.0.
Please find the code below.
public static void testNCDK(Boolean newSmiles) { var smi = "CCOC(=O)[C@]12CCC[C@]3([C@H]1CCC[C@H]3c1ccccc1)C2(F)F"; var mol= Chem.MolFromSmiles(smi); // using SmilesGenerator to change the smiles string without any structure changes if (newSmiles) { SmilesGenerator smigen = new SmilesGenerator(SmiFlavors.UniversalSmiles); smi = smigen.Create(mol); Console.WriteLine(smi); mol = Chem.MolFromSmiles(smi); } StructureDiagramGenerator sdg = new StructureDiagramGenerator(); ConnectivityChecker.PartitionIntoMolecules(mol); sdg.Molecule = mol; sdg.GenerateCoordinates(); IAtomContainer layedOutMol = sdg.Molecule; String molblock = Chem.MolToMolBlock(layedOutMol); Console.WriteLine(molblock); Console.ReadLine(); }
the error information is "“System.IndexOutOfRangeException”类型的未经处理的异常在 NCDK.dll 中发生 索引超出了数组界限。" Any suggestion is welcomed. Thanks very much. Best
forget to notice you. there is no error when I use CDK to treat the same smiles string "CCOC(=O)[C@]12CCC[C@]3([C@H]1CCC[C@H]3c1ccccc1)C2(F)F".
Fixed by https://github.com/kazuyaujihara/NCDK/commit/a88ec8da9a552ed0511efd8aed465e6ec851d3c1.
Hi kazuyaujihara,
I found an error when I tried to use StructureDiagramGenerator to get the 2d coodinates for a structure. The version NCDK is 1.5.6.0.
Please find the code below.
the error information is "“System.IndexOutOfRangeException”类型的未经处理的异常在 NCDK.dll 中发生 索引超出了数组界限。" Any suggestion is welcomed. Thanks very much. Best