Flowchart of CMASA algorithm. The CMASA first decides that the query searches to the nrCSA database or the nrPDB/the nrSCOP database. Next, for each structure in database, the CMASA emulated all possible local structures using amino acid substitute. Again, the CMASA calculated the Contact Matrix Average Deviation (CMAD) between the active sites and possible local structures. Then, the CMASA calculated the RMSD and the RMSD based P-value if the CMAD < cutoff. At last, the CMASA ranked all of the hits and add their information.