1 //
2 // Modifying molecules example8.cpp
3 
4 #include <iostream>
5 
6 #include <GraphMol/GraphMol.h>
7 #include <GraphMol/SmilesParse/SmilesParse.h>
8 #include <GraphMol/MolOps.h>
9 
main(int argc,char ** argv)10 int main( int argc , char **argv ) {
11 
12   std::shared_ptr<RDKit::ROMol> mol1( RDKit::SmilesToMol( "CCO" ) );
13   std::cout << "Number of atoms : " << mol1->getNumAtoms() << std::endl;
14   std::shared_ptr<RDKit::ROMol> mol2( RDKit::MolOps::addHs( *mol1 ) );
15   std::cout << "Number of atoms : " << mol2->getNumAtoms() << std::endl;
16 
17   std::shared_ptr<RDKit::RWMol> mol3( new RDKit::RWMol( *mol2 ) );
18   RDKit::MolOps::removeHs( *mol3 );
19   std::cout << "Number of atoms : " << mol3->getNumAtoms() << std::endl;
20 
21 }
22