Package schrodinger :: Package test :: Module canvas_utils
[hide private]
[frames] | no frames]

Module canvas_utils

Container for common test functions used in Canvas tests

Functions [hide private]
 
read_csv(filename)
Read a canvasMCS csv formatted file.
 
read_pw(filename)
Read a canvasMCS pw formatted file.
 
run_mcs_pw(inputfile)
Run canvasMCS -atomtype 97 on inputfile, produces pairwise output.
 
run_mcs(cmd)
Run a command and check return code and that the phrase "successfully completed" is printed.
 
get_map(list1, list2)
Get a map of elements in list1 to elements in list2.
 
assertAtomMapsEqual(left_map, left_filename, right_map, right_filename)
Check that two dicts representing atom mappings are equal.
 
assertEqual(a, b)
 
assertCSVFilesMatch(test_file, reference_file)
This function considers only the first two records in each file and checks that the pairwise atom mappings are consistent with the reference
 
assertCSVFilesMatchByLine(test_file, reference_file)
This function checks the equivalence of each line with the corresponding line in the reference file
 
assertPWFilesMatch(test_file, reference_file)
The current fields in a PW csv file are: SMILES1 Name1 SMILES2 Name2 i_canvas_MCS_Match_Count i_canvas_MCS_Size i_canvas_MCS_Group i_canvas_MCS_Atom_Count i_canvas_MCS_Bond_Count s_canvas_MCS_Atom_List1 s_canvas_MCS_Bond_List1 s_canvas_MCS_SMARTS1 s_canvas_MCS_Atom_List2 s_canvas_MCS_Bond_List2 s_canvas_MCS_SMARTS2
Variables [hide private]
  __package__ = 'schrodinger.test'
Function Details [hide private]

read_pw(filename)

 

Read a canvasMCS pw formatted file. (pw stands for pair-wise).

run_mcs(cmd)

 

Run a command and check return code and that the phrase "successfully completed" is printed.

Returns:
stdout from the canvasMCS job.

get_map(list1, list2)

 

Get a map of elements in list1 to elements in list2. Fails if the mapping is not one to one. list1 and list2 are strings of comma separated integers.

assertAtomMapsEqual(left_map, left_filename, right_map, right_filename)

 

Check that two dicts representing atom mappings are equal. Functionally equivalent to assertEqual(left_map, right_map), but more precise error reporting.

assertCSVFilesMatch(test_file, reference_file)

 

This function considers only the first two records in each file and checks that the pairwise atom mappings are consistent with the reference

The current fields in a MCS csv file are:

SMILES Name i_canvas_MCS_Match_Count i_canvas_MCS_Size i_canvas_MCS_Group i_canvas_MCS_Atom_Count i_canvas_MCS_Bond_Count s_canvas_MCS_Atom_List s_canvas_MCS_Bond_List s_canvas_MCS_SMARTS

This checks that the SMILES, s_canvas_MCS_Atom_List and fields match. Uses assertAtomMapsEqual to check that the mapping is the same on the LHS and the RHS.

assertCSVFilesMatchByLine(test_file, reference_file)

 

This function checks the equivalence of each line with the corresponding line in the reference file

The current fields in a MCS csv file are:

SMILES Name i_canvas_MCS_Match_Count i_canvas_MCS_Size i_canvas_MCS_Group i_canvas_MCS_Atom_Count i_canvas_MCS_Bond_Count s_canvas_MCS_Atom_List s_canvas_MCS_Bond_List s_canvas_MCS_SMARTS

This checks that the SMILES, s_canvas_MCS_Atom_List and fields match. Uses assertAtomMapsEqual to check that the mapping is the same on the LHS and the RHS.

assertPWFilesMatch(test_file, reference_file)

 

The current fields in a PW csv file are: SMILES1 Name1 SMILES2 Name2 i_canvas_MCS_Match_Count i_canvas_MCS_Size i_canvas_MCS_Group i_canvas_MCS_Atom_Count i_canvas_MCS_Bond_Count s_canvas_MCS_Atom_List1 s_canvas_MCS_Bond_List1 s_canvas_MCS_SMARTS1 s_canvas_MCS_Atom_List2 s_canvas_MCS_Bond_List2 s_canvas_MCS_SMARTS2

This checks that the SMILES, s_canvas_MCS_Atom_List and fields match. Uses assertAtomMapsEqual to check that the mapping is the same on the LHS and the RHS.