antibody_utils.structure.selection

Copy selected regions and atoms of antibody chains into a new structure.

Module Attributes

BACKBONE_ATOMS

The names of the backbone atoms of an amino-acid residue.

Functions

select(source[, regions, exclude, atoms])

Copy regions of antibody chains into a new structure.

antibody_utils.structure.selection.BACKBONE_ATOMS = frozenset({'C', 'CA', 'N', 'O'})

The names of the backbone atoms of an amino-acid residue.

antibody_utils.structure.selection.select(source, regions=('fv',), *, definition, exclude=(), atoms=None)[source]

Copy regions of antibody chains into a new structure.

The copy holds one model, with a chain for each antibody chain selected. Its residues are numbered in the chains’ numbering scheme, so that, for example, select(fv, definition=”imgt”).write_pdb(“fv.pdb”) writes an IMGT-numbered Fv. The original structure is left unchanged.

Regions are assigned as by AntibodyChain.region_residues.

Parameters:
  • source (AntibodyChain | Fv | Iterable[AntibodyChain]) – An antibody chain, an Fv, or several antibody chains from one structure.

  • regions (Iterable[Region | str]) – The regions, or region groups such as “cdrs”, to copy. By default, the whole variable domain (“fv”).

  • definition (Definition | str) – The region definition to apply.

  • exclude (Iterable[Region | str]) – Regions, or region groups, to leave out, such as [“cdrh3”].

  • atoms (Iterable[str] | None) – The names of the atoms to copy, such as BACKBONE_ATOMS. By default, every atom.

Return type:

Structure

Returns:

The new structure, with the original’s name, unit cell and space group.

Raises:

ValueError – If a region or group name is not recognised, or the chains come from different structures.