V(D)J recombination
V(D)J recombination is a mechanism of genetic recombination that occurs in vertebrates, which randomly selects and assembles segments of genes encoding specific proteins with important roles in the immune system.  This site-specific recombination reaction generates a diverse repertoire of T cell receptor (TCR) and immunoglobulin (Ig) molecules that are necessary for the recognition of diverse antigens from bacterial, viral, and parasitic invaders, and from dysfunctional cells such as tumor cells.

# Background
Human antibody molecules (and B cell receptors) comprise heavy and light chains with both constant (C) and variable (V) regions that are encoded by three types of genes.
- Heavy chain gene  located on chromosome 14
- Light chain kappa () gene  located on chromosome 2
- Light chain lambda () gene  located chromosome 22
Multiple genes for the variable regions are encoded in the human genome that contain three distinct types of segments. For example, the immunoglobulin heavy chain region contains 200 Variable (V) genes, 12 Diversity (D) genes, and 4 Joining (J) genes.  The light chains also possess numerous V and J genes, but do not have D genes. By the mechanism of DNA rearrangement of these regional genes it is possible to generate an antibody repertoire >107 possible combinations. (200 x 12 x 4 = 9600, in addition to the 1000 possible light chain combinations)
Most T cell receptors are composed of an alpha chain and a beta chain.  The T cell receptor genes are similar to immunoglobulin genes in that they too contain multiple V, D and J genes in their beta chains (and V and J genes in their alpha chains) that are rearranged during the development of the lymphocyte to provide that cell with a unique antigen receptor.

# V(D)J recombination of immunoglobulins
In the developing B cell, the first recombination event to occur is between one D and one J gene segment of the heavy chain locus.  Any DNA between these two genes is deleted.  This D-J recombination is followed by the joining of one V gene, from a region upstream of the newly formed DJ complex, forming a rearranged VDJ gene.  All other genes between V and D segments of the new VDJ gene are now deleted from the cells genome.  Primary transcript (unspliced RNA) is generated containing the VDJ region of the heavy chain and both the constant mu and delta chains (C and C). (i.e. the primary transcript contains the segments: V-D-J-C-C).  The primary RNA is processed to add a polyadenylation (poly-A) tail after the C chain and to remove sequence between the VDJ segment and this constant gene segment.  Translation of this mRNA leads to the production of the Ig  heavy chain protein.
The kappa () and lamda () chains of the immunoglobulin light chain loci rearrange in a very similar way, except the light chains lack a D segment.  In other words, the first step of recombination for the light chains involves the joining of the V and J chains to give a VJ complex before the addition of the constant chain gene during primary transcription.  Translation of the spliced mRNA for either the kappa or lamda chains results in formation of the Ig  or Ig  light chain protein.
Assembly of the Ig  heavy chain and one of the light chains results in the formation of membrane bound form of the immunglobulin IgM that is expressed on the surface of the immature B cell.

# V(D)J recombination of the T cell receptor
During T cell development, the T cell receptor (TCR) chains undergo essentially the same sequence of ordered recombination events as that described for immunoglobulins.  D-to-J recombination occurs first in the  chain of the TCR.  This process can involve either the joining of the D1 gene segment to one of six J1 segments or the joining of the D2 gene segment to one of six J2 segments.  DJ recombination is followed (as above) with V-to-DJ rearrangements.  All genes between the V-D-J genes in the newly formed complex are deleted and the primary transcript is synthesized that incorporates the constant domain gene (V-D-J-C).  mRNA transcription splices out any intervening sequence and allows translation of the full length protein for the TCR C chain.
The rearrangement of the alpha () chain of the TCR follows  chain rearrangement, and resembles V-to-J rearrangement described for Ig light chains (see above).  The assembly of the - and - chains results in formation of the -TCR that is expressed on a majority of T cells.

# Mechanism of recombination

## Recombination Signal Sequences
The regional genes (V, D, J) are flanked by Recombination Signal Sequences (RSSs) that are recognized by a group of enzymes known collectively as the VDJ recombinase. RSSs are composed of seven conserved nucleotides (a heptamer) that reside next to the gene encoding sequence followed by a spacer (containing either 12 or 23 unconserved nucleotides) followed by a conserved nonamer (9 base pairs).  The RSSs are present on the 3 side (downstream) of a V region and the 5 side (upstream) of the J region.  These are the sides that will be involved in the joining. Only a pair of dissimilar spacer RSSs are efficiently recombined (i.e. one with a spacer of 12 nucleotides will be recombined with one that has a spacer containing 23 nucleotides). This is known as the 12/23 rule of recombination.

## VDJ recombinase
VDJ recombinase refers to a collection of enzymes some of which are lymphocyte specific, and some that are expressed in many cell types. The initial steps of VDJ recombination are carried out by critical lymphocyte specific enzymes, called recombination activating gene-1 and -2 (RAG1 and RAG2).  These enzymes associate with each other to recognize the RSS sequences and induce DNA cleavage at the RSS sequences.  This cleavage only takes place on one strand of DNA, which leads to a nucleotide attack and creation of a hairpin loop.
Other enzymes of the VDJ recombinase are expressed in multiple cell types and are involved in DNA repair following the activity of RAG1 and RAG2. One of these enzymes is called the DNA-dependent protein kinase complex (DNA-PK) that repairs double-stranded DNA.  DNA-PK binds to each end of the broken DNA and recruits several other proteins, including Artemis nuclease, XRCC4 (X-ray repair cross-complementing factor 4), DNA ligase IV, Cernunnos (also called XLF or XRCC4-like factor), and any of several DNA polymerases.  DNA-PK complexes on each DNA end phosphorylate (add phosphate groups to) each other, resulting in activation of Artemis.  Artemis then breaks the hairpin loop that was formed by the RAG proteins.  XRCC4 and Cernunnos act in concert with DNA-PK to align the two DNA ends with each other, and also help to recruit terminal transferase, which adds nucleotides randomly to the ends.  DNA polymerases  and  insert additional nucleotides as needed to make the two ends compatible for joining.  Ligase IV finally links DNA strands on opposite ends of the break to each other, completing the joining process.  
Because of the variability in the exact position of cleavage of the hairpin loop by Artemis, as well as the random nucleotide addition by terminal transferase, the final DNA sequence, and thus the sequence of the resulting antibody, is highly variable, even when the same two V, D, or J segments are joined. This great diversity allows VDJ recombination to generate antibodies even to microbes that neither the organism nor its ancestors have ever previously encountered.