to do something that is the opposite of what is usually done
It's not easy to go against the grain and buy stocks when others are selling them. Usage notes: sometimes used with verbs other than go: The changes will certainly rub against the grain here.