Skip to content

Instantly share code, notes, and snippets.

@greglandrum
Created May 9, 2016 11:22
Show Gist options
  • Select an option

  • Save greglandrum/8aeea5e108ca43008c8a9a9eea871c0e to your computer and use it in GitHub Desktop.

Select an option

Save greglandrum/8aeea5e108ca43008c8a9a9eea871c0e to your computer and use it in GitHub Desktop.
//
// Copyright (C) 2016 Greg Landrum
// @@ All Rights Reserved @@
// This file is part of the RDKit.
// The contents are covered by the terms of the BSD license
// which is included in the file license.txt, found at the root
// of the RDKit source tree.
//
/* Can be built with:
g++ -O2 -g -o smi_load.exe smi_load.cpp -I$RDBASE/Code \
-L$RDBASE/lib -lGraphMol -lFileParsers -lSmilesParse -lRDGeneral \
-lboost_timer -lboost_system
*/
#include <RDGeneral/Invariant.h>
#include <RDGeneral/RDLog.h>
#include <vector>
#include <algorithm>
#include <iostream>
#include <fstream>
#include <RDGeneral/Invariant.h>
#include <GraphMol/RDKitBase.h>
#include <GraphMol/SmilesParse/SmilesParse.h>
#include <GraphMol/FileParsers/MolSupplier.h>
#include <boost/timer/timer.hpp>
using namespace RDKit;
void run1(std::string pathName) {
boost::timer::auto_cpu_timer t;
RDKit::SmilesMolSupplier suppl(pathName);
unsigned int nDone = 0;
while (!suppl.atEnd()) {
RDKit::ROMol *m = suppl.next();
nDone += 1;
}
std::cerr << "read: " << nDone << " mols" << std::endl;
}
int main(int argc, char *argv[]) {
RDLog::InitLogs();
std::string pathName =
"./zinc_ed.head.smi"; // 10000 molecules from zinc15 tranch ED
BOOST_LOG(rdInfoLog) << "search1 " << std::endl;
run1(pathName);
BOOST_LOG(rdInfoLog) << "done " << std::endl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment