Interpreting the matrix Q

74 views
Skip to first unread message

Alejandro Edera

unread,
Jan 24, 2018, 9:01:33 PM1/24/18
to IQ-TREE
Dear IQ-TREE team,

I have some difficulties to understand the results printed by IQ-TREE in the .iqtree file. Using an UNREST model, I got the following rate parameters from an alignment of nucleotides:

  A-C: 1.5847
  A-G: 0.8785
  A-T: 0.5367
  C-A: 0.9639
  C-G: 0.4934
  C-T: 3.9507
  G-A: 1.2790
  G-C: 1.0033
  G-T: 1.0000
  T-A: 1.0000
  T-C: 1.0000
  T-G: 1.0000

The following equilibrium distributions:

  pi(A) = 0.2627
  pi(C) = 0.1801
  pi(G) = 0.2048
  pi(T) = 0.3524

And this Q matrix:

  A   -0.8592    0.4539    0.2516    0.1537
  C    0.2761    -1.549    0.1413     1.132
  G    0.3663    0.2874   -0.9401    0.2864
  T    0.2864    0.2864    0.2864   -0.8592

The model of rate heterogeneity is uniform.

I expected that, e.g., the entry A-C in the Q matrix would be equal to the A-C rate * pi(C). But, 0.4539 is not equal to 1.5847 * 0.1801.

I am really interested to know how IQ-TREE calculates the Q matrix from a given set of rate parameters & equilibrium distributions.


Cheers,



Brian Foley

unread,
Jan 25, 2018, 9:41:45 AM1/25/18
to IQ-TREE
Finding a C -> T rate that is about 4X higher than T -> C, and not finding transitions higher than transversions, makes me think
you have some very strange data.  I have never seen anything like that.

The values in the Q matrix are not supposed to be rate times percentage of each base.



Bui Quang Minh

unread,
Jan 27, 2018, 7:22:15 AM1/27/18
to IQ-TREE, Alejandro Edera
Hi there,

Firstly please refrain from using UNREST model, which is currently not maintained. Instead, use 12.12 model (which is part of Lie Markov models), which uses another parameterisation.

Regarding your question: For non-reversible model the Q rate entries are not written as r_{ij} * pi_j like reversible models. Instead, Q entries are simply r_{ij} rescaled by a factor s.t. \sum_i (q_{ii}*p_i) = -1. So the normalisation is still the same as for reversible models. Moreover, you can compute pi vector directly from Q matrix solving this linear algebra: Q*pi = 0.

Does this help?

Cheers, 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.
> For more options, visit https://groups.google.com/d/optout.

Alejandro Edera

unread,
Jan 28, 2018, 4:23:17 AM1/28/18
to IQ-TREE
Hi,


On Saturday, 27 January 2018 09:22:15 UTC-3, Bui Quang Minh wrote:
Hi there,

Firstly please refrain from using UNREST model, which is currently not maintained. Instead, use 12.12 model (which is part of Lie Markov models), which uses another parameterisation.

Ok.
 

Regarding your question: For non-reversible model the Q rate entries are not written as r_{ij} * pi_j like reversible models. Instead, Q entries are simply r_{ij} rescaled by a factor s.t. \sum_i (q_{ii}*p_i) = -1. So the normalisation is still the same as for reversible models. Moreover, you can compute pi vector directly from Q matrix solving this linear algebra: Q*pi = 0.

Does this help?

Yes, it does. Many thanks.
 

Cheers, Minh

Cheers,
Reply all
Reply to author
Forward
0 new messages