binomial test of symetry

120 views
Skip to first unread message

Michel Domínguez Díaz

unread,
Jun 12, 2019, 7:09:01 AM6/12/19
to IQ-TREE

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


Th


Minh Bui

unread,
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 https://github.com/Cibiv/IQ-TREE/releases (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:

TEST OF SYMMETRY:
  --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
Name,SymSig,SymNon,SymBi,MarSig,MarNon,MarBi,IntSig,IntNon,IntBi
part1,44,92,6.28775e-24,50,86,5.87435e-30,4,132,0.912781
part2,43,93,5.67514e-23,49,87,6.43434e-29,5,131,0.815054
part3,23,113,3.04046e-07,37,99,1.49562e-17,7,129,0.523227

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,
Minh

--
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 iqtree+un...@googlegroups.com.
To post to this group, send email to iqt...@googlegroups.com.
Visit this group at https://groups.google.com/group/iqtree.
To view this discussion on the web visit https://groups.google.com/d/msgid/iqtree/fd5bd67d-9b08-4836-a188-b2148fe5100f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

jacob...@gmail.com

unread,
Aug 26, 2020, 5:11:25 PM8/26/20
to IQ-TREE
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

unread,
Aug 26, 2020, 8:31:50 PM8/26/20
to iqt...@googlegroups.com, jacob...@gmail.com
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 (https://doi.org/10.1093/gbe/evz193):

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).

Cheers
Minh
> To view this discussion on the web visit https://groups.google.com/d/msgid/iqtree/be15e6a3-c1b0-4c9a-9e15-3b6da3ddc028n%40googlegroups.com.

Jacob Berv

unread,
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… 

Best,
Jake

Minh Bui

unread,
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 https://github.com/iqtree/iqtree2/issues, that’s the place to remind us of something TODO from time to time.

Cheers
Minh
Reply all
Reply to author
Forward
0 new messages