# SCFP6 and OptiSim with more molecules than required
selected_ids9 = OptiSim(func_distance=lambda x, y: np.linalg.norm(x - y),
r=0.5, k=3, tolerance=2.0, random_seed=42).select(arr=fingerprints_secfp6, num_selected=12)
print(selected_ids9)
graph_mols(input_sdf="demo_mols_2d.sdf",selected_ids=selected_ids9)
# SCFP6 and OptiSim with less molecules than required
selected_ids9 = OptiSim(func_distance=lambda x, y: np.linalg.norm(x - y),
r=1.5, k=3, tolerance=2.0, random_seed=42).select(arr=fingerprints_secfp6, num_selected=12)
print(selected_ids9)
graph_mols(input_sdf="demo_mols_2d.sdf",selected_ids=selected_ids9)
#================================================
# SECFP6 and directed sphere exclusion with more molecules than required
selector = DirectedSphereExclusion(r=0.5, tolerance=5.0, start_id=0, random_seed=42,
func_distance=lambda x, y: np.linalg.norm(x - y))
selected_ids10 = selector.select(arr=fingerprints_secfp6, num_selected=12)
print(selected_ids10)
graph_mols(input_sdf="demo_mols_2d.sdf",selected_ids=selected_ids10)
# SECFP6 and directed sphere exclusion with less molecules than required
selector = DirectedSphereExclusion(r=1, tolerance=5.0, start_id=0, random_seed=42,
func_distance=lambda x, y: np.linalg.norm(x - y))
selected_ids10 = selector.select(arr=fingerprints_secfp6, num_selected=12)
print(selected_ids10)
graph_mols(input_sdf="demo_mols_2d.sdf",selected_ids=selected_ids10)
[num_mols_debugging.zip](https://github.com/theochem/DiverseSelector/files/8884694/num_mols_debugging.zip)
If you want to reproduce the results, please find the attached notebook.
I know this is restricted by the parameter settings of the corresponding algorithms. Do we have a solution to help people get the right number of molecules? Or we can print a warning when the returned number of molecules is not equal to what we asked for and tell people the right direction to help navigate the right parameters (increase or decrease some parameter values).