Co-evolution exists ubiquitously in biological systems. At the molecular level, interacting proteins, such as ligands and their receptors and components in protein complexes, co-evolve to maintain their structural and functional interactions. Many proteins contain multiple functional domains interacting with different partners, making co-evolution of interacting domains occur more prominently. Multiple methods have been developed to predict interacting proteins or domains within proteins by detecting their co-variation. This strategy neglects the fact that interacting domains can be highly co-conserved due to their functional interactions. Here we report a novel algorithm to detect signals of both co-positive selection (co-variation) and co-purifying selection (co-conservation). Preliminary results show that our algorithm performs well and outperforms the popular co-variation analysis program CAPS. Our algorithm can be widely used to predict interacting domains in protein and nucleotide sequences and to analyze protein-ncRNA complexes.