예제 #1
0
    def get_bonds(self):
        """
        A method for identifying all of the bonds in a conformer
        """
        bond_list = []
        for bond in self.rdkit_molecule.GetBonds():
            bond_list.append((bond.GetBeginAtomIdx(), bond.GetEndAtomIdx()))

        bonds = []
        for index, indices in enumerate(bond_list):
            i, j = indices

            length = self.ase_molecule.get_distance(i, j)
            center = False
            if ((self.rmg_molecule.atoms[i].label) and (
                    self.rmg_molecule.atoms[j].label)):
                center = True

            bond = Bond(index=index,
                        atom_indices=indices,
                        length=length,
                        reaction_center=center)
            mask = self.get_mask(bond)
            bond.mask = mask

            bonds.append(bond)

        self.bonds = bonds

        return self.bonds
예제 #2
0
    def get_ts_bonds(self):

        rdmol_copy = self.create_pseudo_geometry()
        bond_list = []
        for bond in rdmol_copy.GetBonds():
            bond_list.append((bond.GetBeginAtomIdx(), bond.GetEndAtomIdx()))

        bonds = []
        for indices in bond_list:
            i, j = indices

            length = self.ase_ts.get_distance(i, j)

            reaction_center = "No"

            if (self.rmg_ts.atoms[i].label != ""
                    and self.rmg_ts.atoms[j].label != ""):
                reaction_center = "Yes"

            elif ((self.rmg_ts.atoms[i].label != ""
                   and self.rmg_ts.atoms[j].label == "")
                  or (self.rmg_ts.atoms[i].label == ""
                      and self.rmg_ts.atoms[j].label != "")):
                reaction_center = "Close"

            bond = Bond(indices=indices,
                        length=length,
                        reaction_center=reaction_center)

            bonds.append(bond)
        self.bonds = bonds
        return self.bonds
예제 #3
0
파일: species.py 프로젝트: rwest/AutoTST
    def get_bonds(self,
                  rdkit_molecule=None,
                  ase_molecule=None,
                  rmg_molecule=None):
        """
        A method for identifying all of the bonds in a conformer
        """

        if not rdkit_molecule:
            rdkit_molecule = self.rdkit_molecule
        if not ase_molecule:
            ase_molecule = self.ase_molecule
        if not rmg_molecule:
            rmg_molecule = self.rmg_molecule
        rdmol_copy = rdkit_molecule

        bond_list = []
        for bond in rdmol_copy.GetBonds():
            bond_list.append((bond.GetBeginAtomIdx(), bond.GetEndAtomIdx()))

        bonds = []
        for index, indices in enumerate(bond_list):
            i, j = indices

            length = ase_molecule.get_distance(i, j)
            center = False
            if ((rmg_molecule.atoms[i].label)
                    and (rmg_molecule.atoms[j].label)):
                center = True

            bond = Bond(index=index,
                        atom_indices=indices,
                        length=length,
                        reaction_center=center)

            bonds.append(bond)

        self.bonds = bonds

        return self.bonds
예제 #4
0
    def get_bonds(self):

        rdmol_copy = self.rdkit_molecule
        bond_list = []
        for bond in rdmol_copy.GetBonds():
            bond_list.append((bond.GetBeginAtomIdx(), bond.GetEndAtomIdx()))

        bonds = []
        for indices in bond_list:
            i, j = indices

            length = self.ase_molecule.get_distance(i, j)

            reaction_center = "No"

            bond = Bond(indices=indices,
                        length=length,
                        reaction_center=reaction_center)

            bonds.append(bond)
        self.bonds = bonds
        return self.bonds
예제 #5
0
 def setUp(self):
     self.bond = Bond(index=1,
                      atom_indices=[1, 2],
                      length=1.8,
                      reaction_center=True,
                      mask=[True, True, True])