cctk.PDBFile¶
- class cctk.PDBFile(molecule, title=None)[source]¶
Bases:
File
Generic class for all
.pdb
files.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
ConformationalEnsemble
to a trajectory file.write_file
(filename, text[, overwrite_existing])Writes output text to a file.
write_molecule_to_file
(filename, molecule[, ...])Write a
.pdb
file, 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:
True
if write succeeded,False
otherwise
- 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
ConformationalEnsemble
to a trajectory file.- Parameters:
filename (str) – where to write the file
ensemble (Ensemble) –
Ensemble
object 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:
True
if write succeeded,False
otherwise
- classmethod write_molecule_to_file(filename, molecule, num=1, append=False)[source]¶
Write a
.pdb
file, using object attributes.- Parameters:
filename (str) – path to the new file
molecule (Molecule) –
Molecule
objectnum (int) – model number
append (Bool) – whether to write to file normally or append