pdbio: PDB input/output

Input/output for PDB files

read_pdb_file(f, log=None, explode=True, atomic=True)
f
A file-like object open for reading containing the PDB info
log
A file-like object open for writing that warnings/errors and other information will be written to
explode
Controls whether NMR ensembles will be handled as separate models (True) or as one model with multiple coordinate sets (False)

Returns a numpy array of C++ pointers to AtomicStructure objects (if ‘atomic’ .is True, otherwise Structure objects)

write_pdb_file(structures, file_name, selected_only=False, displayed_only=False, xforms=None all_coordsets=True, pqr=False)
structures
A sequence of C++ structure pointers
file_name
The output file path
selected_only
If True, only selected atoms will be written
displayed_only
If True, only displayed atoms will be written
xforms
A sequence of 3x4 numpy arrays to transform the atom coordinates of the corresponding structure. If None then untransformed coordinates will be used for all structures. Similarly, any None in the sequence will cause untransformed coordinates to be used for that structure.
all_coordsets
If True, all coordsets of a trajectory will be written (as multiple MODELS). Otherwise, just the current coordset will be written.
pqr
If True, write PQR-style ATOM records