Income taxes (Details 3) (USD $)
12 Months Ended
Dec. 31, 2014
Dec. 31, 2013
Dec. 31, 2012
Reconciliation of income taxes computed using the U.S. federal statutory rate      
Income tax benefit using U.S. federal statutory rate (as a percent) 34.00% 34.00%  
State tax benefit, net of federal benefit (as a percent) 4.73% 4.69%  
Research and development tax credits (as a percent) 1.51% 1.67%  
Permanent items (as a percent) (6.25%) (4.76%)  
Change in the valuation allowance (as a percent) (34.34%) (35.20%)  
Other (as a percent) 0.35% (0.40%)  
Deferred tax assets:      
Net operating loss carryforwards $ 42,352,000 $ 25,782,000  
Capitalized research and development 2,154,000 1,839,000  
Research and development credits 2,880,000 1,856,000  
Stock-based compensation 726,000 511,000  
Other 199,000 (4,000)  
Gross deferred tax assets 48,311,000 29,984,000  
Valuation allowance (48,311,000) (29,984,000)  
Increase in valuation allowance 18,300,000 14,500,000 10,300,000
Adjustment for unrecognized income tax benefits 0    
Unrecognized tax benefits 0    
Interest and penalties accrued related to unrecognized tax benefits 0    
Uncertain tax positions $ 0