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
121 stars 22 forks source link

IndexError: index 2 is out of bounds for axis 0 with size 0 (ksfigure.conf) #3

Closed sajjadasaf closed 3 years ago

sajjadasaf commented 3 years ago

Hello, Could you kindly check the below error. This error occurs in example as well as my own data.

wgdi -kf ksfigure.conf ksfit = ksnew.csv labelfontsize = 9 legendfontsize = 9 xlabel = nonewgdi -kf ksfigure.conf ksfit = ksnew.csv labelfontsize = 9 legendfontsize = 9 xlabel = none ylabel = none title = none area = 0,3 figsize = 10,10 savefig = image4.png Traceback (most recent call last): File "/home/sajjad/anaconda3/envs/wgd/bin/wgdi", line 10, in sys.exit(main()) File "/home/sajjad/anaconda3/envs/wgd/lib/python3.9/site-packages/wgdi/run.py", line 208, in main module_to_run(arg) File "/home/sajjad/anaconda3/envs/wgd/lib/python3.9/site-packages/wgdi/run.py", line 174, in module_to_run return switcher.get(argument)() File "/home/sajjad/anaconda3/envs/wgd/lib/python3.9/site-packages/wgdi/run.py", line 125, in run_ksfigure kf.run() File "/home/sajjad/anaconda3/envs/wgd/lib/python3.9/site-packages/wgdi/ksfigure.py", line 48, in run ax.plot(t, self.Gaussian_distribution( File "/home/sajjad/anaconda3/envs/wgd/lib/python3.9/site-packages/wgdi/ksfigure.py", line 32, in Gaussian_distribution if np.isnan(k[3 * i + 2]): IndexError: index 2 is out of bounds for axis 0 with size 0

SunPengChuan commented 3 years ago

Can you show your ksnew.csv file? It is most likely a format problem.

sajjadasaf commented 3 years ago

Thank you for your prompt reply. Please find the attached file. I tried it on Vvinfera examples files. .txt was added because of uploading problem ksnew.csv.txt

era example files.

SunPengChuan commented 3 years ago

When you run ' wgdi -kf ? >> total.conf ',the current directory will generate a new csv file like this https://github.com/SunPengChuan/wgdi/blob/master/wgdi/example/all_ks.csv . Saving the fitting results of peaksfit (-pf) to this file, and then run ' wgdi -kf total.conf '.

sajjadasaf commented 3 years ago

Dear SuPengChun I am really thankful for your support and prompt reply. I have done the same but I am confused in that how can I save the -pf results which is a big file (ks_median.csv) to this all_ks.csv file. The attached file generated by peaksfit (-pf). Please help me to fix this issue. Note: I have got the file by adding your mention all_ks.csv file but I am worrying how to add my own results there? ks_median.csv.txt

SunPengChuan commented 3 years ago

When you run ' wgdi -pf, total.conf '. you can get similar results as follows.

blockinfo = all_ks.csv mode = median bins_number = 200 ks_area = 0,10 fontsize = 9 area = 1,2.5 figsize = 10,6.18 savefig = ks.fit.png

R-square: 0.9753049241421256 The gaussian fitting curve parameters are : 2.234300732861966 | 1.754516918019028 | 0.25038822361435437

You need to record the gaussian fitting curve parameters. you can add a new line to all_ks.csv and record the result just now.

sajjadasaf commented 3 years ago

Thank you very much for your help. Finally, I successfully generated ks.png (little awkward image) but will try to do the analysis from the scratch. Again really appreciate your help. ks