From: Gert S. <Ger...@re...> - 2003-08-12 10:16:10
|
When trying to convert a structure file in ctx-format, a NullPointerException was thrown. The main origin of the error was found in the parsing of the /2DCOORD section. The original code expected a formatting like: /2DCOORD n n 1 xcoord_atom_1 ycoord_atom_1 .. n xcoord_atom_n ycoord_atom_n Whilst the .ctx-files produced by CACTVS (both v2.56 and v2.95) have a formatting like: /2DCOORD n+2 n+2 ? ? ? ? ? 1 xcoord_atom_1 ycoord_atom_1 .. n xcoord_atom_n ycoord_atom_n Does anyone know the meaning of these 2 extra lines before the actual 2d-coordinates? At the moment the parser just ignores them. To be complete, here follows the diff of the changed ClearTextFormat.java and the old ClearTextFormat.java (or at least the important parts of the diff output). If this is not necessary in the future, please let me know: diff joelib/io/types/ClearTextFormat_New.java joelib/io/types/ClearTextFormat.java 349,351c347,349 < boolean is2D = (line.charAt(2) == '2') ? true: false; < < // read atoms coordinates --- > boolean is2D = (line.charAt(2) == 2) ? true : false; > > // read atoms coordinates 356,357c354 < counter = Integer.parseInt((String) tv.get(1)) - 2; < --- > counter = Integer.parseInt((String) tv.get(1)); 369,372d365 < //QUESTION: Do the following two lines contain necessary information? < line = lnr.readLine(); < line = lnr.readLine(); < Greetings, Gert Sclep |