meeko/setup.py
def merge_hydrogen(self):
        """ standard method to merge hydrogens bound to carbons"""
        merged = 0

        for a, neigh_list in list(self.graph.items()):
            # look for hydrogens
            if not self.get_element(a) == 1:
                continue

            hydrogen_charge = self.get_charge(a)

            for n in neigh_list:
                # look for carbons
                if self.get_element(n) == 6:
                    merged += 1
                    carbon_charge = self.get_charge(n)
                    # carbon adsorbs the final charge
                    self.set_charge(n, carbon_charge + hydrogen_charge)
                    # flag hydrogen to be ignored and set its charge to 0
                    self.set_charge(a, 0)
                    self.set_ignore(a, True)
 standard method to merge hydrogens bound to carbons
standard method to merge hydrogens bound to carbons
standard method to merge hydrogens bound to carbons
def merge_hydrogen(self):
        merged = 0
        for a, neigh_list in list(self.graph.items()):
            if not self.get_element(a) == 1:
                continue
            hydrogen_charge = self.get_charge(a)
            for n in neigh_list:
                if self.get_element(n) == 6:
                    merged += 1
                    carbon_charge = self.get_charge(n)
                    self.set_charge(n, carbon_charge + hydrogen_charge)
                    self.set_charge(a, 0)
                    self.set_ignore(a, True)
def merge_hydrogen ( self ) : merged = 0 for a , neigh_list in list ( self . graph . items ( ) ) : if not self . get_element ( a ) == 1 : continue hydrogen_charge = self . get_charge ( a ) for n in neigh_list : if self . get_element ( n ) == 6 : merged += 1 carbon_charge = self . get_charge ( n ) self . set_charge ( n , carbon_charge + hydrogen_charge ) self . set_charge ( a , 0 ) self . set_ignore ( a , True )
standard method to merge hydrogens bound to carbons
standard method to merge hydrogens bound to carbons
""" standard method to merge hydrogens bound to carbons""" # look for hydrogens # look for carbons # carbon adsorbs the final charge # flag hydrogen to be ignored and set its charge to 0
self