Statements of Cash Flows - USD ($)
12 Months Ended
Dec. 31, 2016
Dec. 31, 2015
Dec. 31, 2014
Cash flows from operating activities:      
Net loss $ (16,516,000) $ (54,664,000) $ (24,455,000)
Adjustments to reconcile net loss to net cash used in operating activities:      
Loss (gain) on extinguishment of debt 4,740,000 (1,900,000)
Write-off of deferred offering costs 445,000
Stock-based compensation expense 6,600,000 2,369,000 214,000
Non-cash interest expense 2,222,000 2,671,000 1,602,000
Amortization of debt issuance costs and debt discount 1,616,000 1,909,000 1,114,000
Depreciation and amortization expense 175,000 84,000 75,000
Fair value adjustment (32,465,000) 27,276,000 7,223,000
Loss on disposal of fixed assets 91,000
Change in assets and liabilities:      
Prepaid expenses and other assets 2,018,000 (1,228,000) 523,000
Accounts payable and accrued expenses 1,118,000 1,315,000 933,000
Other long-term liabilities 184,000
Net cash used in operating activities (29,772,000) (20,268,000) (14,671,000)
Cash flows from investing activities:      
Purchases of property and equipment (643,000) (135,000) (47,000)
Restricted cash for collateral (1,100,000)
Purchases of marketable securities and long-term investments (89,849,000) (19,002,000)
Maturities of marketable securities and long-term investments 44,645,000
Net cash used in investing activities (46,947,000) (19,137,000) (47,000)
Cash flows from financing activities:      
Proceeds from issuance of debt, net of discounts and commissions 82,800,000 25,000,000
Repayment of term notes and related accrued interest (18,621,000)
Payment of principal on convertible notes arising from capitalized interest (1,931,000)
Payment of deferred offering costs (164,000) (315,000) (1,767,000)
Payment of debt and stock issuance costs (983,000) (2,533,000) (163,000)
Repayment of obligations under capital lease (79,000) (32,000) (31,000)
Proceeds from exercise of warrants 141,000 413,000
Proceeds from initial public offering, net of discounts and commissions 59,892,000
Repayment of line of credit (35,000)
Net cash provided by financing activities 61,163,000 61,468,000 23,004,000
Net (decrease) increase in cash and cash equivalents (15,556,000) 22,063,000 8,286,000
Cash and cash equivalents, beginning of year 32,318,000 10,255,000 1,969,000
Cash and cash equivalents, end of year 16,762,000 32,318,000 10,255,000
Supplemental cash flow information:      
Cash paid for interest 3,289,000 3,000
Transfer of warrants to equity upon exercise 755,000 4,293,000
Fixed assets included in accounts payable and accrued expenses 281,000
Deferred offering costs included in accounts payable and accrued expenses 85,000 428,000 315,000
Fixed assets financed under a capital lease agreement 867,000
Trade date receivables 5,003,000
Unpaid offering costs charged to equity 3,276,000
Conversion of preferred stock into common stock upon initial public offering 28,207,000
Reclassification of 2013 warrants to equity 1,110,000
Embedded put option on Deerfield warrant 220,000
Issuance of Series D preferred stock as transaction fee 1,500,000
Conversion of 2013 convertible notes and interest into Series D preferred stock 4,159,000
Issuance of 2013 warrants and Deerfield warrant 7,610,000
Series D-1 Redeemable Convertible Preferred Stock [Member]      
Cash flows from financing activities:      
Proceeds from issuance of Series D-1 redeemable convertible preferred stock 4,000,000
Series D Redeemable Convertible Preferred Stock [Member]      
Cash flows from financing activities:      
Proceeds from exercise of warrants $ 43,000