What time of year, Alex? It makes a huge difference in our western mountains. I rode straight east from SF (actually its Berkeley suburb) to Yosemite in early June with overnights in Manteca and Groveland. The flat central valley was dull, but easy riding; a good way to start getting in shape for the mountains to come. From my log entry at Groveland, "The transition from the valley to the Sierra foothills is abrupt, climbing 1900' in 5.5 miles. I took 1:45, all in granny 1 with many stops to prevent overheating. Since the ascent began at mile 57, it made a tough day. The climb looks like L’Alp d’Huez transplanted into a background from an MGM western."
Later in the summer, the valley gets really hot.
The Sierra Cascades route is a pretty way to go south through Sequoia NP and close to Death Valley, where it gets really, really, really hot. Tourists die there from heat, one or two per year.
Check out the National Park Service web sites of each park. They brim with good information.