Many years ago I went on a Defensive Motorcycle Riding course ... the principles are exactly the same for bicycles and have helped me avoid "situations".
As for assertively taking your place in lane when appropriate, ie: take up the space your car would occupy if you were driving it, I always reckon that, if drivers honk or shout at you, it does mean it's probable they've seen you, although that terrible Brasilian incident makes you wonder if it really isn't just a war.