Beispiel #1
0
    def test_from_text(self, filepath, format, compute2d):
        """
        Test if input produces an RDKit molecule.
        Note: Use file as test function input; file content will be read as string,
        which is the input for the class method to be tested here!
        """

        # Let's load a file's content as string (text) to simulate example input data
        with open(filepath, "r") as f:
            text = f.read()

        rmol = Rdkit.from_text(text, format, compute2d)
        self._rdkit_format_tests(rmol)
Beispiel #2
0
    def to_rdkit(self, structure_klifs_id, entity="complex", extension="mol2", compute2d=True):

        text = self.to_text(structure_klifs_id, entity, extension)
        rdkit_mol = Rdkit.from_text(text, extension, compute2d)
        return rdkit_mol