def make_new_h(atom, x, y, z): """Add a new hydrogen to an atom at the specified position. Args: atom: atom to protonate x: x position of hydrogen y: y position of hydrogen z: z position of hydrogen Returns: new hydrogen atom """ new_h = Atom() new_h.set_property(numb=None, name='H{0:s}'.format(atom.name[1:]), res_name=atom.res_name, chain_id=atom.chain_id, res_num=atom.res_num, x=x, y=y, z=z, occ=None, beta=None) new_h.element = 'H' new_h.bonded_atoms = [atom] new_h.charge = 0 new_h.steric_number = 0 new_h.number_of_lone_pairs = 0 new_h.number_of_protons_to_add = 0 new_h.num_pi_elec_2_3_bonds = 0 atom.bonded_atoms.append(new_h) atom.conformation_container.add_atom(new_h) return new_h