Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: f(a) and f(b) must have different signs #11

Open
tseemann opened this issue Oct 4, 2016 · 1 comment
Open

ValueError: f(a) and f(b) must have different signs #11

tseemann opened this issue Oct 4, 2016 · 1 comment

Comments

@tseemann
Copy link

tseemann commented Oct 4, 2016

Error on a 1K amplicon:

cat raw.tsv

Q       k       F0      f1      F1
0       21      964     0       271790
0       27      952     0       247142
0       33      954     0       222535
0       39      938     0       198291
0       45      976     0       174626
0       51      978     2       151616
0       57      916     6       129282
0       63      902     10      107766
0       69      926     14      87280
0       75      908     24      67707

KmerStreamEstimate.py raw.tsv

Q       k       F0      f1      F1      F0-f1   G       e       lambda
Traceback (most recent call last):
  File "/home/linuxbrew/.linuxbrew/bin/KmerStreamEstimate.py", line 43, in <module>
    x,e = EMfit2(F0,f1,F1,int(k))
  File "/home/linuxbrew/.linuxbrew/bin/KmerStreamEstimate.py", line 26, in EMfit2
    e = brentq(func, 0, 1)
  File "/home/linuxbrew/.linuxbrew/Cellar/python/2.7.12_1/lib/python2.7/site-packages/scipy/optimize/zeros.py", line 442, in brentq
    r = _zeros._brentq(f,a,b,xtol,rtol,maxiter,args,full_output,disp)
ValueError: f(a) and f(b) must have different signs
@tseemann
Copy link
Author

tseemann commented Oct 4, 2016

Here's a bigger 170kbp plasmid - it dies at the k=61 line:

    r = _zeros._brentq(f,a,b,xtol,rtol,maxiter,args,full_output,disp)
ValueError: f(a) and f(b) must have different signs

Q       k       F0      f1      F1
0       21      3294864 2287125 12998292
0       29      4389344 3411027 12197818
0       37      5143539 4228546 11397425
0       45      5701978 4923828 10597107
0       53      5994600 5339172 9796857
0       61      6073264 5527317 8996681
0       69      6021409 5605572 8196603
0       77      5807117 5482701 7396581
0       85      5443943 5167614 6596629
0       93      4998627 4766073 5796729
0       101     4450685 4259462 4996947
0       109     3853174 3688735 4197217
0       117     3203916 3093976 3397561


Q       k       F0      f1      F1      F0-f1   G       e       lambda
0       21      3294864 2287125 12998292        1007739.0       962481.253392   0.182981051863  13.5049819975
0       29      4389344 3411027 12197818        978317.0        900043.587899   0.292634155143  13.5524747512
0       37      5143539 4228546 11397425        914993.0        810346.500288   0.389667296542  14.0648784143
0       45      5701978 4923828 10597107        778150.0        622556.193101   0.494428741631  17.02192849
0       53      5994600 5339172 9796857 655428.0        407729.342565   0.596356932129  24.0278439083

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant