Residue->SetAtomId(atom, string)

http://openbabel.org/api/2.3/classOpenBabel_1_1OBResidue.shtml#ad4945233e0066b2b6fbfbe0ed73ae7bc



-David

> On Nov 18, 2016, at 8:27 AM, ivan petit <ivanlepe...@gmail.com> wrote:
> 
> Hi,
> 
> I’m trying to write a pdb file by using OBMol, OBAtom,... class in c++.
> I only have a problem to define the name of the atoms. I need to choice 
> myself there names.
> 
> For this I use SetType of OBAtom :
> 
> OBAtom *Atom;
> Atom→SetType(NewName[i]); // NewName[i] is a string
> 
> The command Atom→GetType() works well and return the good name but nothing is 
> written in the pdb file at the place of atom name ( column 3 ). Thus I think 
> that SetType is not the attribute used to put the name of the atom in the pdb 
> format.
> How does work the attribution of the atom name in the pdb format? What should 
> I do to provide the name of the atom and write well the column 3 of the pdb 
> file ?
> 
> Greetings, Ivan
> 
> OBMol mol;
> OBFormat *format;
> OBConversion conv;
> conv.SetOutFormat("pdb");
> mol.BeginModify()
> for (int i=0;i<ResiduIndex.size();i++)
> {
> item=i;
> if ( std::find(atom.begin(), atom.end(), item) != atom.end() )
> {
> }
> else
> {
> OBAtom *Atom;
> OBResidue *Residu;
> Residu=mol.NewResidue();
> Atom=mol.NewAtom();
> atom.push_back(i);
> countAtom++;
> countResidu++;
> Atom->SetResidue(Residu);
> Atom->SetType(NewName[i]);
> Residu->SetName(AtomInResidu[i]);
> Residu->SetNum(countResidu);
> Atom->SetVector(coord[stepInitial][i][0],coord[stepInitial][i][1],coord[stepInitial][i][2]);
> cout << Atom->GetIdx() << " " << Atom->GetType() << " " << Residu->GetName() 
> << " " << Residu->GetIdx() << " " << Atom->GetVector() << endl ;
> }
> mol.EndModify();
> conv.Write(&mol,&monFlux);
> ------------------------------------------------------------------------------
> _______________________________________________
> OpenBabel-discuss mailing list
> OpenBabel-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
------------------------------------------------------------------------------
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to