Type of Arrangement and Non-arrangement Transactions [Axis] Aratana Agreement [Member] Business Acquisition [Axis] Aratana Therapeutics [Member] Amgen Agreement [Member] Amgen [Member] Equity Components [Axis] Warrants [Member] Award Type [Axis] Restricted Stock Units (RSUs) [Member] Related Party [Axis] Especificos Stendhal SA de CV [Member] Warrant Liability [Member] Fair Value Hierarchy and NAV [Axis] Fair Value, Inputs, Level 1 [Member] Fair Value, Hierarchy [Axis] Fair Value, Inputs, Level 2 [Member] Fair Value, Inputs, Level 3 [Member] Global BioPharma, Inc [Member] Subsequent Event Type [Axis] Subsequent Event [Member] Scenario [Axis] October 2013 Through January 2019 [Member] Restatement [Axis] Adjustments [Member] Balances Without Adoption of ASC 606 [Member] Employee Stock Awards [Member] Director Stock Awards [Member] Plan Name [Axis] 2018 Employee Stock Purchase Plan [Member] Income Statement Location [Axis] Research and Development [Member] General and Administrative [Member] Range [Axis] Minimum [Member] Maximum [Member] Antidilutive Securities [Axis] Warrants [Member] Stock Options [Member] Restricted Stock Units [Member] February 8, 2019 [Member] Document And Entity Information Entity Registrant Name Entity Central Index Key Document Type Document Period End Date Amendment Flag Current Fiscal Year End Date Entity Filer Category Entity Small Business Flag Entity Emerging Growth Company Entity Ex Transition Period Entity Common Stock, Shares Outstanding Trading Symbol Document Fiscal Period Focus Document Fiscal Year Focus Statement of Financial Position [Abstract] ASSETS Current Assets: Cash and cash equivalents Restricted cash Accounts receivable Deferred expenses Prepaid expenses and other current assets Total current assets Property and equipment (net of accumulated depreciation) Intangible assets (net of accumulated amortization) Other assets Total assets LIABILITIES AND STOCKHOLDERS' EQUITY Current liabilities: Accounts payable Accrued expenses Deferred revenue Common stock warrant liability Other current liabilities Total current liabilities Deferred revenue Other liabilities Total liabilities Commitments and contingencies - Note 10 Stockholders' equity: Preferred stock, $0.001 par value; 5,000,000 shares authorized; Series B Preferred Stock; 0 shares issued and outstanding at January 31, 2019 and October 31, 2018 Liquidation preference of $0 at January 31, 2019 and October 31, 2018 Common stock - $0.001 par value; 170,000,000 shares authorized, 69,734,259 and 69,556,452 shares issued and outstanding at January 31, 2019 and October 31, 2018, respectively Additional paid-in capital Accumulated deficit Total stockholders' equity Total liabilities and stockholders' equity Preferred stock, par value Preferred stock, shares authorized Series B Preferred stock, shares issued Series B Preferred stock, shares outstanding Preferred stock, liquidation preference value Common stock, par value Common stock, shares authorized Common stock, shares issued Common stock, shares outstanding Income Statement [Abstract] Revenue Operating expenses: Research and development expenses General and administrative expenses Total operating expenses Income (loss) from operations Other income (expense): Interest income, net Net changes in fair value of derivative liabilities Other expense Net income (loss) before benefit for income taxes Income tax expense Net income (loss) Net income (loss) per common share, basic and diluted Weighted average number of common shares outstanding, basic Weighted average number of common shares outstanding, diluted Statement of Cash Flows [Abstract] OPERATING ACTIVITIES Net income (loss) Adjustments to reconcile net income (loss) to net cash used in operating activities: Stock compensation Employee stock purchase plan expense Gain on change in value of warrants Loss on disposal of property and equipment Write-off of intangible assets Depreciation expense Amortization expense of intangible assets Net amortization of premiums and discounts Change in operating assets and liabilities: Accounts receivable Prepaid expenses and other current assets Income tax receivable Other assets Accounts payable and accrued expenses Deferred revenue Other liabilities Net cash used in operating activities INVESTING ACTIVITIES Purchases of short-term investment securities Proceeds from maturities of short-term investment securities Purchase of property and equipment Cost of intangible assets Net cash (used in) provided by investing activities FINANCING ACTIVITIES Net proceeds of issuance of common stock Proceeds from employee stock purchase plan Tax withholdings paid related to net share settlement of equity awards Employee tax withholdings paid on equity awards Tax shares sold to pay for employee tax withholdings on equity awards Net cash provided by financing activities Net (decrease) increase in cash, cash equivalents and restricted cash Cash, cash equivalents and restricted cash at beginning of year Cash, cash equivalents and restricted cash at end of year The following table provides a reconciliation of cash, cash equivalents and restricted cash reported within the condensed balance sheets that sum to the total of the same such amounts shown in the condensed statements of cash flows: Total cash, cash equivalents and restricted cash shown in condensed statements of cash flows SUPPLEMENTAL CASH FLOW INFORMATION Cash paid for taxes SUPPLEMENTAL DISCLOSURE OF NON-CASH AND FINANCING ACTIVITIES Property and equipment included in accounts payable and accrued expenses Organization, Consolidation and Presentation of Financial Statements [Abstract] Nature of Operations Accounting Policies [Abstract] Summary of Significant Accounting Policies and Basis of Presentation Property, Plant and Equipment [Abstract] Property and Equipment Goodwill and Intangible Assets Disclosure [Abstract] Intangible Assets Payables and Accruals [Abstract] Accrued Expenses Common Stock Purchase Warrants And Warrant Liability Common Stock Purchase Warrants and Warrant Liability Disclosure of Compensation Related Costs, Share-based Payments [Abstract] Share Based Compensation Earnings Per Share [Abstract] Net Income (Loss) Per Share Collaboration And Licensing Agreements Collaboration and Licensing Agreements Commitments and Contingencies Disclosure [Abstract] Commitments and Contingencies Income Tax Disclosure [Abstract] Income Taxes Fair Value Disclosures [Abstract] Fair Value Subsequent Events [Abstract] Subsequent Events Basis of Presentation/Estimates Reclassification Concentration of Credit Risk Restricted Cash and Letters of Credit Revenue Recognition Collaborative Arrangements Recent Accounting Standards Recently Adopted Accounting Standards Schedule of Reclassifications to Balance Sheet and Income Statement Schedule of Property and Equipment Summary of Intangible Assets Schedule of Accrued Expenses Schedule of Warrants Activity Schedule of Assumptions Used in Warrant Liability Summary of Share Based Compensation Expense Summary of RSU Activity and Related Information Summary of Changes in Stock Option Plan Summary of Fair Value of Stock Options Granted of BSM Schedule of Basic and Diluted Earnings Per Share Schedule of Diluted Weighted-Average Shares Outstanding Schedule of Fair Value, Assets and Liabilities Measured on Recurring Basis Schedule of Changes in the Fair Value of Warrant Liabilities Statement [Table] Statement [Line Items] Proceeds from public offering Research and Development Expenses Leasehold improvements Laboratory equipment Furniture and fixtures Computer equipment Construction in progress Total property and equipment Accumulated depreciation and amortization Net property and equipment Finite lived patents expirations year Book value patent applications, net Intangible asset amortization expense Patents Licenses Software Total intangibles Accumulated amortization Intangible assets Salaries and other compensation Vendors Professional fees Total accrued expenses Warrants issued Warrants outstanding Fair value of warrant liability Change in fair value of warrant liability Common Stock Purchase Warrants And Warrant Liability - Schedule Of Warrants Activity Number of Warrants, Outstanding, Beginning balance Number of Warrants, Exercised Number of Warrants, Expired Number of Warrants, Outstanding, Ending balance Weighted-Average Exercise Price, Outstanding, Beginning Weighted-Average Exercise Price, Exercised Weighted-Average Exercise Price, Expired Weighted-Average Exercise Price, Outstanding, Ending Weighted Average Remaining Contractual Life In Years, Beginning Weighted Average Remaining Contractual Life In Years, Ending Aggregate Intrinsic Value, Beginning Aggregate Intrinsic Value, Ending Exercise Price Stock Price Expected Term Volatility % Risk Free Rate Unrecognized compensation cost related to non-vested stock option awards Unrecognized compensation cost related to non-vested remaining weighted average vesting period Options outstanding, fair value Share-based compensation, common stock, shares Share-based compensation, shares on net basis after employee payroll taxes Stock compensation expense Compensation cost related to outstanding stock options Options outstanding, intrinsic value Number of shares issued under employee stock purchase plan' Share-based compensation expense Number of RSUs, Beginning Balance Number of RSUs Vested Number of RSUs Cancelled Number of RSUs, Ending Balance Weighted-Average Grant Date Fair Value, Outstanding, Beginning Weighted-Average Grant Date Fair Value, Vested Weighted-Average Grant Date Fair Value, Cancelled Weighted-Average Grant Date Fair Value, Outstanding, Ending Number of Options, Beginning Balance Number of Options, Granted Number of Options, Canceled or Expired Number of Options, Ending Balance Number of Options, Vested and Exercisable Weighted-Average Exercise Price, Outstanding, Beginning Weighted-Average Exercise Price, Granted Weighted-Average Exercise Price, Canceled or Expired Weighted-Average Exercise Price, Outstanding, Ending Weighted-Average Exercise Price, Vested and Exercisable Expected Volatility, Minimum Expected Volatility, Maximum Expected Dividends Risk Free Interest Rate, Minimum Risk Free Interest Rate, Maximum Numerator: Net Income (loss) Numerator: Earnings attributable to common stockholders - basic and diluted Denominator: Weighted-average number of common shares used in earnings per share - basic Denominator: Effect of dilutive stock options Denominator: Weighted-average number of common shares used in earnings per share - diluted Denominator: Earnings per share - basic and diluted Anti Dilutive Securities Total Upfront payment Value of stock purchased Number of common stock shares Common stock purchase price per share Development, regulatory and sales milestone payments Upfront payment recorded as deferred revenue Deferred revenue Cumulative catch-up revenue Reduction in research and development expenses Licensing revenue Additional, cumulative sales milestone payments Proceeds from issuance of stock Warrant term Warrants Exercised Proceeds from royalty received Reimbursement value Lease Arrangement, Type [Axis] Damages sought value by plaintiff Litigation expense Due from related party Common stock warrant liability, warrants exercisable at $1.50 through September 2024 Exercise price of warrants Beginning balance Change in fair value Ending Balance Common stock authorized, description Amgen Agreement [Member] Aratana Agreement [Member] Aratana Therapeutics [Member] Director Stock Awards [Member] Employee Stock Awards [Member] Especificos Stendhal SA de CV [Member] Global BioPharma, Inc [Member] Treasury stock purchased to pay employee withholdings on equity awards. Restricted Stock Units [Member] Employee stock purchase plan expense. Share-based compensation shares on net basis after employee payroll taxes. Number of options outstanding, including both vested and non-vested options. The weighted average grant-date fair value of options outstanding during the reporting period as calculated by applying the disclosed option pricing methodology. Schedule of stock options table. Schedule of stock options line items. Common Stock Purchase Warrants and Warrant Liability [Text Block] Collaboration Agreements [Policy Text Block] Restricted Cash and Letter of Credit [Policy Text Block] Recently Adopted Accounting Standards Policy [Text Block] Finite lived patents expirations year. Represents the number of warrants exercised during the period. Represents the number of warrants expired during the period. Class of Warrant or Right, Exercise Price of Warrants. Represents the exercise price of warrants exercised during the period. Represents the exercise price of warrants expired during the period. Weighted average remaining contractual period 1. Weighted average remaining contractual period 2. Derivative net liability aggregate intrinsic value. Business Combination Upfront payment. Additional, cumulative sales milestone payments. Licensing revenue. Reimbursement value. Common stock warrant liability. Warrant Liability [Member] Schedule of changes in the fair value of warrant liabilities [Table Text Block] Net proceeds of issuance of common stock. Condensed statements of Cash flows Abstract Common stock authorized, Description. February 8, 2019 [Member] Balances Without Adoption of ASC 606 [Member] 2018 Employee Stock Purchase Plan [Member] Warrants [Member] Stock Options [Member] Upfront payment consideration to be included in transaction. October 2013 Through January 2019 [Member] Finite-lived software, gross. Earnings attributable to common stockholders - basic and diluted. Development, regulatory and sales milestone payments. Amgen [Member] WarrantsMember Assets, Current Assets Liabilities, Current Contract with Customer, Liability, Noncurrent Liabilities Stockholders' Equity Attributable to Parent Liabilities and Equity Operating Expenses Operating Income (Loss) Income (Loss) from Continuing Operations before Equity Method Investments, Income Taxes, Noncontrolling Interest Gain (Loss) on Disposition of Property Plant Equipment Accretion (Amortization) of Discounts and Premiums, Investments Increase (Decrease) in Accounts Receivable Increase (Decrease) in Prepaid Expense and Other Assets Increase (Decrease) in Income Taxes Receivable Increase (Decrease) in Other Operating Assets Increase (Decrease) in Contract with Customer, Liability Increase (Decrease) in Other Current Liabilities Net Cash Provided by (Used in) Operating Activities Payments to Acquire Investments Payments to Acquire Property, Plant, and Equipment Payments to Acquire Intangible Assets Net Cash Provided by (Used in) Investing Activities Payments Related to Tax Withholding for Share-based Compensation Stock Bonus Award [Member] Net Cash Provided by (Used in) Financing Activities Cash, Cash Equivalents, Restricted Cash and Restricted Cash Equivalents, Including Disposal Group and Discontinued Operations Cash, Cash Equivalents, Restricted Cash and Restricted Cash Equivalents Property, Plant and Equipment, Gross Accumulated Depreciation, Depletion and Amortization, Property, Plant, and Equipment Finite-Lived Intangible Assets, Gross Finite-Lived Intangible Assets, Accumulated Amortization Warrants Expired Commitments And Contingencies [Line Items] Non Executive Employees [Member] ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingNumberOne Share-based Compensation Arrangement by Share-based Payment Award, Options, Exercises in Period Share-based Compensation Arrangement by Share-based Payment Award, Options, Forfeitures and Expirations in Period ShareBasedCompensationArrangementByShareBasedPaymentAwardOptionsOutstandingInPeriodWeightedAverageGrantDateFairValue Share-based Compensation Arrangement by Share-based Payment Award, Options, Outstanding, Number Share-based Compensation Arrangement by Share-based Payment Award, Options, Exercisable, Number Share-based Compensation Arrangement by Share-based Payment Award, Options, Outstanding, Weighted Average Exercise Price Share-based Compensation Arrangement by Share-based Payment Award, Options, Exercisable, Weighted Average Exercise Price Contract with Customer, Liability