本文整理匯總了Python中pymatgen.analysis.molecule_matcher.MoleculeMatcher.fit方法的典型用法代碼示例。如果您正苦於以下問題:Python MoleculeMatcher.fit方法的具體用法?Python MoleculeMatcher.fit怎麽用?Python MoleculeMatcher.fit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pymatgen.analysis.molecule_matcher.MoleculeMatcher
的用法示例。
在下文中一共展示了MoleculeMatcher.fit方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: fit_with_mapper
# 需要導入模塊: from pymatgen.analysis.molecule_matcher import MoleculeMatcher [as 別名]
# 或者: from pymatgen.analysis.molecule_matcher.MoleculeMatcher import fit [as 別名]
def fit_with_mapper(self, mapper):
coords = [[0.000000, 0.000000, 0.000000],
[0.000000, 0.000000, 1.089000],
[1.026719, 0.000000, -0.363000],
[-0.513360, -0.889165, -0.363000],
[-0.513360, 0.889165, -0.363000]]
mol1 = Molecule(["C", "H", "H", "H", "H"], coords)
op = SymmOp.from_origin_axis_angle([0, 0, 0], [0.1, 0.2, 0.3], 60)
rotcoords = [op.operate(c) for c in coords]
mol2 = Molecule(["C", "H", "H", "H", "H"], rotcoords)
mm = MoleculeMatcher(mapper=mapper)
self.assertTrue(mm.fit(mol1, mol2))
mol1 = Molecule.from_file(os.path.join(test_dir, "benzene1.xyz"))
mol2 = Molecule.from_file(os.path.join(test_dir, "benzene2.xyz"))
self.assertTrue(mm.fit(mol1, mol2))
mol1 = Molecule.from_file(os.path.join(test_dir, "benzene1.xyz"))
mol2 = Molecule.from_file(os.path.join(test_dir, "t2.xyz"))
self.assertFalse(mm.fit(mol1, mol2))
mol1 = Molecule.from_file(os.path.join(test_dir, "c1.xyz"))
mol2 = Molecule.from_file(os.path.join(test_dir, "c2.xyz"))
self.assertTrue(mm.fit(mol1, mol2))
mol1 = Molecule.from_file(os.path.join(test_dir, "t3.xyz"))
mol2 = Molecule.from_file(os.path.join(test_dir, "t4.xyz"))
self.assertTrue(mm.fit(mol1, mol2))
mol1 = Molecule.from_file(os.path.join(test_dir, "j1.xyz"))
mol2 = Molecule.from_file(os.path.join(test_dir, "j2.xyz"))
self.assertTrue(mm.fit(mol1, mol2))
mol1 = Molecule.from_file(os.path.join(test_dir, "ethene1.xyz"))
mol2 = Molecule.from_file(os.path.join(test_dir, "ethene2.xyz"))
self.assertTrue(mm.fit(mol1, mol2))
mol1 = Molecule.from_file(os.path.join(test_dir, "toluene1.xyz"))
mol2 = Molecule.from_file(os.path.join(test_dir, "toluene2.xyz"))
self.assertTrue(mm.fit(mol1, mol2))
mol1 = Molecule.from_file(os.path.join(test_dir, "cyclohexane1.xyz"))
mol2 = Molecule.from_file(os.path.join(test_dir, "cyclohexane2.xyz"))
self.assertTrue(mm.fit(mol1, mol2))
mol1 = Molecule.from_file(os.path.join(test_dir, "oxygen1.xyz"))
mol2 = Molecule.from_file(os.path.join(test_dir, "oxygen2.xyz"))
self.assertTrue(mm.fit(mol1, mol2))
mm = MoleculeMatcher(tolerance=0.001, mapper=mapper)
mol1 = Molecule.from_file(os.path.join(test_dir, "t3.xyz"))
mol2 = Molecule.from_file(os.path.join(test_dir, "t4.xyz"))
self.assertFalse(mm.fit(mol1, mol2))
示例2: test_cdi_23
# 需要導入模塊: from pymatgen.analysis.molecule_matcher import MoleculeMatcher [as 別名]
# 或者: from pymatgen.analysis.molecule_matcher.MoleculeMatcher import fit [as 別名]
def test_cdi_23(self):
mm = MoleculeMatcher(tolerance=0.05, mapper=InchiMolAtomMapper())
mol1 = Molecule.from_file(os.path.join(test_dir, "cdi_23_1.xyz"))
mol2 = Molecule.from_file(os.path.join(test_dir, "cdi_23_2.xyz"))
self.assertFalse(mm.fit(mol1, mol2))
示例3: test_strange_inchi
# 需要導入模塊: from pymatgen.analysis.molecule_matcher import MoleculeMatcher [as 別名]
# 或者: from pymatgen.analysis.molecule_matcher.MoleculeMatcher import fit [as 別名]
def test_strange_inchi(self):
mm = MoleculeMatcher(tolerance=0.05, mapper=InchiMolAtomMapper())
mol1 = Molecule.from_file(os.path.join(test_dir, "k1.sdf"))
mol2 = Molecule.from_file(os.path.join(test_dir, "k2.sdf"))
self.assertTrue(mm.fit(mol1, mol2))
示例4: test_thiane_ethynyl
# 需要導入模塊: from pymatgen.analysis.molecule_matcher import MoleculeMatcher [as 別名]
# 或者: from pymatgen.analysis.molecule_matcher.MoleculeMatcher import fit [as 別名]
def test_thiane_ethynyl(self):
mm = MoleculeMatcher(tolerance=0.05, mapper=InchiMolAtomMapper())
mol1 = Molecule.from_file(os.path.join(test_dir, "thiane_ethynyl1.sdf"))
mol2 = Molecule.from_file(os.path.join(test_dir, "thiane_ethynyl2.sdf"))
self.assertFalse(mm.fit(mol1, mol2))
示例5: test_thiane
# 需要導入模塊: from pymatgen.analysis.molecule_matcher import MoleculeMatcher [as 別名]
# 或者: from pymatgen.analysis.molecule_matcher.MoleculeMatcher import fit [as 別名]
def test_thiane(self):
mm = MoleculeMatcher(tolerance=0.05, mapper=InchiMolAtomMapper())
mol1 = read_mol(os.path.join(test_dir, "thiane1.sdf"))
mol2 = read_mol(os.path.join(test_dir, "thiane2.sdf"))
self.assertFalse(mm.fit(mol1, mol2))