frag_pele/Growing/add_fragment_from_pdbs.py
def join_structures_to_rotate(core_bond, fragment_bond, list_of_atoms, core_structure, fragment_structure):
    """
    It joins two ProDy structures into a single one, merging both bonds (core bond and fragment bond) creating a unique
    bond between the molecules. In order to do that this function performs a cross superimposition (in BioPython) of
    the whole fragment using as reference (fixed part) the atoms of the bond. Then, it transforms this BioPython object
    into ProDy molecule with the coordinates modified. Once we have all ready, the Hydrogens of the bonds will be
    deleted and both structures will be concatenated into a single ProDy object.
    :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 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 list_of_atoms: Bio.PDB.Atom list with all the atoms of the fragment. These atoms have to contain
    coordinates.
    :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 (with the coordinates modified)
    concatenated.
    """
    # Superimpose atoms of the fragment to the core bond
    pdb_joiner.superimpose(core_bond, fragment_bond, list_of_atoms)
    # Get the new coords and change them in prody
    transform_coords_from_bio2prody(fragment_structure, list_of_atoms)
    # Now, we have to remove the hydrogens of the binding
    h_atom_names = [core_bond[1].name, fragment_bond[0].name]
    merged_structure = bond(h_atom_names, [core_structure, fragment_structure])
    return merged_structure

    It joins two ProDy structures into a single one, merging both bonds (core bond and fragment bond) creating a unique
    bond between the molecules. In order to do that this function performs a cross superimposition (in BioPython) of
    the whole fragment using as reference (fixed part) the atoms of the bond. Then, it transforms this BioPython object
    into ProDy molecule with the coordinates modified. Once we have all ready, the Hydrogens of the bonds will be
    deleted and both structures will be concatenated into a single ProDy object.
    :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 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 list_of_atoms: Bio.PDB.Atom list with all the atoms of the fragment. These atoms have to contain
    coordinates.
    :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 (with the coordinates modified)
    concatenated.
    
It joins two ProDy structures into a single one, merging both bonds (core bond and fragment bond) creating a unique
bond between the molecules. In order to do that this function performs a cross superimposition (in BioPython) of
the whole fragment using as reference (fixed part) the atoms of the bond. Then, it transforms this BioPython object
into ProDy molecule with the coordinates modified. Once we have all ready, the Hydrogens of the bonds will be
deleted and both structures will be concatenated into a single ProDy object.
It joins two ProDy structures into a single one merging both bonds ( core bond and fragment bond ) creating a unique bond between the molecules . In order to do that this function performs a cross superimposition ( in BioPython ) of the whole fragment using as reference ( fixed part ) the atoms of the bond . Then it transforms this BioPython object into ProDy molecule with the coordinates modified . Once we have all ready the Hydrogens of the bonds will be deleted and both structures will be concatenated into a single ProDy object .
def join_structures_to_rotate(core_bond, fragment_bond, list_of_atoms, core_structure, fragment_structure):
    pdb_joiner.superimpose(core_bond, fragment_bond, list_of_atoms)
    transform_coords_from_bio2prody(fragment_structure, list_of_atoms)
    h_atom_names = [core_bond[1].name, fragment_bond[0].name]
    merged_structure = bond(h_atom_names, [core_structure, fragment_structure])
    return merged_structure
def join_structures_to_rotate ( core_bond , fragment_bond , list_of_atoms , core_structure , fragment_structure ) : pdb_joiner . superimpose ( core_bond , fragment_bond , list_of_atoms ) transform_coords_from_bio2prody ( fragment_structure , list_of_atoms ) h_atom_names = [ core_bond [ 1 ] . name , fragment_bond [ 0 ] . name ] merged_structure = bond ( h_atom_names , [ core_structure , fragment_structure ] ) return merged_structure
It joins two ProDy structures into a single one, merging both bonds (core bond and fragment bond) creating a unique
bond between the molecules.
It joins two ProDy structures into a single one merging both bonds ( core bond and fragment bond ) creating a unique bond between the molecules .
"""
    It joins two ProDy structures into a single one, merging both bonds (core bond and fragment bond) creating a unique
    bond between the molecules. In order to do that this function performs a cross superimposition (in BioPython) of
    the whole fragment using as reference (fixed part) the atoms of the bond. Then, it transforms this BioPython object
    into ProDy molecule with the coordinates modified. Once we have all ready, the Hydrogens of the bonds will be
    deleted and both structures will be concatenated into a single ProDy object.
    :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 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 list_of_atoms: Bio.PDB.Atom list with all the atoms of the fragment. These atoms have to contain
    coordinates.
    :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 (with the coordinates modified)
    concatenated.
    """ # Superimpose atoms of the fragment to the core bond # Get the new coords and change them in prody # Now, we have to remove the hydrogens of the binding
ProDy molecule with the core_structure and the fragment_structure (with the coordinates modified)
concatenated.
ProDy molecule with the core_structure and the fragment_structure ( with the coordinates modified ) concatenated .
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 .
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 .
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 .
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 .