The direct genetic analysis of the genomes contained within an environmental sample, such as a sample of soil or seawater. It is used particularly in microbiology to characterize the structure, functions, and species composition of microbial communities (microbiomes), without the need to isolate and culture species individually. So a single process can reveal the taxonomic and functional relationships of the several thousand different bacterial species in one gram of soil, some of which may be unknown or difficult to culture in the laboratory. If just the species composition is required, then the analysis focuses on one or a few ribosomal RNA genes, which are highly conserved and good indicators of evolutionary relationships among species. To delineate broader functional relationships, the entire DNA (i.e. the metagenome) or the transcribed RNA (i.e. the metatranscriptome) is analysed. The DNA is extracted from a carefully prepared sample and subjected to shotgun sequencing using next-generation sequencing. The resulting multitude of relatively short DNA sequences is then assembled by computer software into successively longer sequences, by identifying overlapping homologous regions, to yield more reliable information. The sequences are then categorized, or ‘binned’, according to chemical composition or base sequence, by comparing them with several million reference sequences in a database, and assigned to individual strains, species, or closely related groups. Significant features are identified and labelled (see annotation) to establish the taxonomic and functional identities of the organisms within the original sample.