| Share-based compensation - Share-based Compensation Expense (Details) - USD ($) $ in Thousands | 3 Months Ended | 6 Months Ended | ||
|---|---|---|---|---|
| Jun. 30, 2016 | Jun. 30, 2015 | Jun. 30, 2016 | Jun. 30, 2015 | |
| Total share-based compensation expense included in the consolidated statements of operations | ||||
| Total share-based compensation expense | $ 2,439 | $ 4,810 | $ 4,541 | $ 6,292 | 
| Research and development | ||||
| Total share-based compensation expense included in the consolidated statements of operations | ||||
| Total share-based compensation expense | 1,376 | 2,533 | 2,268 | 3,500 | 
| General and administrative | ||||
| Total share-based compensation expense included in the consolidated statements of operations | ||||
| Total share-based compensation expense | $ 1,063 | $ 2,277 | $ 2,273 | $ 2,792 | 
| X | ||||||||||
| 
- Definition Represents the expense recognized during the period arising from equity-based compensation arrangements (for example, shares of stock, unit, stock options or other equity instruments) with employees, directors and certain consultants qualifying for treatment as employees. Reference 1: http://www.xbrl.org/2003/role/presentationRef 
 | 
| X | ||||||||||
| 
- References No definition available. 
 | 
| X | ||||||||||
| 
- Details 
 | 
| X | ||||||||||
| 
- Details 
 |