forensicgenomics / mitoTree-viewer

mitoTree is an interactive tool for visualizing and exploring mitochondrial DNA (mtDNA) lineages and their evolutionary relationships, helping users explore genetic diversity and maternal ancestry.
Mozilla Public License 2.0
2 stars 0 forks source link

Haplogroup search - order output #8

Closed niki0211 closed 2 weeks ago

niki0211 commented 3 weeks ago

It would be good if the results of a search are ordered either: alphabetically or phylogenetically.

e.g. searching for mutation 16390A lists 46 results amongst different haplogroups. The sorting seems to be random. It would be good if they are grouped together.

minimops commented 3 weeks ago

Ah for Name search, they are ordered by best fit. For HG search im not sure, does seem a bit random. Will look into it.

minimops commented 3 weeks ago

So default view as well as hg search result view seems to be a bit confusing. Reorder both to keep tree order.

minimops commented 2 weeks ago

branch fixes_v01 is the branch where this will be attempted to be fixed

minimops commented 2 weeks ago

I took great care there to manually collect the nodes from the json, not use the d3 hierarchy function.

Seems to look in correct order now for initial render and most searches.

However, sometimes it still looks not correctly sorted, f.e. for the above provided example of '16390A'. Here, M is spread like this: M5, M8, C, E, G, M13, M27, Q, M48, M52 I checked this though, and this is actually the order the xml input file also has. So if that file is correct, this behavior is correctly sorted.

If not desired, could order alphabetically or fix input files.

niki0211 commented 2 weeks ago

The order seems to be correct now. It is identical to the order in mitoTree_v1.0_phm.xml.

Agree, that in some cases this looks weird e.g. M27,Q, M48. But phylogenetically this is correct, since the parent of Q is M29'Q.

Keep it like that for now.