output quartet mapping from prefined groups

28 views
Skip to first unread message

Karen Meusemann

unread,
Mar 14, 2017, 8:21:21 AM3/14/17
to IQ-TREE, r.pe...@zfmk.de, in...@sabrina-simon.com
Hi all,

I am doing quite a lot foul cluster likelehood analyses (quatzed mapping) to test signals / hypotheses.

What is very nice that e.g. the output for each species is recorded: e.g.
Quartet support of areas 1-7 (mainly for clustered analysis):

                   resolved                                           partly                                             unresolved  name
     #quartets     1 (% 1)          2 (% 2)          3 (% 3)          4 (% 4)          5 (% 5)          6 (% 6)          7 (% 7)
------------------------------------------------------------------------------------------------------------------------------------------------
1   320      228     (71.25 ) 64      (20.00 ) 24      (7.50  ) 1       (0.31  ) 1       (0.31  ) 2       (0.62  ) 0       (0.00  )  SpeciesA


I am in particular interested in rsions 1, 2 and 3. I looked at the log file, the quartetlikelihoods etc. If I have not only one topology, but several suportet (like here) is there any way to find out what quartets (so which species) support region 1, resectively 2 and 3?
e.g. list numbers (that can be traced back to) species names? This would be very very helpfull to properly interpret results.
So how can I extract quartets in region 1, 2, 3 to check what species they represent?

many thanks, best Karen
karen

Bui Quang Minh

unread,
Mar 17, 2017, 9:07:08 AM3/17/17
to IQ-TREE, r.pe...@zfmk.de, in...@sabrina-simon.com
Hi Karen,

I briefly talked with Heiko about this, but seems that some coding is needed as there is no direct option to help with this. 

What  you can do right now is use option -wql to print the log-likelihoods of all 3 quartets for any 4 species. From this, you can extract all quartets that contain your species of interest, and then whether it belongs to the 3 corners. But this may need some scripting (e.g. in R) to process this file…

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.

--
Bui Quang Minh
Center for Integrative Bioinformatics Vienna (CIBIV)
Campus Vienna Biocenter 5, VBC5, Ebene 1
A-1030 Vienna, Austria
Phone: ++43 1 4277 74326
Email: minh.bui (AT) univie.ac.at







Karen Meusemann

unread,
Mar 17, 2017, 9:36:40 AM3/17/17
to IQ-TREE, r.pe...@zfmk.de, in...@sabrina-simon.com, Bernhard Misof

Hi Minh,

thanks - would be highly appreciate :) !!

Anyway, I fortunately i alreay "-wql" an looked at the file "fclm_hypo1_permIII.lmap.quartetlh"
receiving e.g. this

SeqIDs    lh1    lh2    lh3    weight1    weight2    weight3
(89,98,9,82)    -7.08158e+06    -7.08158e+06    -7.08155e+06    1.76829e-12    8.94193e-11    1
(89,98,9,71)    -7.08151e+06    -7.08151e+06    -7.0815e+06    0.00539908    2.85129e-06    0.994598

I struggled since I don't get what weight 1, 2, 3 mean:
does the "weight" indicate the corners, so for the 2 quartets belong to region 3 (because weight 3 have the value 1 (or close do 1?))
If so, are weights referring to the regions 1, 2, 3 (out of 7) or to either a1, a2, a3?

If you help me to understand the results how I conclude from numbers e.g. in which region each quartet was mapped,
would be very helfull though :) - for further scripting.

Thanks a lot
Karen

Bui Quang Minh

unread,
Mar 17, 2017, 10:09:00 AM3/17/17
to iqt...@googlegroups.com, r.pe...@zfmk.de, in...@sabrina-simon.com, Bernhard Misof
Hi Karen,

Heiko can correct me if I am wrong. But as far as I understood, each line contains the IDs of four sequences, say (A,B,C,D). SeqID 1 corresponds to the first sequence in the aligmment, etc. Then the next 3 numbers are the log-likelihoods of 3 quartets: AB|CD, AC|BD, AD|BC. The last 3 numbers are the weights of these quartets. You can base on these weights to decide which corner of the triangle the quartet falls into. The two lines you posted:

SeqIDs    lh1    lh2    lh3    weight1    weight2    weight3
(89,98,9,82)    -7.08158e+06    -7.08158e+06    -7.08155e+06    1.76829e-12    8.94193e-11    1
(89,98,9,71)    -7.08151e+06    -7.08151e+06    -7.0815e+06    0.00539908    2.85129e-06    0.994598

have weight3 of 1 or nearly 1. So they belong to the corner correspoding to quartet AD|BC. However, I don’t know the exact criterion for the 3 weights to decide on this. But Heiko can help you, or you can also read the original paper 


;-)

Minh

Heiko Schmidt

unread,
Mar 17, 2017, 10:43:17 AM3/17/17
to iqt...@googlegroups.com, r.pe...@zfmk.de, in...@sabrina-simon.com, Bernhard Misof
Hi Karen,

> thanks - would be highly appreciate :) !!
>
> Anyway, I fortunately i alreay "-wql" an looked at the file "fclm_hypo1_permIII.lmap.quartetlh"
> receiving e.g. this
>
> SeqIDs lh1 lh2 lh3 weight1 weight2 weight3
> (89,98,9,82) -7.08158e+06 -7.08158e+06 -7.08155e+06 1.76829e-12 8.94193e-11 1
> (89,98,9,71) -7.08151e+06 -7.08151e+06 -7.0815e+06 0.00539908 2.85129e-06 0.994598
>
> I struggled since I don't get what weight 1, 2, 3 mean:
> does the "weight" indicate the corners, so for the 2 quartets belong to region 3 (because weight 3 have the value 1 (or close do 1?))
> If so, are weights referring to the regions 1, 2, 3 (out of 7) or to either a1, a2, a3?

The weight refers to the likelihood weights (or posterior weights or posterior probability assuming a uniform prior), that means is the likelihood (not the log-likelihood!) of that corresponding quartet divided by the sum of the 3 likelihoods.

Hence, these 3 weights should add up to 1.0 (ignoring rounding errors). The weights are closest to (1,0,0), (0,1,0) or (0,0,1) they reflects the three corner regions (as in your example), if the three weights are closest to (0, .5, .5), (.5, 0, .5), (.5, .5, 0) it is one of the partly resolved quartets, and in the seventh case, i.e. closest to (1/3, 1/3, 1/3) it is an unresolved quartet. They determine as coordinates exactly where the dot falls in 3D, and thus in the triangular simplex plot.

More information can be found in any of the documents describing likelihood mapping in the context of TREE-PUZZLE like Strimmer+von Haeseler (1997, PNAS, the original likelihood mapping article), Schmidt+von Haeseler (2003/2007, in Current Protocols in Bioinformatics), Schmidt+von Haeseler (2009, in The Phylogenetic Handbook) or the TREE-PUZZLE manual.


> If you help me to understand the results how I conclude from numbers e.g. in which region each quartet was mapped, would be very helfull though :) - for further scripting.

The indices describing the quartet refer to the sequences in the order they are in the alignment.
Full names in files with n^4 quartets would take by far too much extra space.

I hope I could help.

Best wishes,
Heiko

Karen Meusemann

unread,
Mar 17, 2017, 11:22:36 AM3/17/17
to IQ-TREE, r.pe...@zfmk.de, in...@sabrina-simon.com
Hi Heike and Minh,

first many thanks - I have still few questions (sorry)


The weight refers to the likelihood weights (or posterior weights or posterior probability assuming a uniform prior), that means is the likelihood (not the log-likelihood!) of that corresponding quartet divided by the sum of the 3 likelihoods.

okay

Hence, these 3 weights should add up to 1.0 (ignoring rounding errors). The weights are closest to (1,0,0), (0,1,0) or (0,0,1) they reflects the three corner regions (as in your example), if the three weights are closest to (0, .5, .5), (.5, 0, .5), (.5, .5, 0) it is one of the partly resolved quartets, and in the seventh case, i.e. closest to (1/3, 1/3, 1/3) it is an unresolved quartet. They determine as coordinates exactly where the dot falls in 3D, and thus in the triangular simplex plot.

Yes thanks - I am aware and also do unterstand the 3D simplex plot graph and how this works. 

More information can be found in any of the documents describing likelihood mapping in the context of TREE-PUZZLE like Strimmer+von Haeseler (1997, PNAS, the original likelihood mapping article), Schmidt+von Haeseler (2003/2007, in Current Protocols in Bioinformatics), Schmidt+von Haeseler (2009, in The Phylogenetic Handbook) or the TREE-PUZZLE manual.

Still it would be great if I know the values (borders)  (weights) for e.g. the Voronoi cell T1 (T2, T3...), ideally for all, but for now  
I am only interested in the resolved parts of the graphs. (Graphically borders are the lines deviding the simplex graph into the 7 Voronoi cells..., but in numbers?.

Knowing that I could extract only those laying in the 3 resolved parts. Background: I am interested
if there are special "taxa combinations" from always e.g. in T3: lets say, I have 16 taxa (4 groups), and all quartets alre in T1 except for those having taxa 14, 15, 16. (I can here track back the numbers, since the IDs are in the log file as well).
 
The indices describing the quartet refer to the sequences in the order they are in the alignment.
Full names in files with n^4 quartets would take by far too much extra space.

Yeah understand. Anyway, if you have a good idea how to summarize this or so in a next version would be appreciated...

Many thanks in advance
Karen

Karen Meusemann

unread,
Mar 23, 2017, 4:36:44 PM3/23/17
to IQ-TREE, in...@sabrina-simon.com
Hi Heiko,

can you please answer my last questions please if possible ? You can also email me privately of course.

Many thanks Karen

Heiko Schmidt

unread,
Mar 23, 2017, 6:06:37 PM3/23/17
to iqt...@googlegroups.com

> Still it would be great if I know the values (borders) (weights) for e.g. the Voronoi cell T1 (T2, T3...), ideally for all, but for now
> I am only interested in the resolved parts of the graphs. (Graphically borders are the lines deviding the simplex graph into the 7 Voronoi cells..., but in numbers?.

Actually we never computed the exact course of the borders (neither in TREE-PUZZLE nor in IQ-Tree) , because they are not needed for the decision into which area a dot falls. This is determined by computing the Euclidean distance to the 7 centres of gravity (1,0,0), (0,1,0), (0,0,1), (0,.5,.5) ... (1/3,1/3,1/3) and choosing the one with the smallest distance.

Since you mention Voronoi - the borders are of course geometrically well defined since we use the Euclidean distance. The are crossing the direct line between the two neighbouring centres of gravity (also know as points or seeds) exactly rectangular and equidistant (i.e. in the middle) to both points. From that crossing point the borderline is extended until it meets another border.

I hope that helps a little.

> Knowing that I could extract only those laying in the 3 resolved parts. Background: I am interested
> if there are special "taxa combinations" from always e.g. in T3: lets say, I have 16 taxa (4 groups), and all quartets alre in T1 except for those having taxa 14, 15, 16. (I can here track back the numbers, since the IDs are in the log file as well).

Easier than trying to figure out whether a dot is right or left of a border would be to currently compute the Euclidean Distance again and keep those for which the weights are closest to (1,0,0), (0,1,0) or (0,0,1).

However, it might interest you that we think about adding the resulting regions (1-7) and areas (a1-a3) to the -wql output file ;)

Best wishes,
Heiko


Karen Meusemann

unread,
Mar 24, 2017, 9:53:58 AM3/24/17
to IQ-TREE, in...@sabrina-simon.com, ralph_...@hotmail.com
Hi Minh and Heiko,


>Easier than trying to figure out whether a dot is right or left of a border would be to currently compute the Euclidean Distance again and keep those for which the weights are >closest to (1,0,0), (0,1,0) or (0,0,1).

yes, true!!!


>However, it might interest you that we think about adding the resulting regions (1-7) and areas (a1-a3) to the -wql output file ;)
oh - :) :) I highly appreciate that as this would be exactly what I need  (I think) - so I have a info about this for every quartet!

Looking fw and I am also available for testing if you like!

Best, Karen


Reply all
Reply to author
Forward
0 new messages