This invention is to use knowledge 
pattern learning and search 
system for selecting microorganisms to produce useful materials and to generate 
clean energy from wastes, wastewaters, 
biomass or from other inexpensive sources. The method starts with an 
in silico screening platform which involves multiple steps. First, the organisms' profiles are compiled by linking the massive genetic and chemical fingerprints in the metabolic and energy-generating biological pathways (e.g. codon usages, 
gene distributions in function categories, etc.) to the organisms' biological behaviors. Second, a 
machine learning and 
pattern recognition system is used to group the 
organism population into characteristic groups based on the profiles. Lastly, one or a group of microorganisms are selected based on profile match scores calculated from a defined metabolic efficiency measure, which, in term, is a prediction of a desired capability 
in real life based on an 
organism's profile. In the example of recovering 
clean energy from treating wastewaters from 
food process industries, domestic or municipal wastes, animal or meat-packing wastes, microorganisms' metabolic capabilities to digest 
organic matter and generate 
clean energy are assessed using the invention, and the most effective organisms in terms of waste reduction and energy generation are selected based on the content of a biowaste input and a desired clean energy output. By selecting a 
microorganism or consortia of multiply microorganisms using this method, one can clean the water and also directly generate 
electricity from Microbial 
Fuel Cells (MFC), or 
hydrogen, 
methane or other biogases from 
microorganism fermentation. In addition, using similar 
screening method, clean 
hydrogen can be recovered first from an anaerobic 
fermentation process accompanying the 
wastewater treatment, and the end products from the 
fermentation process can be fed into a 
Microbial Fuel Cell (MFC) process to generate clean 
electricity and at the same time treat the 
wastewater. The invention can be used to first select the hydrogenic microorganisms to efficiently generate 
hydrogen and to select electrogenic organisms to convert the wastes into 
electricity. This method can be used for converting wastes to one or more forms of renewable energies.