PDB

class PDB(polymer)[source]

Bases: object

Class containing methods to copy and save a Polymer to a PDB or GMX file.

cleanup()[source]

Adjust the box size and center the polymer in the box

crudesave(fname='polymer_crude')[source]

Save polymer as a PDB file with dummy atoms included. Useful for debugging the geometry transforms.

Parameters:

fname (str, optional) – name of the output file, defaults to “polymer_crude”

save(dummies='X*', fname='polymer', selectionString=None, gmx=False)[source]

Save polymer as a PDB or GROMACS file with dummy atoms excluded. Optionally, select a subset of the polymer to save.

Parameters:
  • dummies (str, optional) – names of all the dummy atoms, for use in the selection string (e.g. ‘CN CMA CP CQ’ to exclude these four dummy atom types), defaults to “X*”

  • fname (str, optional) – name of the output file, defaults to “polymer”

  • selectionString (_type_, optional) – MDAnalysis atom selection string, for more information on supported atom selection formats see MDAnalysis Atom selection language <https://userguide.mdanalysis.org/stable/selections.html>, defaults to None

  • gmx (bool, optional) – save output as GROMACS if True, else save as default PDB, defaults to False

select_atoms(selection) AtomGroup[source]

Selection method that selects atoms from the polymer’s MDAnalysis Universe by leveraging the MDAnalysis atom selection.

Parameters:

selection (str) – MDAnalysis atom selection string, for more information on supported atom selection formats see MDAnalysis Atom selection language <https://userguide.mdanalysis.org/stable/selections.html>

Returns:

An MDAnalysis AtomGroup containing only the selected atoms

Return type:

mda.AtomGroup