Multi-omics analysis of niche specificity provides new insights into ecological adaptation in bacteria