| Share-based compensation - Share-based Compensation Expense (Details) - USD ($) $ in Thousands | 3 Months Ended | |
|---|---|---|
| Mar. 31, 2019 | Mar. 31, 2018 | |
| Total share-based compensation expense included in the consolidated statements of operations | ||
| Total share-based compensation expense | $ 3,479 | $ 4,672 | 
| Research and development | ||
| Total share-based compensation expense included in the consolidated statements of operations | ||
| Total share-based compensation expense | 2,021 | 2,554 | 
| General and administrative | ||
| Total share-based compensation expense included in the consolidated statements of operations | ||
| Total share-based compensation expense | $ 1,458 | $ 2,118 | 
| 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://fasb.org/us-gaap/role/ref/legacyRef 
 | 
| X | ||||||||||
| 
- References No definition available. 
 | 
| X | ||||||||||
| 
- Details 
 | 
| X | ||||||||||
| 
- Details 
 |