You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dstoeckel edited this page Mar 16, 2015
·
4 revisions
How can I write a system into a PDB-file?
Open a PDB-file in openmode out and stream a system of molecules into that file.
Don't forget to close your file.
#include<BALL/FORMAT/PDBFile.h>
#include<BALL/KERNEL/system.h>usingnamespaceBALL;usingnamespacestd;
System system;
...
// add or change something in the system
...
// and write the file
PDBFile outfile("test.pdb", ios::out);
outfile << system;
outfile.close();
Python
importsysfromBALLimport*system=System()
...
# add or change something in the system
...
# and write the system into a PDB fileoutfile=PDBFile("test.pdb", File.MODE_OUT)
outfile.write(system)
outfile.close()
print"File test.pdb saved successfully!"