In the context of the genome rearrangement problem, we analyze two well known models, namely the reversal and the prefix reversal models, by exploiting the connection with the notion of permutation pattern. More specifically, for any k, we provide a characterization of the set of permutations having distance ≤ k from the identity (which is known to be a permutation class) in terms of what we call generating peg permutations and we describe some properties of its basis, which allow to compute such a basis for small values of k. * Both authors are members of the INdAM Research group GNCS; they are partially supported by INdAM -GNCS 2018 project "Proprietá combinatorie e rilevamento di pattern in strutture discrete lineari e bidimensionali" and by a grant of the "Fondazione della Cassa di Risparmio di Firenze" for the project "Rilevamento di pattern: applicazioni a memorizzazione basata sul DNA, evoluzione del genoma, scelta sociale".