Only the ones you caught are transferred. None of them get deleted!
From memory if you don't catch them all it gives you two options: (1) leave all the Pokemon on the old game, so you can try to catch them all again later, or (2) just transfer those few across and leave the old Pokemon on the Gen 4 game.