| Share-based compensation - Share-based Compensation Expense (Details) - USD ($) $ in Thousands | 3 Months Ended | 9 Months Ended | ||
|---|---|---|---|---|
| Sep. 30, 2017 | Sep. 30, 2016 | Sep. 30, 2017 | Sep. 30, 2016 | |
| Total share-based compensation expense included in the consolidated statements of operations | ||||
| Total share-based compensation expense | $ 3,199 | $ 2,286 | $ 7,956 | $ 6,825 | 
| Research and development | ||||
| Total share-based compensation expense included in the consolidated statements of operations | ||||
| Total share-based compensation expense | 1,683 | 1,170 | 3,912 | 3,438 | 
| General and administrative | ||||
| Total share-based compensation expense included in the consolidated statements of operations | ||||
| Total share-based compensation expense | $ 1,516 | $ 1,116 | $ 4,044 | $ 3,387 | 
| 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 
 |