Ejemplo n.º 1
0
    def test_11_invertChirality(self):
        molsmile = CHIRAL_SMI
        sm = SmallMol(molsmile)
        aname = CHIRAL_DETAILS[0][0]
        chiral = CHIRAL_DETAILS[0][1]
        aidx = sm.get('idx', 'atomname {}'.format(aname))[0]

        sm.invertChirality(aidx)
        newchiral = sm.isChiral(returnDetails=True)[1][0][-1]

        self.assertNotEqual(chiral,
                            newchiral,
                            msg="The chirality was not formally changed")

        sm.generateConformers(num_confs=1, append=False)
        m = sm.toMolecule()
        fname = NamedTemporaryFile().name + '.mol2'
        m.write(fname)

        sm2 = SmallMol(fname)
        newchiral_confirm = sm2.isChiral(returnDetails=True)[1][0][-1]

        self.assertEqual(newchiral,
                         newchiral_confirm,
                         msg="The chirality was not structurally changed")
Ejemplo n.º 2
0
    def test_13_convertToMolecule(self):
        mol2file = os.path.join(self.dataDir, 'benzamidine.mol2')
        sm = SmallMol(mol2file)
        mol = Molecule(mol2file)
        mol_elements = mol.element.tolist()

        sm_htmd = sm.toMolecule()
        sm_htmd_element = sm_htmd.element.tolist()

        self.assertListEqual(sm_htmd_element, mol_elements, msg="The elements found are different. The handle and convertion"
                                                            "of the SmallMol object into the htmd.Molecule one, probably "
                                                            "get wrong")
Ejemplo n.º 3
0
    def test_13_convertToMolecule(self):
        mol2file = os.path.join(self.dataDir, 'benzamidine.mol2')
        sm = SmallMol(mol2file)
        mol = Molecule(mol2file)
        mol_elements = mol.element.tolist()

        sm_htmd = sm.toMolecule()
        sm_htmd_element = sm_htmd.element.tolist()

        self.assertListEqual(
            sm_htmd_element,
            mol_elements,
            msg="The elements found are different. The handle and convertion"
            "of the SmallMol object into the htmd.Molecule one, probably "
            "get wrong")
Ejemplo n.º 4
0
    def test_11_invertChirality(self):
        molsmile = CHIRAL_SMI
        sm = SmallMol(molsmile)
        aname = CHIRAL_DETAILS[0][0]
        chiral = CHIRAL_DETAILS[0][1]
        aidx = sm.get('idx', 'atomname {}'.format(aname))[0]

        sm.invertChirality(aidx)
        newchiral = sm.isChiral(returnDetails=True)[1][0][-1]

        self.assertNotEqual(chiral, newchiral, msg="The chirality was not formally changed")

        sm.generateConformers(num_confs=1, append=False)
        m = sm.toMolecule()
        fname = NamedTemporaryFile().name + '.mol2'
        m.write(fname)

        sm2 = SmallMol(fname)
        newchiral_confirm = sm2.isChiral(returnDetails=True)[1][0][-1]

        self.assertEqual(newchiral, newchiral_confirm, msg="The chirality was not structurally changed")