There are a large number of reputable IP firms in the San Francisco area that can help you with a software patent. I am a licensed patent attorney, but I primarily work on other utility style patents, not software. That said, the process to file a patent begins first and foremost with a quality prior art search. A prior art search can also be conducted by an IP firm. They will look for any patents or other ideas in the public domain which would preclude you from obtaining a patent...basically they look for your idea or something similar that is already out in the world.
They will also look at your idea to make sure that is meets the criteria for patentability.
This process normally takes around a month to complete and normally costs in the neighborhood of $1000.
Assuming idea is patentable and you move forward, depending on the complexity, the number of office actions (responses from the USPTO) and if there are appeals involved, you are normally looking at $8,000 on the low end, to $30,000 on the high end, in legal fees.
I would start with Gibbs Dunn or Morrison & Foerster as great IP firms to call and discuss this matter with on the West Coast. Both are very established and very respected.
Let me know if you have any other questions or comments.
Best wishes going forward and please rate my answer positively.