Exemplo n.º 1
0
    def get_complexes(self, rmg_reaction=None):
        """
        A method to create a forward and reverse TS complexes used to initialize transition state geometries
        """

        if not rmg_reaction:
            rmg_reaction = self.rmg_reaction

        reactant_complex = RMGMolecule()
        for react in rmg_reaction.reactants:
            if isinstance(react, RMGMolecule):
                reactant_complex = reactant_complex.merge(react)
            elif isinstance(react, RMGSpecies):
                reactant_complex = reactant_complex.merge(react.molecule[0])

        product_complex = RMGMolecule()
        for prod in rmg_reaction.products:
            if isinstance(prod, RMGMolecule):
                product_complex = product_complex.merge(prod)
            elif isinstance(prod, RMGSpecies):
                product_complex = product_complex.merge(prod.molecule[0])

        reactant_complex.updateMultiplicity()
        product_complex.updateMultiplicity()

        self.complexes = {
            "forward": reactant_complex,
            "reverse": product_complex
        }

        return self.complexes
Exemplo n.º 2
0
    def setup_molecules(self):

        merged_reacts = None
        merged_prods = None

        if len(self.autotst_reaction.rmg_reaction.reactants) == 2:
            merged_reacts = Molecule.merge(
                self.autotst_reaction.rmg_reaction.reactants[0],
                self.autotst_reaction.rmg_reaction.reactants[1])

        if len(self.autotst_reaction.rmg_reaction.products) == 2:
            merged_prods = Molecule.merge(
                self.autotst_reaction.rmg_reaction.products[0],
                self.autotst_reaction.rmg_reaction.products[1])

        return merged_reacts, merged_prods
Exemplo n.º 3
0
    def get_rmg_complexes(self):
        """
        A method to create a forward and reverse TS complexes used to initialize transition state geometries

        Variables:
        - rmg_reaction (RMGReaction): The RMGReaction of interest

        Returns:
        - complexes (dict): a dictionary containing RMGMolecules of the forward and reverse reaction complexes
        """

        if self.rmg_reaction is None:
            self.get_labeled_reaction()

        reactant_complex = RMGMolecule()
        for react in self.rmg_reaction.reactants:
            if isinstance(react, RMGMolecule):
                reactant_complex = reactant_complex.merge(react)
            elif isinstance(react, RMGSpecies):
                for mol in react.molecule:
                    if len(mol.getLabeledAtoms()) > 0:
                        reactant_complex = reactant_complex.merge(mol)

        product_complex = RMGMolecule()
        for prod in self.rmg_reaction.products:
            if isinstance(prod, RMGMolecule):
                product_complex = product_complex.merge(prod)
            elif isinstance(prod, RMGSpecies):
                for mol in prod.molecule:
                    if len(mol.getLabeledAtoms()) > 0:
                        product_complex = product_complex.merge(mol)

        reactant_complex.updateMultiplicity()
        product_complex.updateMultiplicity()

        if len(reactant_complex.getLabeledAtoms()) == 0 or len(
                product_complex.getLabeledAtoms()) == 0:
            logging.warning(
                "REACTING ATOMS LABELES NOT PROVIDED. Please call `Reaction.get_labeled_reaction` to generate labeled complexes"
            )

        self.complexes = {
            "forward": reactant_complex,
            "reverse": product_complex
        }

        return self.complexes
Exemplo n.º 4
0
    def get_complexes(self, rmg_reaction=None):
        """
        A method to create a forward and reverse TS complexes used to initialize transition state geometries

        Variables:
        - rmg_reaction (RMGReaction): The RMGReaction of interest

        Returns:
        - complexes (dict): a dictionary containing RMGMolecules of the forward and reverse reaction complexes
        """

        if not rmg_reaction:
            rmg_reaction = self.rmg_reaction

        reactant_complex = RMGMolecule()
        for react in rmg_reaction.reactants:
            if isinstance(react, RMGMolecule):
                reactant_complex = reactant_complex.merge(react)
            elif isinstance(react, RMGSpecies):
                for mol in react.molecule:
                    if len(mol.getLabeledAtoms()) > 0:
                        reactant_complex = reactant_complex.merge(mol)
        product_complex = RMGMolecule()
        for prod in rmg_reaction.products:
            if isinstance(prod, RMGMolecule):
                product_complex = product_complex.merge(prod)
            elif isinstance(prod, RMGSpecies):
                for mol in prod.molecule:
                    if len(mol.getLabeledAtoms()) > 0:
                        product_complex = product_complex.merge(mol)

        reactant_complex.updateMultiplicity()
        product_complex.updateMultiplicity()

        self.complexes = {
            "forward": reactant_complex,
            "reverse": product_complex}

        return self.complexes