SunPengChuan / wgdi

WGDI: A user-friendly toolkit for evolutionary analyses of whole-genome duplications and ancestral karyotypes
https://wgdi.readthedocs.io/en/latest/
BSD 2-Clause "Simplified" License
114 stars 22 forks source link

helllo friend ,now the wgdi had eroror, it shows ValueError: cannot reindex on an axis with duplicate labels #33

Closed Jiangjiangzhang6 closed 1 year ago

Jiangjiangzhang6 commented 1 year ago

/public/home/zhaoli/software/anaconda3/envs/wgdi/lib/python3.11/site-packages/wgdi/base.py:213: FutureWarning: In a future version of pandas, a length 1 tuple will be returned when iterating over a groupby with a grouper equal to a list of length 1. Don't supply a list with a single grouper to avoid this warning. for name, group in gff.groupby(['chr']): /public/home/zhaoli/software/anaconda3/envs/wgdi/lib/python3.11/site-packages/wgdi/base.py:213: FutureWarning: In a future version of pandas, a length 1 tuple will be returned when iterating over a groupby with a grouper equal to a list of length 1. Don't supply a list with a single grouper to avoid this warning. for name, group in gff.groupby(['chr']): /public/home/zhaoli/software/anaconda3/envs/wgdi/lib/python3.11/site-packages/wgdi/base.py:214: FutureWarning: reindexing with a non-unique Index is deprecated and will raise in a future version. gff.loc[group.index, 'loc'] = (dict_chr[name]+group[position])step Traceback (most recent call last): File "/public/home/zhaoli/software/anaconda3/envs/wgdi/bin/wgdi", line 10, in sys.exit(main()) ^^^^^^ File "/public/home/zhaoli/software/anaconda3/envs/wgdi/lib/python3.11/site-packages/wgdi/run.py", line 158, in main module_to_run(arg, value) File "/public/home/zhaoli/software/anaconda3/envs/wgdi/lib/python3.11/site-packages/wgdi/run.py", line 118, in module_to_run run_subprogram(program, conf, name) File "/public/home/zhaoli/software/anaconda3/envs/wgdi/lib/python3.11/site-packages/wgdi/run.py", line 84, in run_subprogram r.run() File "/public/home/zhaoli/software/anaconda3/envs/wgdi/lib/python3.11/site-packages/wgdi/dotplot.py", line 99, in run gff2 = base.gene_location(gff2, lens2, step2, self.position) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/public/home/zhaoli/software/anaconda3/envs/wgdi/lib/python3.11/site-packages/wgdi/base.py", line 214, in gene_location gff.loc[group.index, 'loc'] = (dict_chr[name]+group[position])step


  File "/public/home/zhaoli/software/anaconda3/envs/wgdi/lib/python3.11/site-packages/pandas/core/indexing.py", line 818, in __setitem__
    iloc._setitem_with_indexer(indexer, value, self.name)
  File "/public/home/zhaoli/software/anaconda3/envs/wgdi/lib/python3.11/site-packages/pandas/core/indexing.py", line 1795, in _setitem_with_indexer
    self._setitem_with_indexer_split_path(indexer, value, name)
  File "/public/home/zhaoli/software/anaconda3/envs/wgdi/lib/python3.11/site-packages/pandas/core/indexing.py", line 1816, in _setitem_with_indexer_split_path
    value = self._align_series(indexer, Series(value))
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/public/home/zhaoli/software/anaconda3/envs/wgdi/lib/python3.11/site-packages/pandas/core/indexing.py", line 2277, in _align_series
    return ser.reindex(new_ix)._values
           ^^^^^^^^^^^^^^^^^^^
  File "/public/home/zhaoli/software/anaconda3/envs/wgdi/lib/python3.11/site-packages/pandas/core/series.py", line 5094, in reindex
    return super().reindex(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/public/home/zhaoli/software/anaconda3/envs/wgdi/lib/python3.11/site-packages/pandas/core/generic.py", line 5289, in reindex
    return self._reindex_axes(
           ^^^^^^^^^^^^^^^^^^^
  File "/public/home/zhaoli/software/anaconda3/envs/wgdi/lib/python3.11/site-packages/pandas/core/generic.py", line 5309, in _reindex_axes
    obj = obj._reindex_with_indexers(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/public/home/zhaoli/software/anaconda3/envs/wgdi/lib/python3.11/site-packages/pandas/core/generic.py", line 5355, in _reindex_with_indexers
    new_data = new_data.reindex_indexer(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/public/home/zhaoli/software/anaconda3/envs/wgdi/lib/python3.11/site-packages/pandas/core/internals/managers.py", line 729, in reindex_indexer
    self.axes[axis]._validate_can_reindex(indexer)
  File "/public/home/zhaoli/software/anaconda3/envs/wgdi/lib/python3.11/site-packages/pandas/core/indexes/base.py", line 4359, in _validate_can_reindex
    raise ValueError("cannot reindex on an axis with duplicate labels")
ValueError: cannot reindex on an axis with duplicate labels
Jiangjiangzhang6 commented 1 year ago

image

Jiangjiangzhang6 commented 1 year ago

![Uploading image.png…]() I had search some solves, but it didnot work

SunPengChuan commented 1 year ago

There may be duplicate lines in your lens file.

Jiangjiangzhang6 commented 1 year ago

UnboundLocalError: cannot access local variable 'group' where it is not associated with a value

SunPengChuan commented 1 year ago

Has it been resolved?

Jiangjiangzhang6 commented 1 year ago
yes ,its work 张江江

@. | ---- Replied Message ---- | From | @.> | | Date | 5/10/2023 13:40 | | To | @.> | | Cc | @.> , @.***> | | Subject | Re: [SunPengChuan/wgdi] helllo friend ,now the wgdi had eroror, it shows ValueError: cannot reindex on an axis with duplicate labels (Issue #33) |

Has it been resolved?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>