millanek / Dsuite

Fast calculation of Patterson's D (ABBA-BABA) and the f4-ratio statistics across many populations/species
160 stars 26 forks source link

Error plotting Fbranch: ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (44,) + inhomogeneous part. #99

Open NRuizVargas opened 1 month ago

NRuizVargas commented 1 month ago

Hello!

I'm trying to plot the results of the Fbranch (without Z-scores) calculations with ./utils/dtools.py and I get this error: "ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (44,) + inhomogeneous part."

My code: ./utils/dtools.py /path/PitcairniaRD_Cuba_fbranch_NoZ.txt /path/PitcairniaDRTreePopulationsNamesReducedB.txt

When I run: ./utils/dtools.py /path/PitcairniaRD_Cuba_fbranch_NoZ.txt it tells me that the tree file is missing

And when I run: ./utils/dtools.py /path/PitcairniaDRTreePopulationsNamesReducedB.txt it also tells me that the tree file is missing, so I assume there is a problem with my file format. It is the same file that I used to calculate the Fbranch and (I think) that worked fine. I have tried changing the extension, ">Tree" at the beginin, getting rid of the final ";", among many other things and nothing works. Can you spot what I'm doing wrong?

I'm including my files PitcairniaRD_Cuba_fbranch_NoZ.txt PitcairniaDRTreePopulationsNamesReducedB.txt

Thank you!

dcmain commented 1 month ago

Hi there, I managed to get this to work by changing the extension of your tree file to a .nwk file and then executing the nwk file in the command as follows:

./utils/dtools.py PitcairniaRD_Cuba_fbranch_NoZ.txt ./PitcairniaDRTreePopulationsNamesReducedB.nwk

I have attached the resulting svg and png plots below. I hope this helps.

Kind regards,

Devon

fbranch fbranch