def test_calculate_sn_fold_multiple(self): infile = os.path.join(curDir, "input", "test_sn_fold_input.csv") outfile = os.path.join(curDir, "output", "tmp", "sn_fold_output.csv") output_columns = [ "murcko_smiles", "sn_smiles", "fold_id", "success", "error_message", ] output_types = ["object", "object", "int", "bool", "object"] sa = ScaffoldFoldAssign( nfolds=self.config["scaffold_folding"]["nfolds"], secret=self.keys["key"]) dt = DfTransformer( sa, input_columns={"canonical_smiles": "smiles"}, output_columns=output_columns, output_types=output_types, ) dt.process_file(infile, outfile) result = filecmp.cmp( os.path.join(curDir, "output", "test_sn_fold_output.csv"), os.path.join(outfile), shallow=False, ) self.assertEqual(result, True)
def test_calculate_snfold_single_hard(self): """test the single claculation based on hard coded parameters""" input_smiles = ( "Cc1ccc(cc1Nc2nccc(n2)c3cccnc3)NC(=O)c4ccc(cc4)CN5CCN(CC5)C" # imatinib ) sa = ScaffoldFoldAssign(nfolds=5, secret="melloddy") result_actual = sa.calculate_single(input_smiles) result_expected = ( "O=C(Nc1cccc(Nc2nccc(-c3cccnc3)n2)c1)c1ccc(CN2CCNCC2)cc1", "c1ccc(Nc2nccc(-c3cccnc3)n2)cc1", 2, True, None, ) self.assertEqual(result_actual, result_expected)
def test_calculate_snfold_single_config(self): """test the single claculation based on config file conent""" input_smiles = ( "Cc1ccc(cc1Nc2nccc(n2)c3cccnc3)NC(=O)c4ccc(cc4)CN5CCN(CC5)C" # imatinib ) sa = ScaffoldFoldAssign( nfolds=self.config["scaffold_folding"]["nfolds"], secret=self.keys["key"]) result_actual = sa.calculate_single(input_smiles) result_expected = ( "O=C(Nc1cccc(Nc2nccc(-c3cccnc3)n2)c1)c1ccc(CN2CCNCC2)cc1", "c1ccc(Nc2nccc(-c3cccnc3)n2)cc1", 2, True, None, ) self.assertEqual(result_actual, result_expected)