KoslickiLab / L2-UniFrac

Expansion upon Median Unifrac to compute average phylogenetic distances between samples according to their UniFrac distance without producing negative abundance vectors.
1 stars 0 forks source link

Issue with AssertionError on sample data with L2 Unifrac #2

Closed andrew-j-millward closed 3 years ago

andrew-j-millward commented 3 years ago

https://github.com/KoslickiLab/L2-UniFrac/blob/1e47accfcd416cd375c4a76b30e75a7771c64169/tests/test_meanUnifrac.py#L73

The test data passes, but the actual data fails to have both methods return the same value.

andrew-j-millward commented 3 years ago

Error likely present on https://github.com/KoslickiLab/L2-UniFrac/blob/1e47accfcd416cd375c4a76b30e75a7771c64169/tests/test_meanUnifrac.py#L71 with nodes_in_order since this should likely be the dictionary of nodes.

andrew-j-millward commented 3 years ago

https://github.com/KoslickiLab/L2-UniFrac/blob/61bdfda188a4288952d1d22056a92e7d25094949/tests/test_meanUnifrac.py#L71 Error persists with above solution...

dkoslicki commented 3 years ago

@andrew-j-millward can you paste the trace of the error? Also, if you have a MWE that demonstrates the error, that would be helpful.

andrew-j-millward commented 3 years ago

Added MWE to test document by slightly modifying the first test case until an error appeared. https://github.com/KoslickiLab/L2-UniFrac/blob/a34a20238abae34576cd4b208ab93e9b49e5df75/src/L2Unifrac.py#L99 Changed abs(val) to val which corrected the old MWE and similar errors. Main error on real-world data persists.

andrew-j-millward commented 3 years ago

The final error present was with nodes_in_order actually being the correct one, and this error was present but undetected in all of the other test cases as well. It is now fixed across all tests.