frag_pele/Growing/add_fragment_from_pdbs.py
def bond(hydrogen_atom_names, molecules):
    """
    Given a list with names of hydrogens (bonded to the heavy atoms that we want to link) and a list of molecules (prody
    molecule object), this function errase this hydrogens and bond the heavy atoms linked to them. In order to create
    this new bond we concatenate the pairs of molecules (prody molecule object).
    Note that the lists need to have pairs of hydrogens and molecules because the bonding is going to happen between
    adjacent pairs of hydrogens atoms and molecules.
    :param hydrogen_atom_names: names of hydrogens (bonded to the heavy atoms that we want to link). Each two elements
    of the list will be considered as hydrogens that will form the bond.
    :param molecules: prody molecule object. Each two elements of the list will be considered as molecules
    that will be bonded.
    :return: list of prody molecule objects as a result of merging the pairs of molecules.
    """
    list_of_pairs = []
    for hydrogen, molecule in zip(hydrogen_atom_names, molecules):
        # Now, we have to remove the hydrogens of the binding, so we will select everything except these H
        mol_no_h = molecule.select("not name {}".format(hydrogen))
        list_of_pairs.append(mol_no_h)
    # Merging both parts into a single one
    i = 0
    bonds = []
    while i < len(list_of_pairs):
        merged = list_of_pairs[i].copy() + list_of_pairs[i+1].copy()
        bonds.append(merged)
        i += 2
    return bonds

    Given a list with names of hydrogens (bonded to the heavy atoms that we want to link) and a list of molecules (prody
    molecule object), this function errase this hydrogens and bond the heavy atoms linked to them. In order to create
    this new bond we concatenate the pairs of molecules (prody molecule object).
    Note that the lists need to have pairs of hydrogens and molecules because the bonding is going to happen between
    adjacent pairs of hydrogens atoms and molecules.
    :param hydrogen_atom_names: names of hydrogens (bonded to the heavy atoms that we want to link). Each two elements
    of the list will be considered as hydrogens that will form the bond.
    :param molecules: prody molecule object. Each two elements of the list will be considered as molecules
    that will be bonded.
    :return: list of prody molecule objects as a result of merging the pairs of molecules.
    
Given a list with names of hydrogens (bonded to the heavy atoms that we want to link) and a list of molecules (prody
molecule object), this function errase this hydrogens and bond the heavy atoms linked to them. In order to create
this new bond we concatenate the pairs of molecules (prody molecule object).
Note that the lists need to have pairs of hydrogens and molecules because the bonding is going to happen between
adjacent pairs of hydrogens atoms and molecules.
Given a list with names of hydrogens ( bonded to the heavy atoms that we want to link ) and a list of molecules ( prody molecule object ) this function errase this hydrogens and bond the heavy atoms linked to them . In order to create this new bond we concatenate the pairs of molecules ( prody molecule object ) . Note that the lists need to have pairs of hydrogens and molecules because the bonding is going to happen between adjacent pairs of hydrogens atoms and molecules .
def bond(hydrogen_atom_names, molecules):
    list_of_pairs = []
    for hydrogen, molecule in zip(hydrogen_atom_names, molecules):
        mol_no_h = molecule.select("not name {}".format(hydrogen))
        list_of_pairs.append(mol_no_h)
    i = 0
    bonds = []
    while i < len(list_of_pairs):
        merged = list_of_pairs[i].copy() + list_of_pairs[i+1].copy()
        bonds.append(merged)
        i += 2
    return bonds
def bond ( hydrogen_atom_names , molecules ) : list_of_pairs = [ ] for hydrogen , molecule in zip ( hydrogen_atom_names , molecules ) : mol_no_h = molecule . select ( "not name {}" . format ( hydrogen ) ) list_of_pairs . append ( mol_no_h ) i = 0 bonds = [ ] while i < len ( list_of_pairs ) : merged = list_of_pairs [ i ] . copy ( ) + list_of_pairs [ i + 1 ] . copy ( ) bonds . append ( merged ) i += 2 return bonds
Given a list with names of hydrogens (bonded to the heavy atoms that we want to link) and a list of molecules (prody
molecule object), this function errase this hydrogens and bond the heavy atoms linked to them.
Given a list with names of hydrogens ( bonded to the heavy atoms that we want to link ) and a list of molecules ( prody molecule object ) this function errase this hydrogens and bond the heavy atoms linked to them .
"""
    Given a list with names of hydrogens (bonded to the heavy atoms that we want to link) and a list of molecules (prody
    molecule object), this function errase this hydrogens and bond the heavy atoms linked to them. In order to create
    this new bond we concatenate the pairs of molecules (prody molecule object).
    Note that the lists need to have pairs of hydrogens and molecules because the bonding is going to happen between
    adjacent pairs of hydrogens atoms and molecules.
    :param hydrogen_atom_names: names of hydrogens (bonded to the heavy atoms that we want to link). Each two elements
    of the list will be considered as hydrogens that will form the bond.
    :param molecules: prody molecule object. Each two elements of the list will be considered as molecules
    that will be bonded.
    :return: list of prody molecule objects as a result of merging the pairs of molecules.
    """ # Now, we have to remove the hydrogens of the binding, so we will select everything except these H # Merging both parts into a single one
list of prody molecule objects as a result of merging the pairs of molecules.
list of prody molecule objects as a result of merging the pairs of molecules .
hydrogen_atom_names
names of hydrogens (bonded to the heavy atoms that we want to link). Each two elements
of the list will be considered as hydrogens that will form the bond.
names of hydrogens ( bonded to the heavy atoms that we want to link ) . Each two elements of the list will be considered as hydrogens that will form the bond .
molecules
prody molecule object. Each two elements of the list will be considered as molecules
that will be bonded.
prody molecule object . Each two elements of the list will be considered as molecules that will be bonded .