binomial test of symetry

Skip to first unread message

Michel Domínguez Díaz

Jun 12, 2019, 7:09:01 AM6/12/19

Good day,

I am interest in the BiSymTests. Those tests explore stationary, reversible and homogeneous (SRH) conditions of partitions. Those tests were suggested by Naser-Khdour et al. in your preprint “The prevalence and impact of model violations in phylogenetics analysis”.

Also those tests were implanted in IQ-TREE (Beta version 1.7 – beta 2) with command line --bisymtest (binomial test of symmetry) at first time.


New command lines were added at Beta version 1.7 – beta 4, Beta version 1.7 – beta 5, and Beta version 1.7 – beta 7, however I do not know if those new command lines (binomial test of symmetry) are in the last version of IQ-TREE (1.6.10 or 1.6.11 versions), also I do not know who apply those command lines (I could not find those commands in the manuals of IQ-TREE), so I am two questions:

1)     Which IQ-TREE version contains the binomial test of symmetry?

2)     How I can apply the binomial test of symmetry (e.g., command lines, input, etc)?
Than you so much, Michel


Minh Bui

Jun 25, 2019, 10:18:25 AM6/25/19
to IQ-TREE, Michel Domínguez Díaz
Hi Michel,

Thanks for your interest and apology for the delay - I was travelling.

The tests of symmetry are only available in the beta version 1.7, not the stable release 1.6. That’s why they are not described in the manual yet. 

1)     Which IQ-TREE version contains the binomial test of symmetry?

I recommend you download the latest beta version from (currently beta12). 

2)     How I can apply the binomial test of symmetry (e.g., command lines, input, etc)?

Let’s first show the help usage:

  --bisymtest             Perform three binomial tests of symmetry
  --maxsymtest NUMBER     Replicates for maximum tests of symmetry
  --symtest-remove-bad    Do --bisymtest and remove bad partitions
  --symtest-remove-good   Do --bisymtest and remove good partitions
  --symtest-type MAR|INT  Use MARginal/INTernal test when removing partitions
  --symtest-pval NUMER    P-value cutoff (default: 0.05)
  --symtest-keep-zero     Keep NAs in the tests

Simply run IQ-TREE as follows:

iqtree -s ALN_FILE -p PARTITION_FILE --bisymtest

To identify partition that failed the tests. In the log file, you will see something like:

Performing matched-pair tests of symmetry... 100% 0.006 seconds
SymTest results written to example.nex.symtest.csv

Actually you can kill the run once IQ-TREE passed this point and look at the csv file. This file may look like this (from the example alignment):

# Matched-pair tests of symmetry
# This file can be read in MS Excel or in R with command:
#    dat=read.csv('example.nex.symtest.csv',comment.char='#')
# Columns are comma-separated with following meanings:
#    Name:    Partition name
#    SymSig:  Number of significant sequence pairs by test of symmetry
#    SymNon:  Number of non-significant sequence pairs by test of symmetry
#    SymBi:   P-value for binomial test of symmetry
#    MarSig:  Number of significant sequence pairs by test of marginal symmetry
#    MarNon:  Number of non-significant sequence pairs by test of marginal symmetry
#    MarBi:   P-value for binomial test of marginal symmetry
#    IntSig:  Number of significant sequence pairs by test of internal symmetry
#    IntNon:  Number of non-significant sequence pairs by test of internal symmetry
#    IntBi:   P-value for binomial test of internal symmetry

The relevant columns that SymBi, MarBi and IntBi, which are the p-values for 3 different variants of the test of symmetry. A p-value < 0.05 indiciates that the partition is rejected by the test, i.e. does not comply with statitionarity / reversibility or homogeneity conditions.

You can ask IQ-TREE to remove “bad” partitions from subsequent analysis by adding --symtest-remove-bad option. By default, this will remove partititons with SymBi < 0.05. 

Hope that helps for now. We will write this in a proper document.

Thanks for your patience,

You received this message because you are subscribed to the Google Groups "IQ-TREE" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
To view this discussion on the web visit
For more options, visit

Aug 26, 2020, 5:11:25 PM8/26/20
Hi Minh,

Could you explain the purpose of the --symtest-keep-zero option? Does this mean that partitions which cannot be tested are kept in the downstream analysis?

Best wishes,
Jake Berv

Minh Bui

Aug 26, 2020, 8:31:50 PM8/26/20
Hi Jake,

Long story short: ignore this option, the default is good. This option was introduced while I encountered a technical problem with the test, which was then solved.

If you want to know: This option concerns with a technical implementation of the symmetry test. It’s explained the paper regarding this sentence (

A P value is then obtained by a chi^2 test
with f degrees of freedom, where f is the number of (i, j)
pairs for which d_ij + d_ji > 0.

With --symtest-keep-zero option, IQ-TREE actually then renders the test to be inapplicable for any locus, where there exist an (i,j) pair such that d_ij + d_ji = 0. But that’s not good for (many) sparse divergence matrix, especially amino-acid. Therefore, we use a reduced degree of freedom of f, instead of (m choose 2).

> To view this discussion on the web visit

Jacob Berv

Aug 27, 2020, 1:14:31 PM8/27/20
to Minh Bui, IQ-TREE
Cool — thanks for the clarification. 

On a related note — say for example I have a directory containing fasta files of coding sequence alignments in reading frame. Is there an automated way to tell IQtree to consider codon positions as separate partitions for each locus separately? Or do I need to first parse out codon positions from each locus before passing them to IQtree. I know I can pass IQtree a partition file that specifies how to generate sub-partitions for individual sequence alignments (or alternatively, it’s easy enough it's easy enough to parse out before analysis) but it would be convenient to be able to direct IQtree to multiple directories (for example, directory 1 = coding sequence alignments, directory 2 = noncoding sequence alignments), and also then flag IQtree to further partition each locus in directory 1 into codon positions for subsequent analyses. Or something like that… 


Minh Bui

Aug 31, 2020, 7:38:19 AM8/31/20
to Jacob Berv, IQ-TREE
Hi Jake,

I vaguely remember that someone else requested that feature. It’s a valid request, we just don’t have enough resources to do it. In fact we are focussing on COVID-19 at the moment. You can nevertheless create a github issue here, that’s the place to remind us of something TODO from time to time.

Reply all
Reply to author
0 new messages