Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree And MSA Not Aligning As Expected #54

Open
g12342jn opened this issue Mar 11, 2022 · 4 comments
Open

Tree And MSA Not Aligning As Expected #54

g12342jn opened this issue Mar 11, 2022 · 4 comments

Comments

@g12342jn
Copy link
Contributor

g12342jn commented Mar 11, 2022

Hello,

It looks like the tree tips and sequences are not aligning as expected:
Screen Shot 2022-03-11 at 10 29 06 AM

Here is the file contents:

>art
artartartartarta
>bart
bartbartbartbart
>cady
cadycadycadycady
>daak
daakdaakdaakdaak
>gary
garygarygarygary
>ham
hamhamhamhamhamh
>kart
kartkartkartkart
>mary
marymarymarymary
>naat
naatnaatnaatnaat
>rant
rantrantrantrant
(art,((((gary,daak),(cady,bart)),(ham,((kart,(mary,(rant,naat))))))));

Thanks,
Greg

@stephenshank
Copy link
Contributor

stephenshank commented Mar 11, 2022

Dear @g12342jn,

Thanks for posting this issue. Two things:

  1. Mary is capitalized in the FASTA but lower cased mary in the Newick, which could cause discrepancies. The code is not very fault tolerant.
  2. Your tree contains spurious internal nodes, emphasized in red below:
    image

visualized at phylotree.hyphy.org which you may find useful. Here is one that does not:

(art,(((gary,daak),(cady,bart)),(ham,(kart,(mary,(rant,naat))))));

Nevertheless, fixing these did not resolve the issue. The suspected line is:

const ordered_leaf_names = tree.getTips().map(d => d.data.name);

which attempts to get a linear ordering of the nodes as they appear when the tree is laid out. This appears to work for the advertised CD2 example but not for your toy dataset. I'll need to do a bit more digging to understand why.

Best,
Stephen

@g12342jn
Copy link
Contributor Author

g12342jn commented Mar 11, 2022

Hello Stephen,

Thanks for getting back to me.
The capital was due to Mac OS "auto capitalization on a new line feature", it is not in the file. T_T
I should have caught that before I entered the comment, sorry for the confusion.
I attached the sample file for your reference:
art_bart.txt

Edit: I needed to rename the file to .txt in order to import to the comments here, not that it should matter, but I thought that I should mention.

Your assistance is much appreciated.

Regards,
Greg

@stephenshank
Copy link
Contributor

Dear @g12342jn,

Just a quick update. I've architected a fix, but it will involve some slight refactoring of the react-phylotree dependency.

I hope to do a patch release to both packages by the end of the week, and will follow up then.

This issue uncovered some subtle flaws in existing logic, so it is greatly appreciated!

Best,
Stephen

@g12342jn
Copy link
Contributor Author

Stephen,

That is great news!

Thank you for looking into this.

I will keep an eye out for your follow up message.

Regards,
Greg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants