MDU-PHL / arbow

Cultivate your multiple sequence alignments to get better trees
6 stars 1 forks source link

IndexError: positional indexers are out-of-bounds #14

Open tseemann opened 4 years ago

tseemann commented 4 years ago
%  arbow -t 36 -c 2 -mp 0.01  ../dhhs.raw.afa 

INFO:root:New alignment length: 29870...
INFO:root:Trimming 5' and 3' UTR regions...
INFO:root:Clean alignment length: 29409
INFO:root:Getting column stats...
INFO:root:Filtering out sites with > 0.01 proportion of missing sites.
INFO:numexpr.utils:Note: detected 72 virtual cores but NumExpr set to maximum of 64, check "NUMEXPR_MAX_THREAD
INFO:numexpr.utils:Note: NumExpr detected 72 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit 
INFO:numexpr.utils:NumExpr defaulting to 8 threads.
INFO:root:Removing 4051 due to missing data.
INFO:root:Total included sites: 25358
INFO:root:Finding constant sites...
INFO:root:Filtering constant sites by 2 max minor allele count and allowing missing sites.
INFO:root:Total constant sites: 25135
INFO:root:Total variable sites: 223
Traceback (most recent call last):
  File "/home/linuxbrew/.linuxbrew/bin/arbow", line 8, in <module>
    sys.exit(main())
  File "/home/linuxbrew/.linuxbrew/opt/python/lib/python3.7/site-packages/click/core.py", line 829, in __call_
    return self.main(*args, **kwargs)
  File "/home/linuxbrew/.linuxbrew/opt/python/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/linuxbrew/.linuxbrew/opt/python/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/linuxbrew/.linuxbrew/opt/python/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/linuxbrew/.linuxbrew/opt/python/lib/python3.7/site-packages/arbow/__main__.py", line 711, in mai
    output_aln(aln, var_sites_ix, outfile=out_var_aln, filter_const=not include_const)
  File "/home/linuxbrew/.linuxbrew/opt/python/lib/python3.7/site-packages/arbow/__main__.py", line 372, in out
    aln = aln.iloc[:, pos]
  File "/home/linuxbrew/.linuxbrew/opt/python/lib/python3.7/site-packages/pandas/core/indexing.py", line 1761,
    return self._getitem_tuple(key)
  File "/home/linuxbrew/.linuxbrew/opt/python/lib/python3.7/site-packages/pandas/core/indexing.py", line 2066,
    self._has_valid_tuple(tup)
  File "/home/linuxbrew/.linuxbrew/opt/python/lib/python3.7/site-packages/pandas/core/indexing.py", line 702, 
    self._validate_key(k, i)
  File "/home/linuxbrew/.linuxbrew/opt/python/lib/python3.7/site-packages/pandas/core/indexing.py", line 2008,
    raise IndexError("positional indexers are out-of-bounds")
IndexError: positional indexers are out-of-bounds
tseemann commented 4 years ago

I think my WH1 reference was polyA trimmed. This is prob the cause!

andersgs commented 4 years ago

Should be fixed in the latest release. Please close if so.

mkleinecke commented 4 years ago

I have the same issue still with a fresh install (version 0.6.0).

andersgs commented 4 years ago

Thank you @mkleinecke. I'll look in to it tomorrow.

Can you confirm what version of pandas you are running, please?

I think there might be a change in the API, making older versions incompatible. I may just need to sort that out in the setup.py with the minimum requirements.

charlesfoster commented 3 years ago

Hi,

I thought I'd give arbow a go. I installed it fresh today via pip3, and ran it on an alignment of some sequences from GISAID + the MN908947.3 ref genome (downloaded from GenBank today). However, when running it, I get the same error as above:

arbow -x 1.0 -mc 0 aus_ref.fa WARNING:arbow.utils:Found multiple installs of iqtree in /Applications/iqtree-2.1.1-MacOSX/bin/:/Applications/iqtree-2.1.1-MacOSX/bin/ Assuming the first one is the right one! INFO:arbow.utils:Expected IQTree version 2 and found 2.1.1 arbow:INFO:2020-09-23 17:06:56:Loading FASTA alignment... arbow:INFO:2020-09-23 17:06:57:Loaded 958 sequences arbow:INFO:2020-09-23 17:07:02:Trimming according to ref sequence... arbow:INFO:2020-09-23 17:07:02:Found 3 introduced gaps into the ref... arbow:INFO:2020-09-23 17:07:02:New alignment length: 29903... arbow:INFO:2020-09-23 17:07:02:Trimming 5' and 3' UTR regions... arbow:INFO:2020-09-23 17:07:02:Clean alignment length: 29409 arbow:INFO:2020-09-23 17:07:02:Getting column stats... arbow:WARNING:2020-09-23 17:07:09:Not filtering out any sites with missing data. arbow:INFO:2020-09-23 17:07:09:Total included sites: 29409 arbow:INFO:2020-09-23 17:07:09:Finding constant sites... arbow:INFO:2020-09-23 17:07:09:Filtering constant sites by 1 max minor allele count and not allowing missing sites. arbow:INFO:2020-09-23 17:07:12:Total constant sites: 29102 arbow:INFO:2020-09-23 17:07:12:Total variable sites: 307 Traceback (most recent call last): File "/Users/cfos/Library/Python/3.7/bin//arbow", line 8, in sys.exit(main()) File "/Users/cfos/Library/Python/3.7/lib/python/site-packages/click/core.py", line 829, in call return self.main(args, kwargs) File "/Users/cfos/Library/Python/3.7/lib/python/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/Users/cfos/Library/Python/3.7/lib/python/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, ctx.params) File "/Users/cfos/Library/Python/3.7/lib/python/site-packages/click/core.py", line 610, in invoke return callback(args, **kwargs) File "/Users/cfos/Library/Python/3.7/lib/python/site-packages/arbow/main.py", line 716, in main output_aln(aln, var_sites_pos, outfile=out_var_aln, filter_const=not include_const) File "/Users/cfos/Library/Python/3.7/lib/python/site-packages/arbow/main.py", line 379, in output_aln aln = aln.iloc[:, pos] File "/Users/cfos/Library/Python/3.7/lib/python/site-packages/pandas/core/indexing.py", line 873, in getitem return self._getitem_tuple(key) File "/Users/cfos/Library/Python/3.7/lib/python/site-packages/pandas/core/indexing.py", line 1443, in _getitem_tuple self._has_valid_tuple(tup) File "/Users/cfos/Library/Python/3.7/lib/python/site-packages/pandas/core/indexing.py", line 702, in _has_valid_tuple self._validate_key(k, i) File "/Users/cfos/Library/Python/3.7/lib/python/site-packages/pandas/core/indexing.py", line 1367, in _validate_key raise IndexError("positional indexers are out-of-bounds") IndexError: positional indexers are out-of-bounds

I'm running pandas v1.1.2. Is there a fix for this yet? Thanks.

ghost commented 3 years ago

Hello,

I receive the same error as above currently with:

arbow merged_aln.fasta -r MN908947 -x 1.0 -mc 0

WARNING:arbow.utils:Found multiple installs of iqtree in /usr/bin Assuming the first one is the right one! INFO:arbow.utils:Expected IQTree version 2 and found 2.1.2 arbow:INFO:2021-02-05 11:36:31:Loading FASTA alignment... arbow:INFO:2021-02-05 11:36:31:Loaded 299 sequences arbow:INFO:2021-02-05 11:36:34:Trimming according to ref sequence... arbow:INFO:2021-02-05 11:36:34:Found 0 introduced gaps into the ref... arbow:INFO:2021-02-05 11:36:34:New alignment length: 29903... arbow:INFO:2021-02-05 11:36:34:Trimming 5' and 3' UTR regions... arbow:INFO:2021-02-05 11:36:34:Clean alignment length: 29409 arbow:INFO:2021-02-05 11:36:34:Getting column stats... arbow:WARNING:2021-02-05 11:36:36:Not filtering out any sites with missing data. INFO:numexpr.utils:Note: NumExpr detected 56 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8. INFO:numexpr.utils:NumExpr defaulting to 8 threads. arbow:INFO:2021-02-05 11:36:36:Total included sites: 29409 arbow:INFO:2021-02-05 11:36:36:Finding constant sites... arbow:INFO:2021-02-05 11:36:36:Filtering constant sites by 1 max minor allele count and not allowing missing sites. arbow:INFO:2021-02-05 11:36:38:Total constant sites: 11456 arbow:INFO:2021-02-05 11:36:38:Total variable sites: 17953 Traceback (most recent call last): File "/home/mwatson/anaconda3/bin/arbow", line 8, in sys.exit(main()) File "/home/mwatson/anaconda3/lib/python3.8/site-packages/click/core.py", line 829, in call return self.main(args, kwargs) File "/home/mwatson/anaconda3/lib/python3.8/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/home/mwatson/anaconda3/lib/python3.8/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, ctx.params) File "/home/mwatson/anaconda3/lib/python3.8/site-packages/click/core.py", line 610, in invoke return callback(args, **kwargs) File "/home/mwatson/anaconda3/lib/python3.8/site-packages/arbow/main.py", line 716, in main output_aln(aln, var_sites_pos, outfile=out_var_aln, filter_const=not include_const) File "/home/mwatson/anaconda3/lib/python3.8/site-packages/arbow/main.py", line 379, in output_aln aln = aln.iloc[:, pos] File "/home/mwatson/anaconda3/lib/python3.8/site-packages/pandas/core/indexing.py", line 889, in getitem return self._getitem_tuple(key) File "/home/mwatson/anaconda3/lib/python3.8/site-packages/pandas/core/indexing.py", line 1450, in _getitem_tuple self._has_valid_tuple(tup) File "/home/mwatson/anaconda3/lib/python3.8/site-packages/pandas/core/indexing.py", line 723, in _has_valid_tuple self._validate_key(k, i) File "/home/mwatson/anaconda3/lib/python3.8/site-packages/pandas/core/indexing.py", line 1373, in _validate_key raise IndexError("positional indexers are out-of-bounds") IndexError: positional indexers are out-of-bounds

I am running pandas v1.2.1.