pestifer.objs.patch module

A patch is a modification to a residue or residues defined in the CHARMM force field by PRES records. It is used to apply specific modifications to residues in a molecular structure, such as adding or removing functional groups or modifying the residue’s properties.

class pestifer.objs.patch.Patch(*args, patchname: str, chainID: str, resid: ResID, residue: Residue = None, use_in_segment: str | None = None, use_after_regenerate: bool | None = False)[source]

Bases: BaseObj

A class for handing patch residues

assign_residue(residue: Residue)[source]

Assigns a Residue object to the patch.

chainID: str
model_config = {'arbitrary_types_allowed': True, 'extra': 'forbid', 'frozen': False}

Configuration for pydantic.BaseModel.

model_post_init(context: Any, /) None

This function is meant to behave like a BaseModel method to initialize private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

Parameters:
  • self – The BaseModel instance.

  • context – The context.

patchname: str
resid: ResID
residue: Residue
return_TcL()[source]

Writes the patch command.

shortcode() str[source]

Convert the Adapter instance to a shortcode string.

Returns:

The shortcode string in the format patchname:chainID:resID.

Return type:

str

use_after_regenerate: bool | None
use_in_segment: str | None
class pestifer.objs.patch.PatchList(initlist: Iterable[T] = ())[source]

Bases: BaseObjList[Patch]

A class for handling lists of Patch objects

This class inherits from BaseObjList and provides methods to manage a list of Patch objects.

assign_residues(Residues: ResidueList) PatchList[source]

Assigns a list of Residue objects to the patch residues.

Parameters:

Residues (list of Residue) – A list of Residue objects to be assigned to the patch residues.

Returns:

A new PatchList object containing the residues that were not assigned because no applicable residues were found

Return type:

PatchList

describe()[source]

Returns a string description of the PatchList.

Returns:

A description of the PatchList, including the number of patches it contains.

Return type:

str