Rata means rat and is always feminine, while ratón means mouse and is always masculine.
The word macho and hembra are actually nouns (not adjectives) that are used in juxtaposition with the base animal. Therefore, you'll always use macho or hembra, regardless the gender of the base noun. This happens with a number of animal species, such as with tiburón (always masculine) or pantera (always feminine).
Because they're juxtaposed nouns (rather than adjectives), when following a plural noun, there is considerable variability amongst speakers as to whether the one should use macho/hembra or machos/hembras (specifically, with respect to ratas, macho is preferred to machos and hembras more than hembra, go figure).
So to answer the last bit, you would say
Tengo una rata hembra y tres ratas macho(s)
Initially the sentence, strictly speaking, should be "Mi rata Miguel es simpática" agreeing in feminine, but after that, it would be quite common to say something like "él también puede ser muy antipático si no le doy de comer con tres veces al día". It's literally just the word rata that's feminine, any other time, you're talking about him, not the animal (which sounds a bit weird, I know).