Knotting of DNA caused by a genetic rearrangement