Duplications and deletions in genomes: theory and applications