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

label-tree.bf is rerooting trees when I do not want it to #48

Open
liamfriar opened this issue Dec 12, 2023 · 3 comments
Open

label-tree.bf is rerooting trees when I do not want it to #48

liamfriar opened this issue Dec 12, 2023 · 3 comments

Comments

@liamfriar
Copy link

liamfriar commented Dec 12, 2023

N9.HOG0000289_tree.labeled.txt
N9.HOG0000289.pruned_tree.txt
test_list.txt
Input and output files are attached.
The function call is below.
Maybe I could use the --reroot flag and give it the original root, but I just used gotree rename instead, which works great.
Also, label-tree.bf always generates output files that lack a \n at the end of the file, which causes problems for some later steps in my pipeline. Again, gotree rename is a good alternative.

'HYPHY 2.5.51(MP) for Linux on x86_64'

logfile=log.tmp
hyphy label-tree.bf --internal-nodes None --list test_list.txt --label "test" --tree $in_tree --output $out_tree >> $logfile
@spond
Copy link
Member

spond commented Dec 12, 2023

Dear @liamfriar,

HyPhy is not exactly rerooting, but rather unrooting the tree here. That's mostly because tree-label.bf is meant as preprocessor for downstream analyses in HyPhy, which (for the most part) deals with time-reversible models, and thereby unrooted trees. From the standpoint of HyPhy, these trees are equivalent.

That said, if you add ENV="ACCEPT_ROOTED_TREES=1;" to the command line, input rooted trees should remain rooted.
You could add a newline to the output by doing something like this (which is not the prettiest solution, but does the job with minimal fuss).

logfile=log.tmp
hyphy label-tree.bf --internal-nodes None --list test_list.txt --label "test" --tree $in_tree --output $out_tree ENV="ACCEPT_ROOTED_TREES=1; >> $logfile; echo "\n" >>  $out_tree 

I am sure that purpose-build tree manipulators (like gotree) will do a better job that my scrips:)

Best,
Sergei

@liamfriar
Copy link
Author

Hi Sergei, as usual, thank you for the quick and informative reply! I am only using the labeled trees for hyphy RELAX so it sounds like the unrooting would not affect things.

@liamfriar liamfriar reopened this Dec 28, 2023
@liamfriar liamfriar reopened this Dec 28, 2023
@liamfriar
Copy link
Author

Hi again @spond et al, I reran my analysis using gotree rename instead of hyphy label-tree.bf to keep the tree rooted because I was curious if it would make a difference. Out of 2079 genes that I ran hyphy RELAX on, 61 had the ultimate result of relaxation, intensification, not_significant flip (using the default p-value<0.5 for each). If you are curious, I am happy to send you the trees and the sequences for a couple of those genes via email.

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