moleculekit.tools.sequencestructuralalignment module#

moleculekit.tools.sequencestructuralalignment.sequenceStructureAlignment(mol: Molecule, ref: Molecule, molseg: str | None = None, refseg: str | None = None, molsel: str | ndarray = 'all', refsel: str | ndarray = 'all', maxalignments: int = 10, nalignfragment: int = 1)#

Aligns two structures by their longests sequences alignment

Parameters:
  • mol (Molecule object) – The Molecule we want to align

  • ref (Molecule object) – The reference Molecule to which we want to align

  • molseg (str) – The segment of mol we want to align

  • refseg (str) – The segment of ref we want to align to

  • molsel (str or np.ndarray) – The atom selection of mol we want to align. Can be a selection string, a boolean mask, or an integer index array. Defaults to “all”.

  • refsel (str or np.ndarray) – The atom selection of ref we want to align to. Can be a selection string, a boolean mask, or an integer index array. Defaults to “all”.

  • maxalignments (int) – The maximum number of alignments we want to produce

  • nalignfragment (int) – The number of fragments used for the alignment.

Returns:

  • mols (list) – A list of Molecules each containing a different alignment.

  • masks (list) – A list of boolean mask pairs of which atoms were aligned. [[molmask1, refmask1], [molmask2, refmask2], …]