Genomic patterns and phenotypic plasticity in prokaryotes analyzed within an ecological framework