Aligns one Polypeptide (mobile) to another (target).

    Notes
    -----
    This function directly modifies atoms of the mobile Polypeptide!
    It does not return a new object.

    Parameters
    ----------
    target : Polypeptide
        Polypeptide to be aligned to.
    mobile : Polypeptide
        Polypeptide to be moved during alignment.
    target_i : int, optional
        Index of `Residue` in target to align to.
    mobile_i : int, optional
        Index of `Residue` in mobile to be aligned.

def align(target, mobile, target_i=0, mobile_i=0):
    """Aligns one Polypeptide (mobile) to another (target).

    Notes
    -----
    This function directly modifies atoms of the mobile Polypeptide!
    It does not return a new object.

    Parameters
    ----------
    target : Polypeptide
        Polypeptide to be aligned to.
    mobile : Polypeptide
        Polypeptide to be moved during alignment.
    target_i : int, optional
        Index of `Residue` in target to align to.
    mobile_i : int, optional
        Index of `Residue` in mobile to be aligned.
    """
    # First, align N->CA vectors.
    s1, e1, s2, e2 = [x._vector
                      for x in [mobile[mobile_i]['N'], mobile[mobile_i]['CA'],
                                target[target_i]['N'], target[target_i]['CA']]]
    translation, angle, axis, point = find_transformations(
        s1, e1, s2, e2, radians=False)
    # Rotation first, Then translation.
    mobile.rotate(angle=angle, axis=axis, point=point, radians=False)
    mobile.translate(vector=translation)
    # Second, rotate about N->CA axis to align CA->C vectors.
    angle = dihedral(mobile[mobile_i]['C'], mobile[mobile_i]
                     ['N'], mobile[mobile_i]['CA'], target[target_i]['C'])
    axis = target[target_i]['CA'] - target[target_i]['N']
    point = target[target_i]['N']._vector
    mobile.rotate(angle=angle, axis=axis, point=point)
    return