Exemplo n.º 1
0
 MOL_SPTR_VECT readFuncGroups(std::string fileName) {
   std::ifstream inStream(fileName.c_str());
   if ((!inStream) || (inStream.bad()) ) {
     std::ostringstream errout;
     errout << "Bad input file " << fileName;
     throw BadFileException(errout.str());
   }
   MOL_SPTR_VECT funcGroups;
   funcGroups=readFuncGroups(inStream);
   return funcGroups;
 }
Exemplo n.º 2
0
    (*funcGroup)->getProp(common_properties::_Name, text);
    ss << text;
    ss << "\t";
    (*funcGroup)->getProp(common_properties::_fragSMARTS, text);
    ss << text;
    ss << "\n";
  }
}
std::string FragCatParams::Serialize() const {
  std::stringstream ss;
  toStream(ss);
  return ss.str();
}

void FragCatParams::initFromString(const std::string &text) {
  std::stringstream ss(text);
  initFromStream(ss);
}

void FragCatParams::initFromStream(std::istream &ss) {
  ss >> d_lowerFragLen;
  ss >> d_upperFragLen;
  ss >> d_tolerance;
  int nGroups;
  ss >> nGroups;
  // std::cout << "Reading " << nGroups << " Groups" << std::endl;

  d_funcGroups = readFuncGroups(ss, nGroups);
}
}