frag_pele/Growing/add_fragment_from_pdbs.py
def extract_hydrogens(pdb_atom_names, lists_of_bioatoms, list_of_pdbs, h_core=None, h_frag=None, c_chain="L", f_chain="L",
                      c_resnum=None, f_resnum=None):
    """
    Given a heavy atom name (string), a list of Bio.PDB.Atoms objects and a list of pdb files, it returns the hydrogens
    at bonding distance of the heavy atom. If there is more than one, a checking of contacts with the
    protein will be performed. In case of finding a possible contact between the hydrogen and the protein, we will
    reject this hydrogen and we will repeat the check in another one. If all the hydrogens have contacts with the
    protein, the first of them will be selected and a warning will be printed.
    :param pdb_atom_names: heavy atom name (string).
    :param lists_of_bioatoms: list of Bio.PDB.Atom objects.
    :param list_of_pdbs: list of PDB files.
    :return: Bio.PDB.Atom object correspondent to the hydrogen bonded to the heavy atom
    """

    hydrogens = []
    selected_hydrogens = [h_core, h_frag]
    chains = [c_chain, f_chain]
    resnums = [c_resnum, f_resnum]
    for atom_name, pdb, list_of_bioatoms, sel_h, chain, resnum in zip(pdb_atom_names, list_of_pdbs, lists_of_bioatoms, selected_hydrogens, chains,
                                                              resnums):
        complex = prody.parsePDB(pdb)
        # Select name of the H atoms bonded to this heavy atom (the place where we will grow)
        atom_name_hydrogens = pdb_joiner.get_H_bonded_to_grow(atom_name, complex, sel_h, chain=chain, resnum=resnum)
        # Select this hydrogen atoms
        atom_hydrogen = pdb_joiner.select_atoms_from_list(atom_name_hydrogens, list_of_bioatoms)
        hydrogens.append(atom_hydrogen)
    return hydrogens

    Given a heavy atom name (string), a list of Bio.PDB.Atoms objects and a list of pdb files, it returns the hydrogens
    at bonding distance of the heavy atom. If there is more than one, a checking of contacts with the
    protein will be performed. In case of finding a possible contact between the hydrogen and the protein, we will
    reject this hydrogen and we will repeat the check in another one. If all the hydrogens have contacts with the
    protein, the first of them will be selected and a warning will be printed.
    :param pdb_atom_names: heavy atom name (string).
    :param lists_of_bioatoms: list of Bio.PDB.Atom objects.
    :param list_of_pdbs: list of PDB files.
    :return: Bio.PDB.Atom object correspondent to the hydrogen bonded to the heavy atom
    
Given a heavy atom name (string), a list of Bio.PDB.Atoms objects and a list of pdb files, it returns the hydrogens
at bonding distance of the heavy atom. If there is more than one, a checking of contacts with the
protein will be performed. In case of finding a possible contact between the hydrogen and the protein, we will
reject this hydrogen and we will repeat the check in another one. If all the hydrogens have contacts with the
protein, the first of them will be selected and a warning will be printed.
Given a heavy atom name ( string ) a list of Bio . PDB . Atoms objects and a list of pdb files it returns the hydrogens at bonding distance of the heavy atom . If there is more than one a checking of contacts with the protein will be performed . In case of finding a possible contact between the hydrogen and the protein we will reject this hydrogen and we will repeat the check in another one . If all the hydrogens have contacts with the protein the first of them will be selected and a warning will be printed .
def extract_hydrogens(pdb_atom_names, lists_of_bioatoms, list_of_pdbs, h_core=None, h_frag=None, c_chain="L", f_chain="L",
                      c_resnum=None, f_resnum=None):
    hydrogens = []
    selected_hydrogens = [h_core, h_frag]
    chains = [c_chain, f_chain]
    resnums = [c_resnum, f_resnum]
    for atom_name, pdb, list_of_bioatoms, sel_h, chain, resnum in zip(pdb_atom_names, list_of_pdbs, lists_of_bioatoms, selected_hydrogens, chains,
                                                              resnums):
        complex = prody.parsePDB(pdb)
        atom_name_hydrogens = pdb_joiner.get_H_bonded_to_grow(atom_name, complex, sel_h, chain=chain, resnum=resnum)
        atom_hydrogen = pdb_joiner.select_atoms_from_list(atom_name_hydrogens, list_of_bioatoms)
        hydrogens.append(atom_hydrogen)
    return hydrogens
def extract_hydrogens ( pdb_atom_names , lists_of_bioatoms , list_of_pdbs , h_core = None , h_frag = None , c_chain = "L" , f_chain = "L" , c_resnum = None , f_resnum = None ) : hydrogens = [ ] selected_hydrogens = [ h_core , h_frag ] chains = [ c_chain , f_chain ] resnums = [ c_resnum , f_resnum ] for atom_name , pdb , list_of_bioatoms , sel_h , chain , resnum in zip ( pdb_atom_names , list_of_pdbs , lists_of_bioatoms , selected_hydrogens , chains , resnums ) : complex = prody . parsePDB ( pdb ) atom_name_hydrogens = pdb_joiner . get_H_bonded_to_grow ( atom_name , complex , sel_h , chain = chain , resnum = resnum ) atom_hydrogen = pdb_joiner . select_atoms_from_list ( atom_name_hydrogens , list_of_bioatoms ) hydrogens . append ( atom_hydrogen ) return hydrogens
Given a heavy atom name (string), a list of Bio.PDB.Atoms objects and a list of pdb files, it returns the hydrogens
at bonding distance of the heavy atom.
Given a heavy atom name ( string ) a list of Bio . PDB . Atoms objects and a list of pdb files it returns the hydrogens at bonding distance of the heavy atom .
"""
    Given a heavy atom name (string), a list of Bio.PDB.Atoms objects and a list of pdb files, it returns the hydrogens
    at bonding distance of the heavy atom. If there is more than one, a checking of contacts with the
    protein will be performed. In case of finding a possible contact between the hydrogen and the protein, we will
    reject this hydrogen and we will repeat the check in another one. If all the hydrogens have contacts with the
    protein, the first of them will be selected and a warning will be printed.
    :param pdb_atom_names: heavy atom name (string).
    :param lists_of_bioatoms: list of Bio.PDB.Atom objects.
    :param list_of_pdbs: list of PDB files.
    :return: Bio.PDB.Atom object correspondent to the hydrogen bonded to the heavy atom
    """ # Select name of the H atoms bonded to this heavy atom (the place where we will grow) # Select this hydrogen atoms
Bio.PDB.Atom object correspondent to the hydrogen bonded to the heavy atom
Bio . PDB . Atom object correspondent to the hydrogen bonded to the heavy atom
pdb_atom_names
heavy atom name (string).
heavy atom name ( string ) .
lists_of_bioatoms
list of Bio.PDB.Atom objects.
list of Bio . PDB . Atom objects .
list_of_pdbs
list of PDB files.
list of PDB files .
h_core
h_frag
c_chain
f_chain
c_resnum
f_resnum