cctk.PDBFile¶
- class cctk.PDBFile(molecule, title=None)[source]¶
Bases:
FileGeneric class for all
.pdbfiles.Methods
__init__(molecule[, title])append_to_file(filename, text)Appends output text to a file.
read_file(filename)Reads a file and parses into lines.
write_ensemble_to_trajectory(filename, ensemble)Writes a
ConformationalEnsembleto a trajectory file.write_file(filename, text[, overwrite_existing])Writes output text to a file.
write_molecule_to_file(filename, molecule[, ...])Write a
.pdbfile, using object attributes.- static append_to_file(filename, text)¶
Appends output text to a file.
- Parameters:
filename (str) – path to file, including name (e.g.
path/to/input.gjf)text (str) – desired contents of file
- Returns:
Trueif write succeeded,Falseotherwise
- classmethod read_file(filename)[source]¶
Reads a file and parses into lines.
- Parameters:
filename (str) – The path to the file.
- Returns:
A list containing all the lines in the file.
- classmethod write_ensemble_to_trajectory(filename, ensemble)[source]¶
Writes a
ConformationalEnsembleto a trajectory file.- Parameters:
filename (str) – where to write the file
ensemble (Ensemble) –
Ensembleobject to write
- static write_file(filename, text, overwrite_existing=True)¶
Writes output text to a file.
- Parameters:
filename (str) – path to file, including name (e.g.
path/to/input.gjf)text (str) – desired contents of file
overwrite_existing (Bool) – whether any existing files should be overwritten or not
- Returns:
Trueif write succeeded,Falseotherwise
- classmethod write_molecule_to_file(filename, molecule, num=1, append=False)[source]¶
Write a
.pdbfile, using object attributes.- Parameters:
filename (str) – path to the new file
molecule (Molecule) –
Moleculeobjectnum (int) – model number
append (Bool) – whether to write to file normally or append