frag_pele/Growing/add_fragment_from_pdbs.py
def rotation_thought_axis(bond, theta, core_bond, list_of_atoms, fragment_bond, core_structure, fragment_structure,
                          pdb_complex, pdb_fragment, chain_complex, chain_fragment, output_path, only_grow=False):
    """
    Given a core molecule and a fragment, this function rotates the fragment atoms a certain theta angle around an axis
    (set by the bond).
    :param bond: Bio.PDB.Atom list composed by two elements: [heavy atom of the core, heavy atom of the fragment]
    :param theta: Rotation angle in rads.
    :param core_bond: Bio.PDB.Atom list with two elements: [heavy atom, hydrogen atom]. These two atoms have to be the
    ones participating in the bond of the core that we would like to use as linking point between core and fragment.
    :param list_of_atoms: list_of_atoms: Bio.PDB.Atom list with all the atoms of the fragment. These atoms have to contain
    coordinates.
    :param fragment_bond: Bio.PDB.Atom list with two elements: [hydrogen atom, heavy atom]. These two atoms have to be the
    ones participating in the bond of the fragment that we would like to use as linking point between fragment and core.
    :param core_structure: ProDy molecule that contain only the core ligand.
    :param fragment_structure: ProDy molecule that contain only the fragment ligand.
    :return: ProDy molecule with the core_structure and the fragment_structure rotated around the axis of the bond.
    """
    # Obtain the axis that we want to use as reference for the rotation
    vector = bond[1].get_vector() - bond[0].get_vector()
    # Obtain the rotation matrix for the vector (axis) and the angle (theta)
    rot_mat = bio.rotaxis(theta, vector)
    for atom in list_of_atoms:
        # Multiply the matrix of coordinates for the transpose of the rotation matrix to get the coordinates rotated
        atom.transform(rot_mat, (0, 0, 0))
        transform_coords_from_bio2prody(fragment_structure, list_of_atoms)
    rotated_structure = join_structures_to_rotate(core_bond, fragment_bond, list_of_atoms, core_structure, fragment_structure)
    return rotated_structure

    Given a core molecule and a fragment, this function rotates the fragment atoms a certain theta angle around an axis
    (set by the bond).
    :param bond: Bio.PDB.Atom list composed by two elements: [heavy atom of the core, heavy atom of the fragment]
    :param theta: Rotation angle in rads.
    :param core_bond: Bio.PDB.Atom list with two elements: [heavy atom, hydrogen atom]. These two atoms have to be the
    ones participating in the bond of the core that we would like to use as linking point between core and fragment.
    :param list_of_atoms: list_of_atoms: Bio.PDB.Atom list with all the atoms of the fragment. These atoms have to contain
    coordinates.
    :param fragment_bond: Bio.PDB.Atom list with two elements: [hydrogen atom, heavy atom]. These two atoms have to be the
    ones participating in the bond of the fragment that we would like to use as linking point between fragment and core.
    :param core_structure: ProDy molecule that contain only the core ligand.
    :param fragment_structure: ProDy molecule that contain only the fragment ligand.
    :return: ProDy molecule with the core_structure and the fragment_structure rotated around the axis of the bond.
    
Given a core molecule and a fragment, this function rotates the fragment atoms a certain theta angle around an axis
(set by the bond).
Given a core molecule and a fragment this function rotates the fragment atoms a certain theta angle around an axis ( set by the bond ) .
def rotation_thought_axis(bond, theta, core_bond, list_of_atoms, fragment_bond, core_structure, fragment_structure,
                          pdb_complex, pdb_fragment, chain_complex, chain_fragment, output_path, only_grow=False):
    vector = bond[1].get_vector() - bond[0].get_vector()
    rot_mat = bio.rotaxis(theta, vector)
    for atom in list_of_atoms:
        atom.transform(rot_mat, (0, 0, 0))
        transform_coords_from_bio2prody(fragment_structure, list_of_atoms)
    rotated_structure = join_structures_to_rotate(core_bond, fragment_bond, list_of_atoms, core_structure, fragment_structure)
    return rotated_structure
def rotation_thought_axis ( bond , theta , core_bond , list_of_atoms , fragment_bond , core_structure , fragment_structure , pdb_complex , pdb_fragment , chain_complex , chain_fragment , output_path , only_grow = False ) : vector = bond [ 1 ] . get_vector ( ) - bond [ 0 ] . get_vector ( ) rot_mat = bio . rotaxis ( theta , vector ) for atom in list_of_atoms : atom . transform ( rot_mat , ( 0 , 0 , 0 ) ) transform_coords_from_bio2prody ( fragment_structure , list_of_atoms ) rotated_structure = join_structures_to_rotate ( core_bond , fragment_bond , list_of_atoms , core_structure , fragment_structure ) return rotated_structure
Given a core molecule and a fragment, this function rotates the fragment atoms a certain theta angle around an axis
(set by the bond).
Given a core molecule and a fragment this function rotates the fragment atoms a certain theta angle around an axis ( set by the bond ) .
"""
    Given a core molecule and a fragment, this function rotates the fragment atoms a certain theta angle around an axis
    (set by the bond).
    :param bond: Bio.PDB.Atom list composed by two elements: [heavy atom of the core, heavy atom of the fragment]
    :param theta: Rotation angle in rads.
    :param core_bond: Bio.PDB.Atom list with two elements: [heavy atom, hydrogen atom]. These two atoms have to be the
    ones participating in the bond of the core that we would like to use as linking point between core and fragment.
    :param list_of_atoms: list_of_atoms: Bio.PDB.Atom list with all the atoms of the fragment. These atoms have to contain
    coordinates.
    :param fragment_bond: Bio.PDB.Atom list with two elements: [hydrogen atom, heavy atom]. These two atoms have to be the
    ones participating in the bond of the fragment that we would like to use as linking point between fragment and core.
    :param core_structure: ProDy molecule that contain only the core ligand.
    :param fragment_structure: ProDy molecule that contain only the fragment ligand.
    :return: ProDy molecule with the core_structure and the fragment_structure rotated around the axis of the bond.
    """ # Obtain the axis that we want to use as reference for the rotation # Obtain the rotation matrix for the vector (axis) and the angle (theta) # Multiply the matrix of coordinates for the transpose of the rotation matrix to get the coordinates rotated
ProDy molecule with the core_structure and the fragment_structure rotated around the axis of the bond.
ProDy molecule with the core_structure and the fragment_structure rotated around the axis of the bond .
bond
Bio.PDB.Atom list composed by two elements: [heavy atom of the core, heavy atom of the fragment]
Bio . PDB . Atom list composed by two elements : [ heavy atom of the core heavy atom of the fragment ]
theta
Rotation angle in rads.
Rotation angle in rads .
core_bond
Bio.PDB.Atom list with two elements: [heavy atom, hydrogen atom]. These two atoms have to be the
ones participating in the bond of the core that we would like to use as linking point between core and fragment.
Bio . PDB . Atom list with two elements : [ heavy atom hydrogen atom ] . These two atoms have to be the ones participating in the bond of the core that we would like to use as linking point between core and fragment .
list_of_atoms
Bio.PDB.Atom list with all the atoms of the fragment. These atoms have to contain
coordinates.
Bio . PDB . Atom list with all the atoms of the fragment . These atoms have to contain coordinates .
fragment_bond
Bio.PDB.Atom list with two elements: [hydrogen atom, heavy atom]. These two atoms have to be the
ones participating in the bond of the fragment that we would like to use as linking point between fragment and core.
Bio . PDB . Atom list with two elements : [ hydrogen atom heavy atom ] . These two atoms have to be the ones participating in the bond of the fragment that we would like to use as linking point between fragment and core .
core_structure
ProDy molecule that contain only the core ligand.
ProDy molecule that contain only the core ligand .
fragment_structure
ProDy molecule that contain only the fragment ligand.
ProDy molecule that contain only the fragment ligand .
pdb_complex
pdb_fragment
chain_complex
chain_fragment
output_path
only_grow