private IChemFile readChemFile(IChemFile chemFile) throws CDKException, IOException {
        IChemSequence sequence = chemFile.getBuilder().newInstance(IChemSequence.class);
        IChemModel model = null;
        String line = input.readLine();
        String levelOfTheory;
        String description;
        int modelCounter = 0;

        // Find first set of coordinates by skipping all before "Standard orientation"
        while (input.ready() && (line != null)) {
            if (line.indexOf("Standard orientation:") >= 0) {

                // Found a set of coordinates
                model = chemFile.getBuilder().newInstance(IChemModel.class);
                readCoordinates(model);
                break;
            }
            line = input.readLine();
        }
        if (model != null) {

            // Read all other data
            line = input.readLine().trim();
            while (input.ready() && (line != null)) {
                if (line.indexOf('#') == 0) {
                    // Found the route section
                    // Memorizing this for the description of the chemmodel
                    lastRoute = line;
                    modelCounter = 0;

                } else if (line.indexOf("Standard orientation:") >= 0) {

                    // Found a set of coordinates
                    // Add current frame to file and create a new one.
                    if (!readOptimizedStructureOnly.isSet()) {
                        sequence.addChemModel(model);
                    } else {
                        logger.info("Skipping frame, because I was told to do");
                    }
                    fireFrameRead();
                    model = chemFile.getBuilder().newInstance(IChemModel.class);
                    modelCounter++;
                    readCoordinates(model);
                } else if (line.indexOf("SCF Done:") >= 0) {

                    // Found an energy
                    model.setProperty(CDKConstants.REMARK, line.trim());
                } else if (line.indexOf("Harmonic frequencies") >= 0) {

                    // Found a set of vibrations
                    // readFrequencies(frame);
                } else if (line.indexOf("Total atomic charges") >= 0) {
                    readPartialCharges(model);
                } else if (line.indexOf("Magnetic shielding") >= 0) {

                    // Found NMR data
                    readNMRData(model, line);

                } else if (line.indexOf("GINC") >= 0) {

                    // Found calculation level of theory
                    levelOfTheory = parseLevelOfTheory(line);
                    logger.debug("Level of Theory for this model: " + levelOfTheory);
                    description = lastRoute + ", model no. " + modelCounter;
                    model.setProperty(CDKConstants.DESCRIPTION, description);
                } else {
                    //logger.debug("Skipping line: " + line);
                }
                line = input.readLine();
            }

            // Add last frame to file
            sequence.addChemModel(model);
            fireFrameRead();
        }
        chemFile.addChemSequence(sequence);

        return chemFile;
    }
private IChemFile readChemFile ( IChemFile chemFile ) throws CDKException , IOException { IChemSequence sequence = chemFile . getBuilder ( ) . newInstance ( IChemSequence . class ) ; IChemModel model = null ; String line = input . readLine ( ) ; String levelOfTheory ; String description ; int modelCounter = 0 ; while ( input . ready ( ) && ( line != null ) ) { if ( line . indexOf ( "Standard orientation:" ) >= 0 ) { model = chemFile . getBuilder ( ) . newInstance ( IChemModel . class ) ; readCoordinates ( model ) ; break ; } line = input . readLine ( ) ; } if ( model != null ) { line = input . readLine ( ) . trim ( ) ; while ( input . ready ( ) && ( line != null ) ) { if ( line . indexOf ( '#' ) == 0 ) { lastRoute = line ; modelCounter = 0 ; } else if ( line . indexOf ( "Standard orientation:" ) >= 0 ) { if ( ! readOptimizedStructureOnly . isSet ( ) ) { sequence . addChemModel ( model ) ; } else { logger . info ( "Skipping frame, because I was told to do" ) ; } fireFrameRead ( ) ; model = chemFile . getBuilder ( ) . newInstance ( IChemModel . class ) ; modelCounter ++ ; readCoordinates ( model ) ; } else if ( line . indexOf ( "SCF Done:" ) >= 0 ) { model . setProperty ( CDKConstants . REMARK , line . trim ( ) ) ; } else if ( line . indexOf ( "Harmonic frequencies" ) >= 0 ) { } else if ( line . indexOf ( "Total atomic charges" ) >= 0 ) { readPartialCharges ( model ) ; } else if ( line . indexOf ( "Magnetic shielding" ) >= 0 ) { readNMRData ( model , line ) ; } else if ( line . indexOf ( "GINC" ) >= 0 ) { levelOfTheory = parseLevelOfTheory ( line ) ; logger . debug ( "Level of Theory for this model: " + levelOfTheory ) ; description = lastRoute + ", model no. " + modelCounter ; model . setProperty ( CDKConstants . DESCRIPTION , description ) ; } else { } line = input . readLine ( ) ; } sequence . addChemModel ( model ) ; fireFrameRead ( ) ; } chemFile . addChemSequence ( sequence ) ; return chemFile ; }
Read the Gaussian98 output.

@return a ChemFile with the coordinates, energies, and
vibrations.
@throws IOException  if an I/O error occurs
@throws CDKException Description of the Exception