Dsuite
Dsuite copied to clipboard
cannot plot fbranch statistics
This is a fantastic set of tools. However, I am hitting a snag I cannot seem to solve. I can run
.../Dsuite Fbranch -Z Allprunedr2-50thinned100.nex.partsroot2.txt SETS_tree-guided_tree.txt > fbranch1.txt
and I get the file with lots of values and 'nan's but then when I try the next command:
.../utils/dtools.py fbranch1.txt Allprunedr2-50thinned100.nex.partsroot2.txt
I get the following error:
Traceback (most recent call last):
File "/home/yote/bin/Dsuite/utils/dtools.py", line 3654, in
The files are attached below: Allprunedr2-50thinned100.nex.partsroot2.txt SETS_tree-guided_tree.txt fbranch1.txt
Hi, have you found a solution to this problem? I'm having the same issue. Thanks!
No, I gave up on it, but would still be interested if you find a solution.
Right. so I think we found the solution, at least it work for our data and looking at your 'fbranch1.txt' file it should work for yours as well. If you selected the -z option with the Fbranch command, you get the Z-scores added in the final Fbranch.txt file. However it seems that the dtools script is meant to parse data without the Z-scores and will try to parse those as well if included in the input file therefore throwing an error. You can either rerun without adding the optional -z flag, or remove the Z-scores from the in file to avoid it. This should do :) hope it helps. Cheers
Fantastic! Thank you. I will save your comment where i left off and try this when I am able to get back to it. Cheers!
Hello,
I'm also having issues plotting the Fbranch stats, but I get a different error. I think that might be a python error, but I'm not familiar with it so I'm not sure how it relates to the program. Has anyone seen this happen? And what would that mean for my Fbranch file?
Traceback (most recent call last):
File "/u/home/r/rturba/programs/Dsuite/utils/dtools.py", line 3654, in <module>
sys.exit(main())
File "/u/home/r/rturba/programs/Dsuite/utils/dtools.py", line 3629, in main
fb1, tree_no_outgroup = align_fbranch_with_tree(fb, tree,
File "/u/home/r/rturba/programs/Dsuite/utils/dtools.py", line 3482, in align_fbranch_with_tree
fb = fb.loc[row_order, col_order].iloc[::-1] # ,::-1
File "/u/home/r/rturba/.conda/envs/dsuite/lib/python3.10/site-packages/pandas-1.5.2-py3.10-linux-x86_64.egg/pandas/core/indexing.py", line 1067, in __getitem__
return self._getitem_tuple(key)
File "/u/home/r/rturba/.conda/envs/dsuite/lib/python3.10/site-packages/pandas-1.5.2-py3.10-linux-x86_64.egg/pandas/core/indexing.py", line 1254, in _getitem_tuple
return self._multi_take(tup)
File "/u/home/r/rturba/.conda/envs/dsuite/lib/python3.10/site-packages/pandas-1.5.2-py3.10-linux-x86_64.egg/pandas/core/indexing.py", line 1205, in _multi_take
d = {
File "/u/home/r/rturba/.conda/envs/dsuite/lib/python3.10/site-packages/pandas-1.5.2-py3.10-linux-x86_64.egg/pandas/core/indexing.py", line 1206, in <dictcomp>
axis: self._get_listlike_indexer(key, axis)
File "/u/home/r/rturba/.conda/envs/dsuite/lib/python3.10/site-packages/pandas-1.5.2-py3.10-linux-x86_64.egg/pandas/core/indexing.py", line 1432, in _get_listlike_indexer
keyarr, indexer = ax._get_indexer_strict(key, axis_name)
File "/u/home/r/rturba/.conda/envs/dsuite/lib/python3.10/site-packages/pandas-1.5.2-py3.10-linux-x86_64.egg/pandas/core/indexes/base.py", line 6105, in _get_indexer_strict
keyarr = com.asarray_tuplesafe(keyarr)
File "/u/home/r/rturba/.conda/envs/dsuite/lib/python3.10/site-packages/pandas-1.5.2-py3.10-linux-x86_64.egg/pandas/core/common.py", line 245, in asarray_tuplesafe
result = np.asarray(values, dtype=dtype)
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (72,) + inhomogeneous part.
Thank you!
Hello rturba
I have the same issue as you, I even run again the Dtrios, do you have a soulution?
Best Xuexue
I still haven't solved the problem, and you?
At 2023-05-30 22:05:06, "xuefenfei712" @.***> wrote:
Hello rturba
I have the same issue as you, I even run again the Dtrios, do you have a soulution?
Best Xuexue
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>
I still haven't solved the problem, and you? At 2023-05-30 22:05:06, "xuefenfei712" @.> wrote: Hello rturba I have the same issue as you, I even run again the Dtrios, do you have a soulution? Best Xuexue — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.>
Hi, there! So sorry for not replying with a solution earlier. I've discovered that the python environment where I had installed DSuite was the problem. For sure some version incompatibility. Just running the plot command outside of my virtual environment with python3 worked fine. Try checking the python version you're using and try with another one. I hope that helps!
Ok, I'll follow your advice. Best wishes to you!
At 2023-09-06 02:08:14, "rturba" @.***> wrote:
I still haven't solved the problem, and you? At 2023-05-30 22:05:06, "xuefenfei712" @.> wrote: Hello rturba I have the same issue as you, I even run again the Dtrios, do you have a soulution? Best Xuexue — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.>
Hi, there! So sorry for not replying with a solution earlier. I've discovered that the python environment where I had installed DSuite was the problem. For sure some version incompatibility. Just running the plot command outside of my virtual environment with python3 worked fine. Try checking the python version you're using and try with another one. I hope that helps!
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
hello! I have a new errow in plotting fbranch, like this:
python3 Dsuite/utils/dtools.py fbranch.txt nwk.txt Traceback (most recent call last): File "/home/lingjiang/liyf/china_analyses/dsuit/Dsuite/utils/dtools.py", line 3654, in
sys.exit(main()) ^^^^^^ File "/home/lingjiang/liyf/china_analyses/dsuit/Dsuite/utils/dtools.py", line 3629, in main fb1, tree_no_outgroup = align_fbranch_with_tree(fb, tree, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/lingjiang/liyf/china_analyses/dsuit/Dsuite/utils/dtools.py", line 3465, in align_fbranch_with_tree fb = fb.drop(outgroup, axis=1) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/lingjiang/anaconda3/lib/python3.11/site-packages/pandas/core/frame.py", line 5344, in drop return super().drop( ^^^^^^^^^^^^^ File "/home/lingjiang/anaconda3/lib/python3.11/site-packages/pandas/core/generic.py", line 4711, in drop obj = obj._drop_axis(labels, axis, level=level, errors=errors) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/lingjiang/anaconda3/lib/python3.11/site-packages/pandas/core/generic.py", line 4753, in _drop_axis new_axis = axis.drop(labels, errors=errors) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/lingjiang/anaconda3/lib/python3.11/site-packages/pandas/core/indexes/base.py", line 7000, in drop raise KeyError(f"{labels[mask].tolist()} not found in axis") KeyError: "['Outgroup'] not found in axis"
I tried python3.7, 3.9 and 3.11, and pandas 1.5 and 2.1.4. they all didn't work.
yefanglee
Hello,yefanglee!
I have got the same issue with you. Have you figure out how to deal with it?