pestifer.objs.mutation module

Single-residue mutations are handled in psfgen by including a “mutate” directive within a protein segment. The mutate directive needs only the resid and 3-letter desired residue name at that resid position. Mutate directives come after all pdb and residue directives in segment, typically.

Mutations can be inferred directly from coordinate-file metadata or supplied by the user.

class pestifer.objs.mutation.Mutation(*args, chainID: str, origresname: str, resid: ResID, newresname: str, typekey: str, pdbx_auth_seq_num: int | None = None)[source]

Bases: BaseObj

A class for handling single-residue mutations

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.

newresname: str
origresname: str
pdbx_auth_seq_num: int | None
resid: ResID
shortcode() str[source]

Returns a shortcode representation of the Mutation object.

Returns:

A string in the format C:nnn,rrr,mmm where C is the chain ID, nnn is the original residue name, rrr is the residue sequence number plus optional insertion code, and mmm is the new residue name.

Return type:

str

typekey: str
write_TcL()[source]

Writes the Tcl command to perform the mutation in a Psfgen script.

Returns:

The Tcl command to mutate the residue at the specified position to the new residue name.

Return type:

str

class pestifer.objs.mutation.MutationList(initlist: Iterable[T] = ())[source]

Bases: BaseObjList[Mutation]

describe()[source]

Abstract method to describe the contents of the BaseObjList. Subclasses should implement this method to provide a meaningful description.