Evolutionary dynamics of transposable elements in prokaryotes and eukaryotes