The changing of the structure of a gene, resulting in a variant form, caused by the alteration of single base units in DNA, or the deletion, insertion, or rearrangement of larger sections of genes or chromosomes. Mutations may be transmitted to subsequent generations if they occur in the DNA of germ cells (eggs or sperm).