Its shares trading at a mere 52 cents and its future threatened by drug failures, Tranzyme will soon be no more as a separate company and also will have a new CEO.

Tranzyme Pharma (NASDAQ: TZYM) is merging with privately held San Diego company Ocera Therapeutics in an all stock deal that gives Ocera a public listing and Tranzyme a path forward after seeing its two lead compounds fail in clinical trials last year.

Tranzyme’s chief executive officer will leave once the deal closes, but the combined company will maintain a Durham office.

The companies announced the definitive merger agreement late Tuesday.

Upon closing, it will be called Ocera Therapeutics and will be led by Dr. Linda Grais, the current president and CEO of Ocera. Its headquarters will remain in San Diego. Tranzyme Chief Medical Officer Franck S. Rousseau will move to the new company but remain in Tranzyme’s existing Durham office. The board of directors will be comprised of representatives from both companies.

When the deal closes, Vipin Garg, Tranzyme’s president and CEO, will leave the company “to pursue other interests.”

“Following an extensive and thorough review of strategic alternatives, we believe the proposed merger with Ocera offers the best value for our stockholders,” Garg said in a statement. “We expect the merger will benefit from the substantial synergies of the combined management team’s extensive experience in drug development, specifically in hepatology, which will help accelerate the transition and allow for efficient execution of the development plan.”

The boards of directors of both companies have already unanimously approved the transaction. The deal will leave Tranzyme shareholders owning approximately 27.4 percent of the combined company; Ocera shareholder will own 72.6 percent. The final number of shares will be adjusted at closing based in part on on each company’s cash levels at the time the deal closes. The merger is expected to close in the third quarter, subject to approval by a majority of Tranzyme stockholders, review by the Securities and Exchange Commission and customary closing conditions as detailed in the merger agreement.

Under the merger agreement, Tranzyme has agreed to sell $20 million worth of its common stock at a price to be determined based on the weighted average trading price of Tranzyme’s closing price in the 10 days leading up to the merger’s closing. Ocera’s investors have committed $20 million to buy that stock in what’s called private equity in public equity, or PIPE, financing. This stock purchase will raise capital for the merged company. All of Ocera’s largest preferred stock investors, including Domain Associates, Thomas McNerney & Partners, Sofinnova Ventures and InterWest Partners, have committed to participate in the PIPE financing.

In connection with the merger, Tranzyme plans to effect a reverse stock split intended to increase its trading price to above the minimum requirements of Nasdaq for allowing the company to remain listed following the transaction.

Tranzyme had focused on developing gastrointestinal treatments. The company’s lead drug candidate, Ulimorelin, was developed to restore normal gastrointestinal function following surgery. But last year, the company found that the compound failed to perform better than a placebo. A second compound, TZP-102, was developed to treat diabetic gastroparesis. But late last year, Tranzyme found that this second compound also failed to distance itself from a placebo.In February, Tranzyme said it would explore strategic alternatives that could include a sale or merger.

Ocera focuses on therapeutics for liver diseases. Grais said in a statement that the merger along with the new financing will allow Ocera to continue its own lead clinical program, OCR-002, a compound in phase II clinical studies to treat hyperammonemia – an excess of ammonia in the blood. It is also being studied as a potential treatment for hepatic encephalopathy, a condition characterized by worsening brain function when the liver is unable to remove toxins from the blood. The condition is found in patients with liver cirrhosis, acute liver failure and acute liver injury. Ocera is currently planning a phase IIb trial studying OCR-002 for the hepatic encephalopathy indication.

The Food and Drug administration has already designated OCR-002 an orphan drug and placed it on the agency’s “fast track” for potential treatments that address unmet medical needs for rare diseases. Ocera is currently planning a phase IIb trial studying OCR-002 for the hepatic encephalopathy indication.