Will having a mediocre undergrad GPA ruin my chance getting into a PhD program I transferred from a four-year university into one of the UCs last year majoring in biological sciences. Unfortunately, my UC gpa is not as high as I wanted it to be. I used to have a 3.9 but can only get a 3.4 in UC. I am planning on applying for a biomedical PhD program this year as I am graduating next year but I am very worried about my gpa ruining my chance of getting in as PhD programs are highly competitive. I did okay on my major courses but I do have 2 B- in organic chemistry A and B, which I am really concerning about right now. With this kind of grade, will I stand a chance in the PhD application?
Mediocre grades don't help, of course, but a doctoral admissions committee will look at much more than your GPA. Many things are considered, especially the things people say about you in your letters of recommendation. Your statement of purpose, which is often required, can also be a big factor. You need to show that you are both highly qualified and a good candidate for success in the program. 

So, yes, you have a chance, but the competition will also be fierce. If you want to continue in organic chemistry, or something that depends heavily on it, then you need to explain those grades, but, depending on the field you choose it might be a relatively small factor. But your record will be judged by humans, not an automaton, so many things can affect what happens.