Stockholders' equity | Stockholders' equity As of September 30, 2018 , the Company has authorized 250,000,000 shares of common stock at $0.001 par value per share and 25,000,000 shares of preferred stock at $0.001 par value per share. As of September 30, 2018 , 86,625,975 shares of common stock and 1,635 shares of preferred stock were issued and outstanding. As of December 31, 2017 , 28,734,898 shares of common stock were issued and outstanding and no shares of preferred stock were issued and outstanding. Underwritten public offering On January 17, 2018, the Company entered into two underwriting agreements, the first relating to the underwritten public offering of 53,365,000 shares of the Company’s common stock, par value $0.001 per share, and accompanying Warrants to purchase up to 26,682,500 shares of common stock, at a combined price to the public of $1.00 per share, for gross proceeds of approximately $53.4 million (the “Common Stock Offering”) and the second relating to the underwritten public offering of 1,635 shares of the Company’s Series A convertible preferred stock, par value $0.001 per share, which are convertible into 1,635,000 shares of common stock, and accompanying warrants to purchase up to 817,500 shares of common stock for gross proceeds of approximately $1.6 million (the “Preferred Stock Offering,” and together with the Common Stock Offering, the “January 2018 Financing”). Under the terms of the underwriting agreement for the Common Stock Offering, the Company also granted the underwriters the Overallotment Option to purchase up to an additional 8,004,750 shares of common stock and/or additional warrants to purchase up to 4,002,375 shares of common stock. On January 19, 2018, the underwriters exercised their Overallotment Option to acquire additional warrants to purchase up to 1,438,050 shares of common stock. On February 21, 2018, the underwriters exercised their Overallotment Option to acquire an additional 957,745 shares of common stock. The Company received approximately $1.0 million in gross proceeds from the underwriter’s exercise of the Overallotment Option. The remainder of the Overallotment Options expired unexercised. Preferred Stock Each share of preferred stock is convertible at any time at the option of the holder, provided that the holder will be prohibited from converting the preferred stock into shares of common stock if, as a result of such conversion, the holder, together with its affiliates, would own more than 9.99% of the total number of shares of common stock then issued and outstanding. Each share of preferred stock is initially convertible into 1,000 shares of common stock, subject to certain adjustments upon stock dividends and stock splits. The preferred stock ranks pari passu on an as-converted to common stock basis with the common stock as to distributions of assets upon the Company’s liquidation, dissolution or winding up, whether voluntarily or involuntarily, or a “Fundamental Transaction,” as defined in the Certificate of Designation. Shares of preferred stock have no voting rights, except as required by law and except that the consent of the holders of a majority of the outstanding preferred stock is required to amend the terms of the preferred stock. The holders of preferred stock shall be entitled to receive dividends in the same form as dividends actually paid on shares of common stock when, as and if such dividends are declared and paid on shares of the common stock, on an as-if-converted-to-common stock basis. Warrants The Warrants are exercisable at any time, or from time-to-time during the period beginning on the date of issuance and expiring on the five-year anniversary of such issuance date, at an exercise price of $1.20 per share. In the event of an “Acquisition,” defined generally to include a merger or consolidation resulting in the sale of 50% or more of the voting securities of the Company, the sale of all, or substantially all, of the assets or voting securities of the Company, or other change of control transaction, as defined in the Warrants, the Company will be obligated to use its best efforts to ensure that the holders of the Warrants receive new warrants from the surviving or acquiring entity (the “Acquirer”). The new warrants to purchase shares in the Acquirer shall have the same expiration date as the Warrants and a strike price that is based on the proportion of the value of the Acquirer’s stock to the Company’s common stock. If the Company is unable, despite its best efforts, to cause the Acquirer to issue new warrants in the Acquisition as described above, then, if the Company’s stockholders are to receive cash in the Acquisition, the Company will settle the Warrants in cash and if the Company’s stockholders are to receive stock in the Acquisition, the Company will issue shares of its common stock to each Warrant holder. Accounting for the January 2018 Financing Transaction In assessing the accounting for the January 2018 Financing, the Company first determined that the common and preferred stock and the Warrants represented separable freestanding financial instruments. Next, the Company determined that the Warrants should be liability classified in accordance with ASC 480, Distinguishing Liabilities from Equity (“ASC 480”), given the ability for the holders of the Warrants to redeem the Warrants for cash in certain Acquisition scenarios, as described above. As such, the Company allocated proceeds from the Common Stock Offering and Preferred Stock Offering in order to record the related Warrants at their fair value as of the date of issuance. In addition, the Company recorded the Warrants issued to the underwriters as part of the exercise of their Overallotment Option at their fair value as of the date of issuance. As the Warrants are liability-classified, the Company remeasures the fair value of the Warrants at each reporting date. The Company recorded the Warrants issued in the January 2018 Financing at their estimated fair value of approximately $18.2 million as of the issuance date. The Company recorded expense of approximately $3.2 million in the quarter ended March 31, 2018, income of approximately $5.5 million in the quarter ended June 30, 2018, and income of approximately $2.9 million in the quarter ended September 30, 2018, in the condensed consolidated statement of operations associated with the remeasurement of the Warrants to fair value. The fair value of the warrant liability is approximately $13.0 million as of September 30, 2018 (see Note 3). In assessing the preferred stock, the Company determined that it was more equity-like in nature, which served as the basis for evaluating the other embedded features within the preferred stock. The Company determined that the conversion feature, redemption feature and other embedded features of the preferred stock did not meet the definition of derivatives and did not require separate accounting. The Company determined that the preferred stock should be classified as permanent equity as its redemption, dividends, covenants, liquidation and conversion features are more equity-like than debt-like. The Company further assessed the conversion feature of the preferred stock to determine if it was beneficial to the holder at issuance. Given the value allocated from the preferred stock to the Warrants issued in the Preferred Stock Offering, the Company determined that the effective conversion price was in the money at issuance and calculated the intrinsic value of the beneficial conversion of approximately $0.3 million . The Company recorded this amount to additional paid-in capital upon the issuance of the preferred stock. The Company determined that the Overallotment Option should be classified as a liability in accordance with ASC 480 on the basis that the Overallotment Option was exercisable for Warrants that are classified as liabilities under ASC 480. As the Overallotment Option is a traditional overallotment option that remained with the underwriters, no proceeds from the January 2018 Financing were allocated. Given the short-term duration of the Overallotment Option, the Company estimated its fair value was representative of the intrinsic value of the related Warrants, based on the estimated fair value of the Warrants at issuance and the exercise price of the Overallotment Option. The Company estimated the fair value of the Overallotment Option at the issuance to be approximately $2.4 million . Upon the partial exercise of the Overallotment Option by the underwriters, the Company reclassified a proportional amount of the Overallotment Option liability of $0.9 million to the Warrant liability, to reflect the fair value of the Warrants issued to the underwriters. Upon expiration of the Overallotment Option, the Company recognized the $1.8 million liability balance as expense. In connection with the January 2018 Financing, the Company incurred approximately $4.0 million of issuance costs. The Company allocated approximately $2.6 million of the issuance costs to the common and preferred stock, and recorded these amounts against the proceeds received, and approximately $1.4 million of the issuance costs to the Warrants, based on the relative values assigned. As the Warrants were classified as liabilities, the Company immediately expensed the issuance costs allocated to the Warrants. At-the-market equity offering program On March 2, 2015, the Company entered into a Sales Agreement with Cowen and Company, LLC (the "Sales Agreement") to establish an at-the-market equity offering program (“ATM”) pursuant to which it was able to offer and sell up to $40 million of its common stock at prevailing market prices from time to time. On May 8, 2015, the Sales Agreement was amended to increase the offering amount under the ATM to $50 million of its common stock. Through November 1, 2018 , the Company sold an aggregate of approximately 3.7 million shares under the ATM and received approximately $4.0 million in net proceeds after deducting commissions. Warrants As of September 30, 2018 and December 31, 2017 , the Company had warrants outstanding that represent the right to acquire 29,342,564 and 77,603 shares of common stock, respectively. As of September 30, 2018 , the common stock underlying the warrants consist of 28,935,550 shares of common stock reserved for issuance upon the exercise of the Warrants, 403,136 shares of common stock reserved for issuance upon the exercise of warrants issued to Hercules and 3,878 shares of common stock reserved for issuance upon the exercise of warrants issued in periods prior to the Company's initial public offering ("IPO"). |