in reply to Re^9: Optimization Help
in thread Optimization Help
Yes, I am searching for subgraph isomorphisms.
Sure I will try to explain it. Each graph represents the bonded structure of either a compound from a metabolic database such as the HMDB or it represents the bonded structure of a functional group or other small chemical moeity. I am trying to find all instances of that chemical moeity within the compound of interest and I can do that by searching for all subgraphs which are identical or can be mapped to the chemical moeity.
Yes, in reference to the GT algorithms ignoring the type of data, I have added some heuristics to the part of the algorithm that creates the "mapping matrix", the actual matrix which is enumerated to remedy this. This matrix has rows equal to the number of atoms in the moeity and columns equal to the number of atoms in the query compound. Potential mappings between atom i in the moeity and j in the compound are designated by setting element i,j equal to one. By setting very strict rules based on chemical properties: don't match a C to a N, don't match atoms of differing total bond order etc, I can reduce the number of ones in the mapping matrix, speeding up the enumeration process greatly.
A major reason why I adopted the graph theory approach is flexibility. While not as fast as a hard coded method, it allows me to add new moeities I can search for without modifying my code. Additionally, by searching for a database compound within another database compound with the same formula, I can test for stereoisomerism by ignoring stereochemistry on individual atoms and seeing if the graphs are isomorphic. This is a key step in my research and the GT approach allows me to do that as well as search for moeities.
Hope this answered your questions. Thanks for the help.