Train # 712 from Jack London Sq. Oakland to Merced, Bus 8416 from Merced to Yosemite (actually the Yarts bus) it wont leave until the train arrives so you don't have to worry abount missing it. I've done in two years in a row.
If you are close to BART, take it to Richmond, print your Amtrak/YARTS tickets at the machine, cross the tracks and catch Amtrak there. That might be easier than getting to Jack London Square.