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

Error in calculate Ks #17

Closed CGsTree closed 2 years ago

CGsTree commented 2 years ago

Hi sun, When I run: wgdi -ks ks.conf.txt wgdi report an error

cds_file  =  cds_represent.fa
pep_file  =  protein_represent.fa
align_software  =  muscle
pairs_file  =  collinearity.txt
ks_file  =  sk.ks
Traceback (most recent call last):
  File "/home/caigui/miniconda3/envs/wgdi/bin/wgdi", line 10, in <module>
    sys.exit(main())
  File "/home/caigui/miniconda3/envs/wgdi/lib/python3.10/site-packages/wgdi/run.py", line 148, in main
    module_to_run(arg, value)
  File "/home/caigui/miniconda3/envs/wgdi/lib/python3.10/site-packages/wgdi/run.py", line 110, in module_to_run
    run_subprogram(program, conf, name)
  File "/home/caigui/miniconda3/envs/wgdi/lib/python3.10/site-packages/wgdi/run.py", line 78, in run_subprogram
    r.run()
  File "/home/caigui/miniconda3/envs/wgdi/lib/python3.10/site-packages/wgdi/ks.py", line 67, in run
    df_pairs = self.auto_file()
  File "/home/caigui/miniconda3/envs/wgdi/lib/python3.10/site-packages/wgdi/ks.py", line 33, in auto_file
    p = pd.read_csv(self.pairs_file, sep='\n', header=None, nrows=30)
  File "/home/caigui/miniconda3/envs/wgdi/lib/python3.10/site-packages/pandas/util/_decorators.py", line 311, in wrapper
    return func(*args, **kwargs)
  File "/home/caigui/miniconda3/envs/wgdi/lib/python3.10/site-packages/pandas/io/parsers/readers.py", line 665, in read_csv
    kwds_defaults = _refine_defaults_read(
  File "/home/caigui/miniconda3/envs/wgdi/lib/python3.10/site-packages/pandas/io/parsers/readers.py", line 1533, in _refine_defaults_read
    raise ValueError(
ValueError: Specified \n as separator or delimiter. This forces the python engine which does not accept a line terminator. Hence it is not allowed to use the line terminator as separator.

This is the file I use: Archive.zip Thank you for your tools and generous help!

SunPengChuan commented 2 years ago

Your problem is almost the same as the one just now, I tested the data you provided and it works for me. Could be a python version issue? Can you tell me your python version? image

CGsTree commented 2 years ago

Your problem is almost the same as the one just now, I tested the data you provided and it works for me. Could be a python version issue? Can you tell me your python version? image

I am very happy that you successfully run my data. My python version is 3.10.2. Can you tell me your version so I can test it?

SunPengChuan commented 2 years ago

My python version is 3.8.2. The 3.10 version has changed a lot, and I haven't tested it yet. I'll test it asap and fix it in the next version.

CGsTree commented 2 years ago

My python version is 3.8.2. The 3.10 version has changed a lot, and I haven't tested it yet. I'll test it asap and fix it in the next version.

I changed my Python version to 3.8.2, but wgdi reported exactly the same error. Could you please provide me with the result file of ks calculation of my data, and then I can run the following steps?

SunPengChuan commented 2 years ago

I just reinstalled using 'mamba install wgdi' command with python version = 3.8.5. Then,the command 'wgdi -ks ks.conf.txt' also works fine. sk.ks.txt .

CGsTree commented 2 years ago

I just reinstalled using 'mamba install wgdi' command with python version = 3.8.5. Then,the command 'wgdi -ks ks.conf.txt' also works fine. sk.ks.txt .

I reinstalled wgdi using the following command: mamba install wgdi python=3.8.5 Then I get the same error again. If you have any other clues I'd be happy to test them in my environment. Thank you very much for the result file.

JiyangChang commented 2 years ago

My python version is 3.8.2. The 3.10 version has changed a lot, and I haven't tested it yet. I'll test it asap and fix it in the next version.

I changed my Python version to 3.8.2, but wgdi reported exactly the same error. Could you please provide me with the result file of ks calculation of my data, and then I can run the following steps?

Just some feedback: I removed old conda environment which using Python 3.10.2 and re-create a new one with python 3.8, the problem is fixed. I think this error is cause by the new version of Python.

CGsTree commented 2 years ago

I just reinstalled using 'mamba install wgdi' command with python version = 3.8.5. Then,the command 'wgdi -ks ks.conf.txt' also works fine. sk.ks.txt .

After a morning of troubleshooting, I solved the problem in my environment. Finally, I found that I only need to change the source of Conda from USTC to Tsinghua. Then I installed wgdi with Python =3.8.5 and everything worked fine. Happy Chinese New Year!

CGsTree commented 2 years ago

My python version is 3.8.2. The 3.10 version has changed a lot, and I haven't tested it yet. I'll test it asap and fix it in the next version.

I changed my Python version to 3.8.2, but wgdi reported exactly the same error. Could you please provide me with the result file of ks calculation of my data, and then I can run the following steps?

Just some feedback: I removed old conda environment which using Python 3.10.2 and re-create a new one with python 3.8, the problem is fixed. I think this error is cause by the new version of Python.

Thank you for your comment, it was very helpful for me to solve this problem.