Because you are pregnant, your cervix is closed tight and filled with a mucus 'plug'. This keeps sperm from getting to your baby, so no, the dna of your little one will not be affected. The only thing that could affect the baby at this point would be if you contracted an std.
Actually, there is a possibility of you having a baby by BOTH men. That's right! Twins by two different father's. Your ex doesn't have to "cum", just the pre-ejaculatory fluid is enough to impregnant you. If you are already pregnant, that baby's DNA is already determined.