pdbio: PDB input/output

Input/output for PDB files

read_pdb_file(f, log=None, explode=True, atomic=True)

Experimental API . ‘f’ is a file-like object open for reading containing the PDB info ‘log’ is a file-like object open for writing warnings/errors and other information ‘explode’ controls whether NMR ensembles will be handled as separate models (default True) or as one model with multiple coordinate sets (False) ‘atomic’ controls whether models are treated as atomic models with standard chemical properties (default True) or as graphical models (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)

Experimental API . ‘structures’ is a sequence of C++ structure pointers ‘file_name’ is the output file path ‘selected_only’ controls if only selected atoms will be written (default False) ‘displayed_only’ controls if only displayed atoms will be written (default False) ‘xforms’ is 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. (default None) ‘all_coordsets’ controls if all coordsets of a trajectory will be written (as multiple MODELS) or just the current coordset (default True = all coordsets) ‘pqr’ controls whether to write PQR-style ATOM records (default False) ‘h36’ controls the handling of serial numbers of more than 5 digits (maximum supported by PDB standard). If False, then the sixth column of ATOM records will be stolen for an additional digit (AMBER style), so up to 999,999 atoms. If True, then hybrid-36 encoding will be used (see http://cci.lbl.gov/hybrid_36), so up to 87,440,031 atoms.