コード例 #1
0
    def testPdbToS2ESampleDict(self):
        """ Check the utility that converts a pdb file to an s2e sample dict.
        """

        # Setup path to pdb file.
        pdb_path = generateTestFilePath("2nip.pdb")

        # Attempt to load it.
        return_dict = IOUtilities._pdbToS2ESampleDict(pdb_path)

        # Check that return type is a dict.
        self.assertIsInstance( return_dict, dict )

        # Check items on dict.
        self.assertIsInstance( return_dict['Z'], numpy.ndarray )
        self.assertIsInstance( return_dict['r'], numpy.ndarray )
        self.assertIsInstance( return_dict['selZ'], dict )
        self.assertIsInstance( return_dict['N'], int )
        self.assertEqual( return_dict['Z'].shape, (4728,) )
        self.assertEqual( return_dict['r'].shape, (4728,3) )