Activated sludge (AS) plays a crucial role in the treatment of domestic and industrial wastewater. AS is a biocenosis of microorganisms capable of degrading various pollutants, including organic compounds, toxicants, and xenobiotics. We performed 16S rRNA gene sequencing of AS and incoming sewage in three wastewater treatment plants (WWTPs) responsible for processing sewage with different origins: municipal wastewater, slaughterhouse wastewater, and refinery sewage. In contrast to incoming wastewater, the taxonomic structure of AS biocenosis was found to become stable in time, and each WWTP demonstrated a unique taxonomic pattern. Most pathogenic microorganisms (Streptococcus, Trichococcus, etc.), which are abundantly represented in incoming sewage, were significantly decreased in AS of all WWTPs, except for the slaughterhouse wastewater. Additional load of bioreactors with influent rich in petroleum products and organic matter was associated with the increase of bacteria responsible for AS bulking and foaming. Here, we present a novel approach enabling the prediction of the metabolic potential of bacterial communities based on their taxonomic structures and MetaCyc database data. We developed a software application, XeDetect, to implement this approach. Using XeDetect, we found that the metabolic potential of the three bacterial communities clearly reflected the substrate composition. We revealed that the microorganisms responsible for AS bulking and foaming (most abundant in AS of slaughterhouse wastewater) played a leading role in the degradation of substrates such as fatty acids, amino acids, and other bioorganic compounds. Moreover, we discovered that the chemical, rather than the bacterial composition of the incoming wastewater was the main factor in AS structure formation. XeDetect (freely available: https://sourceforge.net/projects/xedetect) represents a novel powerful tool for the analysis of the metabolic capacity of bacterial communities. The tool will help to optimize bioreactor performance and avoid some most common technical problems.