A segmentation gene is a generic term for a gene whose function is to specify tissue pattern in each repeated unit of a segmented organism. Animals are constructed of segments; however, Drosophila segments also contain subdivided compartments. In embryonic drosophila, these segments are called parasegments. Parasegments distinguish them from adult segments, which has 14 segments. In the fruit fly Drosophila melanogaster, segment polarity genes help to define the anterior and posterior polarities within each embryonic parasegment by regulating the transmission of signals via the Wnt signaling pathway and Hedgehog signaling pathway. Segment polarity genes are expressed in the embryo following expression of the gap genes and pair-rule genes. The most commonly cited examples of these genes are engrailed and gooseberry in Drosophila melanogaster. The segment polarity is the last step in embryonic development and a repeated pattern where each half of each segment is deleted and a mirror-image is duplicated and reversed to replace that half segment; thus, forming a pattern element.
Segmentation polarity occurs during the release of morphogens, which functions to differentiate patterns within sections. The development of a pattern depends on the gradients of these morphogens.
In Drosophila, the engrailed gene is located only in cells within the posterior section of every segment. Its role is to distinguish posterior from anterior sections of each segment. Engrailed expression is generally restricted to cells in the posterior compartment but research suggests it may have other functions.
The gooseberry gene's role in segmentation was believed to be involved in segment-polarity class of segmentation genes required for the formation of larval segments because, during embryogenesis, half of the larval segments are replaced by the remain half segment, but in a reversed polarity, which suggested that gooseberry was a single gene. However, it is believed that this mechanism is controlled by two duplicated genes instead of one, which are called gooseberry (gsb) and gooseberry neuro (gsbn).