Whoa, Nelly!
Let's step back a minute. Sure, this is a gun forum, and you did ask about guns, but there is much more to home defense than a boomstick.
Preferable to shooting a bad guy in your home is scaring away a bad guy in your home. Preferable to that is keeping him out of your home.
Your first priority ought to be securing the homestead against unauthorized entry.
Basement apartments are problematic, expecially in quiet residential neighborhoods. It's too danged easy to sneak around the back and quietly enter through the window.
What has been done, or can be done, to secure the windows? Are there bars? Are there stops to prevent the windows from being opened far enough to permit entry? Got any alarms on those windows?
How `bout the door? You do keep it locked all the time, even during the day, right? And it does have a deadbolt with a different key than the last tenant, right?
Got a phone? Good. A cel phone? Is the charger next to the bed? Do you put it there every night?
Ever consider an alarm system? You can get individual, battery-powered doodads that squawk when a door or window is breeched, or get an integrated wireless system that will also call an alarm company dispatcher, your cel, or the police when the alarm goes off.
Then, sure, go get a gun, a safe and some training.
Don't worry too much about the handgun/shotgun issue -- you've not fending off an army. If a handgun will be cheap, easily stored and accessible, go for it. Not too many home invaders/rapists continue their trade with .45, .38, .357, .32 or even .22 holes in their bodies.