Should you ask for recommendation letter from the professor of a class you didn't get an A in?
I think there are two questions here that help determine whether or not you should ask this person:

Do You Have An Alternative? : This may seem like a simple question, but if this is the only person who you've done relevant coursework with, etc. you might not genuinely have a choice.

Can They Speak to Your Abilities? : While in the United States letters of recommendation often contain positive comments, they don't have to strictly be about people who are unalloyed perfection. What is important is that the person be able to speak to your abilities as a scientist, your probably success in graduate school, etc. "Merely" getting an A- in their class might not mean they don't think highly of your ability to think critically about the subject, etc. - just as getting an A is not a guarantee that they do.

For reference, I ended up looking back at the people I had write my letters of recommendation - I had taken classes with two of the three, and I had gotten A's in neither class.