A gene is a locus (or region) of DNA that encodes a functional RNA or protein product, and is the molecular unit of heredity.