Spotting a week before period

Em
Hi I was wondering if spotting a week before my due date means I'm not pregnant. Considering it's also been a week since I had unprotected sex, could it be the spotting that occurs in pregnancy?