chaoszhang / ASTER

Accurate Species Tree EstimatoR series: a family of optimation algorithms for species tree inference implemented in C++ (including ASTRAL-Pro & Weighted ASTRAL)
GNU Affero General Public License v3.0
85 stars 9 forks source link

freqQuad.csv produced by wastral-hybrid -u3 is different from freqQuad.csv produced by astral -t16 #27

Open LPDagallier opened 3 weeks ago

LPDagallier commented 3 weeks ago

Hello,

I used astral-hybrid (weighted astral) from ASTER to produce freqQuad.csv using -u3 option, but the file produced seem to have calculated the stats on irrelevant nodes. To check, I used Astral (from https://github.com/smirarab/ASTRAL/tree/master) using option -q and -t16 to annotate the existing tree produced by astral-hybrid, and it did produce a very different freqQuad.csv.

From what I understand, even though Astral and Weighted-Astral are different, they should produce similar freqQuad.csv statistics for the same data (or at least very close data on the same nodes). Could it be that the way ASTER produces freqQuad.csv has a bug in the code? I tried to look at the source code (https://github.com/chaoszhang/ASTER/commit/548fd31493397ec44f5c8e3452c689e547b3e271) but I'm not familiar with c++.

Here is the repro example using test data from Astral:

astral-hybrid -t 8 -x 100 -n 0 -r 16 -s 16 -u 3 -i test_data/1KP-genetrees.tre -o ASTER_example.tree 2> ASTER_example.log
mv freqQuad.csv ASTER_example_freqQuad.csv

Rscript tree_reformat_for_astral_annotations.R ASTER_example.tree #use R script to remove node support from tree

astral -q ASTER_example.tree -i test_data/1KP-genetrees.tre -t 16 -o ASTRAL_example.tree 2> ASTRAL_example.log
mv freqQuad.csv ASTRAL_example_freqQuad.csv

Versions used: ASTER 1.15 ASTRAL 5.7.7

Output files (see how the 2 freqQuad.csv are different): ASTER_example.log ASTER_example_freqQuad.csv ASTRAL_example.log ASTRAL_example_freqQuad.csv

Rscript tree_reformat_for_astral_annotations.R (could not attach it):

##############################################################################
# Description: Takes annotated ASTRAL tree as input and write a tree with annotations removed
# It needs to be called as follow: Rscript tree_reformat_for_astral_annotations.R <tree file to process>
# Author: Leo-Paul Dagallier
# Date Created: 2023-11-08
##############################################################################

# Packages -------------------------------------------------------------------
library(treeio)
# Inputs/parameters ----------------------------------------------------------
args = commandArgs(trailingOnly=TRUE)
# args = "wastral_hybrid_Merianieae_009_hybpiper2_paragone_MI_genetrees_raxml_9992160_paragone_10.trees.tree"
tree_file <- args[1]
# Main code ------------------------------------------------------------------
tree <- as.phylo(treeio::read.astral(tree_file))
treeio::write.tree(phy = tree, file = tree_file)
# End of script
##############################################################################