There are a lot of cats who like to call the shots in the affection department...all we can do is try to figure out what they like and play along.
Some cats are easily overstimulated by petting, and even though they seem to want it, they can't handle more than a couple of strokes without getting upset.
There are many cats who don't like being patted when they're lying down, and a large percentage of cats (mine included) don't like their bellies touched at ALL. Other common "no-fly zones" include paws, tails, whiskers, flanks, and ears. I learned that it's best to not ask questions or try to "get them used" to being patted in those places...less hazardous and easier on the cat to respect their wishes (obviously, if you have to give medicine or trim claws, you need a somewhat different approach. Assumpta hates people touching her paws most of the time, but will let us trim her claws peacably if we're efficient and firm about it, and I can hold her paw in my hand if I clasp it firmly, but gently).
Find the patterns. Is it a part of her body that she doesn't like touched? Is it a certain person, room, or time of day? Is she more aggressive when startled? Does she get enough quality play time? A lot of times, a cat that doesn't get enough opportunity to play and attack will be more snappish and likely to swat at patting (kind of a combination of play aggression and overstimulation aggression). Is there a possibility that she could be in pain, or in heat if she's not spayed (unaltered cats can be very snappish and downright unpleasant).
I'd avoid belly rubs completely and see if that helps. Even if she seems like that's what she wants, I'd avoid it. The belly-rub position is very similar to the defensive-aggressive position of last resort for threatened cats (rolled on the back with all four paws and teeth available for defense...I saw this a LOT when we first got Assumpta, and misread it as "awww...she trusts us already!" I learned my lesson real fast
). Let the patting be when and where she asks for it, at least for now, but avoid patting her while she's lying down. It may take quite a bit of time for her to decide that you're trustworthy. I never used to be able to pat Assumpta while she was sleeping, and it took about 9 months for her to settle in enough to just sigh, stretch, and go back to sleep. If you must pat the sleeping cat, try waking her up first and see if that changes the results at all.
Also, try the free article library at www.littlebigcat.com
and see if any of the articles about play and overstimulation aggression might be of help.