Income taxes (Details) - USD ($)
$ in Thousands
12 Months Ended
Dec. 31, 2019
Dec. 31, 2018
Deferred tax assets:    
U.S. and state net operating loss carryforwards $ 56,906 $ 49,614
Capitalized R&D 28,427 25,366
Research and development credits 11,717 10,445
Lease liability 1,779 0
Stock-based compensation 1,053 1,989
Depreciation and amortization 545 640
Accrued expenses 507 450
Other temporary differences 38 85
Total deferred tax assets 100,972 88,589
Less valuation allowance (99,249) (88,589)
Deferred tax assets less valuation allowance 1,723 0
ROU asset (1,723) 0
Total deferred tax liabilities (1,723) 0
Net deferred tax assets (deferred tax liabilities) $ 0 $ 0
Reconciliation of income tax expense    
Federal income tax expense at statutory rate 21.00% 21.00%
State income tax, net of federal benefit 6.30% 8.90%
Permanent differences 0.00% 9.00%
Research and development credit 3.30% 6.70%
Change in valuation allowance (27.40%) (43.10%)
Other, net (3.20%) (2.50%)
Effective tax rate 0.00% 0.00%